Skip to content

Commit 52dec95

Browse files
Merge pull request #9 from ISISComputingGroup/gui_copyedit
Copyedit GUI building section
2 parents 891a5f9 + 7da7d40 commit 52dec95

34 files changed

+332
-858
lines changed

doc/Client.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
:glob:
77
:titlesonly:
88
9-
client/GUI-Getting-Started
9+
client/GUI-Building
1010
client/GUI-Coding
1111
client/GUI-Testing
1212
client/GUI-Eclipse

doc/Editing-the-Wiki.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,11 @@ This is a tip!
146146
:::
147147

148148
The list of supported admonitions is [on the MyST documentation](https://myst-parser.readthedocs.io/en/latest/syntax/admonitions.html).
149+
150+
## Removing & deleting pages
151+
152+
When moving pages, it is helpful to add redirects to the new location, so that links external to the wiki continue to
153+
work. To do this, we are using the [`sphinx-reredirects`](https://documatt.com/sphinx-reredirects/usage/) plugin.
154+
155+
When moving a page, add a redirect from the old location to the new location. When deleting a page, add a redirect to
156+
the most suitable alternative documentation. The redirects are configured by the `redirects` key in `doc/conf.py`.

doc/Script-Generator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ script_generator/*
2222
| Standalone app build directories | `base/uk.ac.isis.scriptgenerator/*` |
2323

2424
## Eclipse build
25-
To build and run the app through eclipse, the script generator product is found in `base\uk.ac.stfc.isis.scriptgenerator.client.product`. The instructions for setting up eclipse and loading the target platform (necessary for the script generator) are found in the instructions for the [main IBEX GUI setup](/client/getting_started/Building-the-GUI)
25+
To build and run the app through eclipse, the script generator product is found in `base\uk.ac.stfc.isis.scriptgenerator.client.product`. The instructions for setting up eclipse and loading the target platform (necessary for the script generator) are found in the instructions for the [main IBEX GUI setup](/client/compiling/Building-the-GUI)
2626

2727
{#scriptgenerator_enable_perspective}
2828
### Adding the perspective into the client

doc/client/GUI-Building.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Building
2+
3+
```{toctree}
4+
:glob:
5+
:titlesonly:
6+
7+
compiling/*
8+
```

doc/client/GUI-Getting-Started.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

doc/client/GUI-Troubleshooting.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ The following pages also contain GUI troubleshooting information for specific pr
1111
troubleshooting/*
1212
```
1313

14+
## Display resolution & scaling
15+
16+
If the GUI loads up but items are the wrong size, you may need to change your display settings. The exact settings that
17+
you need may vary from computer to computer. This is a common issue on Windows 10 machines due to the OS' scaling
18+
setting for text, icons etc. that is meant to ensure they do not look too small on high screen resolutions.
19+
20+
Generally a resolution of 1920 x 1080 with a scaling factor of 100% should look correct on standard screens. You can
21+
increase both of those settings slightly if you feel like the display elements look uncomfortably small.
22+
1423
## IBEX appears fullscreen with top menu items hidden
1524

1625
Solution: right click inside any OPI and select "exit full screen".
@@ -95,7 +104,6 @@ Add `Eclipse-BundleShape: dir` in the `MANIFEST.MF`; see the `.opis` `MANIFEST.M
95104
This makes the maven build build the directory into a directory rather than a jar, which is sometimes necessary to let eclipse then "see" the files natively on the filesystem. If you look in the `plugins/` folder of a built client you should see a folder for `.opis` but a `.jar` for most other ibex modules - except for a few that need to be built as directories, as you may be finding.
96105

97106

98-
99107
## Other issues
100108
### Remote debugging with Eclipse
101109
The following has been done to ensure that it is possible to debug the IBEX GUI running on any particular instrument:
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Building the GUI
2+
3+
:::{important}
4+
Before following this guide, ensure you have completed the following steps from
5+
[the first-time installation guide](/overview/First-Time-Build):
6+
- [Install Java JDK](#first_time_install_java)
7+
- [Install Maven](#first_time_install_maven)
8+
- [Install Git](#first_time_install_git)
9+
- [Install Python (Uktena)](#first_time_install_uktena)
10+
:::
11+
12+
{#gui_build_checkout_code}
13+
## Checking out the code
14+
15+
Development builds of the IBEX GUI are conventionally located in `c:\instrument\dev`. Create this folder if it
16+
doesn't already exist.
17+
18+
From a windows command prompt, navigate to `c:\instrument\dev` and run:
19+
20+
```
21+
git clone --recursive https://github.com/ISISComputingGroup/ibex_gui.git
22+
```
23+
24+
The code for the IBEX GUI will now be located in `c:\instrument\dev\ibex_gui`.
25+
26+
A [pre-commit hook](https://github.com/ISISComputingGroup/IBEX/issues/4786) should now be installed; to do this, run:
27+
28+
```
29+
cd c:\instrument\dev\ibex_gui\build
30+
install_pre_commit_hook.bat
31+
```
32+
33+
{#gui_build_install_eclipse}
34+
## Installing Eclipse
35+
36+
You must use a version of eclipse which supports the RCP and Java versions currently in use by the client. There are
37+
two options for this:
38+
- Download a recent Eclipse version directly from
39+
[the eclipse website](https://www.eclipse.org/downloads/packages/); choose the package for "RCP and RAP developers"
40+
- Use the most recent version in `\\isis\inst$\Kits$\CompGroup\ICP\Developer Tools` (which is simply a download from
41+
the Eclipse website, at a specific version).
42+
43+
By convention eclipse versions are installed into `c:\tools`, for example in
44+
`c:\tools\eclipse-rcp-2024-06-R-win32-x86_64`.
45+
46+
After installing eclipse from either of the above sources, you will need to add the line
47+
```
48+
-Djdk.util.zip.disableZip64ExtraFieldValidation=true
49+
```
50+
to the end of `eclipse.ini` (located next to the `eclipse.exe` executable), if it is not already present.
51+
52+
{#gui_build_via_eclipse}
53+
## Building in Eclipse
54+
55+
:::{seealso}
56+
If at any point during these instructions you get errors, there are troubleshooting notes for Eclipse
57+
[here](../eclipse/Common-Eclipse-Issues) and for the GUI in general [here](../GUI-Troubleshooting).
58+
:::
59+
60+
The first time the Eclipse IDE is started, it will ask you for a folder to use as a workspace.
61+
Unless you have a specific reason to choose a different location, use `c:\Instrument\dev\eclipse_workspaces\ibex_gui`
62+
(create this folder if it doesn't already exist).
63+
64+
![](eclipse_workspace_selection.png)
65+
66+
From the menu bar choose File -> Import -> General -> Existing Projects into Workspace.
67+
Choose "Select root directory" and browse to `c:\Instrument\dev\ibex_gui\base`. You should now see a list of plugins
68+
to import with names like `uk.ac.stfc.isis.ibex.*`. Eclipse should automatically select everything so you just need
69+
to click "Finish" to add them to the project.
70+
71+
:::{tip}
72+
If "Marketplace solutions available" dialogues appear, click cancel; these will be obtained later.
73+
:::
74+
75+
<img src="eclipse_import_ibex_gui.png" width=400>
76+
77+
From the "Project Explorer" tab on the left, expand the target platform folder (labelled as
78+
`uk.ac.stfc.isis.ibex.targetplatform`), double click on the `targetplatform.target` file and choose
79+
"Set as Active Target Platform". This may take some time as dependencies are downloaded - there is a progress bar
80+
in the very bottom-right of the Eclipse IDE.
81+
82+
Once the target platform has finished downloading, the target platform view should look like this:
83+
84+
<img src="eclipse_target_platform_view.png" width=600>
85+
86+
To run the application from within Eclipse: open `ibex.product` from the `uk.ac.stfc.isis.ibex.e4.client.product`
87+
folder, select "Launch an Eclipse application". The IBEX GUI should now open.
88+
89+
Next, From the menu bar choose Run->Run configurations and select `ibex.product` from the left hand list under
90+
"Eclipse Application". In the "Main" tab, in **Run configurations**, tick the "Clear" tick box and untick the
91+
"Ask for confirmation before clearing".
92+
93+
<img src="eclipse_clear_workspace.png" width=400>
94+
95+
In the "Configuration" tab, tick the "Clear the configuration area before launching" tick box, then click "Apply"
96+
and select "Run".
97+
98+
Lastly, you should [set up checkstyle](../eclipse/Checkstyle-setup).
99+
100+
{#gui_build_via_maven}
101+
## Building via Maven
102+
103+
Firstly, ensure you have a recent Maven version installed. Generally a suitable version will be the highest version
104+
number in `\\isis\inst$\Kits$\CompGroup\ICP\Binaries`. You can double-check your current Maven version by running
105+
`mvn -v` in a command prompt.
106+
107+
To build using Maven, run:
108+
109+
```
110+
cd c:\Instrument\dev\ibex_gui\build
111+
build.bat
112+
```
113+
114+
Once the build finishes, the IBEX client executable can be found in `.\built_client\`.
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# Maven and Tycho
2+
3+
The IBEX GUI is built using Tycho, which is a Maven plugin used for building Eclipse RCP products.
4+
5+
This document provides a brief overview of both Maven and Tycho.
6+
7+
:::{seealso}
8+
[Code chats](/processes/meetings/Code-Chats-and-Lightning-Talks) have been given on this topic (
9+
[slides](https://stfc365.sharepoint.com/:p:/r/sites/ISISExperimentControls/ICP%20Discussions/GUI_Chat_Slides/IBEX%20GUI%20build%20system.pptx?d=w74aa3046025f4622bcdeadbdeca9395c&csf=1&web=1&e=aQEGJZ),
10+
[recording](https://stfc365.sharepoint.com/sites/ISISExperimentControls/_layouts/15/stream.aspx?id=%2Fsites%2FISISExperimentControls%2FICP%20Discussions%2FGUI%5FChat%5FSlides%2FIBEX%20GUI%20build%20System%20Code%20chat%2Emp4&amp;referrer=StreamWebApp%2EWeb&amp;referrerScenario=AddressBarCopied%2Eview&referrer=StreamWebApp%2EWeb&referrerScenario=AddressBarCopied%2Eview%2E0f53ae8b%2D3184%2D43c1%2D955e%2D039109fcd0e1)
11+
).
12+
:::
13+
14+
## Maven
15+
16+
The official description:
17+
18+
> _Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model
19+
> (POM), Maven can manage a project's build, reporting and documentation from a central piece of information._
20+
21+
In simple terms, Maven is a build automation tool used primarily for Java projects.
22+
23+
See the [getting started guide in the Maven documentation](https://maven.apache.org/guides/getting-started/index.html)
24+
for more information about what Maven is.
25+
26+
### POM files
27+
28+
POM files are XML files, called `pom.xml`, that describes the software project being built, its dependencies on other
29+
external modules and components, the build order, directories, and required plug-ins. In many ways, it can be considered
30+
the equivalent of a C-style Makefile as it defines how the project is built.
31+
32+
See [the Maven documentation](https://maven.apache.org/pom.html) for detailed information on the various sections of a
33+
`pom.xml` in a pure Maven project.
34+
35+
### Building a Maven project
36+
37+
Maven uses multiple build phases - for example, `compile`, `test`, `package`. If you are really unsure, a good
38+
default is to run `mvn clean verify` to build a project; this will clean the project (deleting any old build files),
39+
and then run compilation, unit tests, packaging, and verification (e.g. checkstyle) phases.
40+
41+
For more information, see the Maven
42+
[build lifecycle documentation](https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html).
43+
44+
## Tycho
45+
46+
Tycho is a set of Maven plugins and extensions for building Eclipse-based applications with Maven. Tycho allows Maven
47+
to support building bundles, fragments, features, P2 repositories, RCP applications etc.
48+
49+
Tycho is used to build the IBEX GUI application.
50+
51+
### Parent POM
52+
53+
Maven allows a parent POM to be defined which contains references to the other POM files for the other projects that
54+
make up an application. This is used in the IBEX GUI because it allows the centralisation of the settings for
55+
building the application.
56+
57+
The [IBEX GUI parent `pom.xml`](https://github.com/ISISComputingGroup/ibex_gui/blob/master/base/uk.ac.stfc.isis.ibex.client.tycho.parent/pom.xml)
58+
contains a lot of information, so here is a stripped down version to show the key points:
59+
60+
```xml
61+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
62+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
63+
<modelVersion>4.0.0</modelVersion>
64+
<groupId>CSS_ISIS</groupId>
65+
<artifactId>uk.ac.stfc.isis.ibex.client.tycho.parent</artifactId>
66+
<version>1.0.0-SNAPSHOT</version>
67+
<packaging>pom</packaging>
68+
69+
<properties>
70+
<tycho.version>4.0.9</tycho.version>
71+
<tycho-repo.url>https://oss.sonatype.org/content/groups/public/</tycho-repo.url>
72+
<photon-repo.url>http://download.eclipse.org/releases/2024-09</photon-repo.url>
73+
<photon-updates-repo.url>http://download.eclipse.org/eclipse/updates/4.33</photon-updates-repo.url>
74+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
75+
</properties>
76+
77+
<repositories>
78+
<repository>
79+
<id>photon-updates</id>
80+
<layout>p2</layout>
81+
<url>${photon-updates-repo.url}</url>
82+
</repository>
83+
</repositories>
84+
85+
<build>
86+
<plugins>
87+
<plugin>
88+
<groupId>org.eclipse.tycho</groupId>
89+
<artifactId>tycho-maven-plugin</artifactId>
90+
<version>${tycho.version}</version>
91+
<extensions>true</extensions>
92+
</plugin>
93+
<!-- Other maven plugins omitted such as unit testing and checkstyle -->
94+
</plugins>
95+
</build>
96+
97+
<modules>
98+
<module>../uk.ac.stfc.isis.ibex.client.product</module>
99+
<module>../uk.ac.stfc.isis.ibex.feature.base</module>
100+
<!-- Other modules that make up IBEX would be listed here -->
101+
<module>../uk.ac.stfc.isis.ibex.ui.mainmenu.tests</module>
102+
</modules>
103+
</project>
104+
```
105+
106+
Let's explain the various parts shown:
107+
* At the top we have the standard Maven metadata: `groupId`, `artifactId`, `version`.
108+
* The properties section is used to define URLs for the Tycho plugin and the Eclipse RCP framework. The versions here
109+
are updated periodically during [dependency updates](/processes/dev_processes/Dependency-Updates)
110+
* The repositories section tells Maven to look for a repository for the Eclipse RCP framework version specified above
111+
* The build section defines the Maven plugins necessary to build the application. The Tycho plugin entry tells Maven to
112+
download Tycho and use it as part of the build process
113+
* The modules section lists the locations of the POM files for the various modules that make up the application. When a
114+
new module is added to IBEX, it will need to be added to this list.
115+
116+
### Child POM
117+
118+
A typical child POM look like
119+
[this](https://github.com/ISISComputingGroup/ibex_gui/blob/master/base/uk.ac.stfc.isis.ibex.dashboard/pom.xml).
120+
It is very simple - it points at the parent POM to get most of its information. These is one of these `pom.xml` files
121+
for each module that makes up the IBEX client.
122+
123+
The packaging type is defined as `eclipse-plugin`; this is a packaging type defined by Tycho. Other Tycho types used in
124+
IBEX are `eclipse-feature` for features, `eclipse-test-plugin` for fragment projects that define unit tests and
125+
`eclipse-repository` for configuring builds.
126+
127+
### Application POM
128+
129+
In IBEX we define a separate project called `uk.ac.stfc.isis.ibex.e4.client.product` which defines how the product is
130+
built. It has a
131+
[POM file](https://github.com/ISISComputingGroup/ibex_gui/blob/master/base/uk.ac.stfc.isis.ibex.e4.client.product/pom.xml)
132+
of packaging type `eclipse-repository`.
133+
134+
The key area is the `materialize-products` section, this tells Tycho to actually create the product. Without this Maven
135+
will compile & unit test the code, but will not produce an executable.
71.5 KB
Loading
46.7 KB
Loading

0 commit comments

Comments
 (0)