AF3_Build_Management, version 20 authored by Tiziano Munaro's avatar Tiziano Munaro
AF3 Build Management
====================
This page contains information about the build system that is used to
build AF3.
It is based on maven/tycho and uses Jenkins for regular builds.
Nevertheless, it
is easily possible to generate an equivalent build locally, or to create
derivate
products.
Legal Advice
------------
\*Note that you are not allowed to publish your version of the AF3
product without
explicit permission of the AF3 development team. You are furthermore
disallowed
to use or to change or to extend or to overwrite the AutoFOCUS 3 logo
and/or the
product branding. You may propose your own branding as part of the
permission process.\*
Release engineering repository
------------------------------
The complete configuration to build an AF3 product is contained in the
[maven-releng repository](https://git.fortiss.org/af3/maven-releng).
This repository follows the standard structure of release engineering
repositories that use maven/tycho (see
https://github.com/vogellacompany/tycho-example), except that the
product is located in the top level and not within the releng folder.
Furthermore, this repository contains only the build recipe. Any actual
content required for the build is acquired using git submodules such
that we can use identical repositories in an eclipse-based environment
and maven.
The build itself is controlled by environment variables passed by
invoked maven commands. These variables activate build profiles in the
maven configuration.
The following build flags are configured:
```text">
build.emf --- activates the emf code generation. required when setting "build.af3" or "build.kernel".
build.af3 --- activates the compilation of af3 plugins.
build.tooling --- activates the compilation of tooling kernel plugins.
build.tests --- runs the junit integration tests on the resulting product.
```
the build flags are used for a modular build configuration. for
instance, another project could only depend on the tooling and implement
a product that is totally different from af3.
the flag “build.tooling” just produces a p2 update site that can be
reused by subsequent builds. this update site is ignored if the flag is
specified. thus, the combination of “build.af3” and “build.tooling” will
not use the tooling update site.
an equivalent mechanism is implemented for “build.tests” that
additionally uses an af3 p2 update site.
**notes**
- we use the maven phase “verify” for building, not “package”, which
is the default. we are forced to use this phase, since we must
perform post-package product patching (no other phase qualifies).
this is also the reason to introduce the “build.tests” flag to skip
the testing phases that are located between the “packaging” and
“verify” phases.
- the flag “build.emf” is required to avoid triggering the code
generation multiple times.
### repository structure
the repository is structured as follows:
<code class="text">
bundles --- contains any standard eclipse plugin and the emf code generator.
features --- contains any tooling kernel or af3 feature definition (set of plugins).
products --- contains product descriptions (set of features): produces the resulting zips.
releng --- common build configuration and p2 update sites.
tests --- junit integration or module tests of the application, or single fragments respectively.
```
### bundles
the bundle folder is composed of the following repositories:
<code class="text">
af3 --- git submodule of the af3 plugins.
af3-rcp --- git submodule containing the org.fortiss.af3.rcapplication plugin.
emf-generator --- contains the emf code generator and its launch configuration.
kernel --- git submodule of the tooling kernel plugins.
```
two maven pom files are found in this folder:
<code class="text">
pom.xml --- specifies the to-be-compiled eclipse plugins activated by the given build flags.
pom-bundle-parent.xml --- compilation-specific configuration: currently, it only adds the required openjfx libraries to the tycho classpath.
```
the pom.xml file is the entry point for the compilation, whereas the
pom-bundle-parent.xml is included from bundle repos (such as af3).
note that all plugins are build pom-less: this means that no pom.xml
config file is needed within standard eclipse plugins. it is only
required at the level above. therefore, a maven extension is specified
within the “.mvn” folder within the root of the maven-releng repository.
### features
contains the tooling kernel and af3 feature as git submodules. each of
these features contains the full set of plugins as of now. however they
might be regrouped acc. to functionality groups in future.
### products
contains the af3 phoenix product as git submodule.
### releng
contains the following modules:
<code class="text
org.fortiss.af3.configuration --- Common configuration of all maven modules such as maven plugin versions and configuration. Moreover, commonly used variables are specified here.
org.fortiss.af3.target --- Target definition file that specifies all available plugins of the compilation and runtime platform. The definition of p2 sites is only allowed here. (There is only one exception in the product)
org.fortiss.af3.update --- Contains the configuration to produce the AF3 p2 update site.
org.fortiss.tooling.update --- Contains the configuration to produce the Tooling kernel update site.
```
### Tests
Contains a git submodule containing the AF3 JUnit tests.
Local Build
-----------
### Install an AF3 developer installation for local building
Use the oomph script at
https://git.fortiss.org/af3/fortiss-std-env/-/raw/master/oomph/af3-releng.setup
when following the instructions at [AF3 Developer installation](AF3_Developer_installation).
This will install a developer installation ready to build the RCP with
maven.
### Update to the latest version of the af3 plugins
1. Open the view “Git Repositories” from the “Quick access” box in the
top-right corner of eclipse.
2. Navigate to “maven-releng >Submodules”.
3. Select all submodules, open the context menu, and select “Switch
to >master”
### Triggering a maven build
- In the menu, go to “Run >Run configurations”.
- Select the m2e configuration “Build All” and click run. **NOTE:**
There are also preconfigured launches for cleaning and running the
tests.
- After 10-15 minutes the build should be done:
- The artifacts can be found in
`<root dir>\git\maven-releng\products\af3\org.fortiss.af3.phoenix.product\target\products`.
- To start the product, extract the ZIP file for your platform.
The extracted versions in the same directory currently do not
seem to work.
- You may have to add the following to `autofocus3-phoenix.ini` to
enable start the product in case JDK/JRE 11 is not in the system
path: `-vm <path to>/OpenJDK11/bin/javaw.exe`
Creating a derivate product
---------------------------
- First setup a local build as described above.
- All required configuration changes are done on the basis of the
maven-releng repository.
- Modifying the maven-releng repostory
- Create a separate branch of the repository.
- Perform the below modifications, depending on your task.
### Using different branches
- Edit the git submodule branch pointer of each repository for which
you need a different branch than master.
This can be done from eclipse (View: Git repositories) or by
modifying the .gitmodules file in the root of the maven-releng
clone.
- Update the submodule from the GUI, or manually by
`git submodule update --remote --recursive --checkout` from the
commandline at the root of the maven-releng clone. NOTE: Sometimes,
the latter requires the “—force” option. But beware: this resets any
change in submodules.
### Adding plugins / modifying the plugin list
- Add additional eclipse plugins as git submodules in the bundles
folder (either within eclipse, or by
`git submodule add -b <branch> --name "bundles/<repo-name>" https://git.fortiss.org/af3/<repo-name>.git bundles/<repo-name>`
from the command line).
- Create a branch of af3-features and update the git submodule of the
maven-releng repository to point to this branch.
- Add the plugins to the AF3 feature (new branch), or an additional
feature (for more than 1 or 2 plugins).
- Add new features to a separate update site in “releng/” if needed.