# Wiki source code of Build Management

Last modified by Richard Kreissig on 2023/09/14 08:50
Export
Office Formats
Export as PDF Export as ODT Export as RTF
Other Formats

Select the pages to export:

select all/ none

Legend:
  Created Page
  Modified Extension Page
  Clean Extension Page

Export as HTML

Show last authors

author | version | line-number | content
--- | --- | --- | ---
|  | 1 | = An Overview of KIELER Build Automation =
|  | 2 |
|  | 3 | In order to keep the KIELER code as stable as possible, we use automatic continuous integration builds. Once you push something into one of the KIELER repositories, you trigger the automatic build process. If the build fails for whatever reason – be it failed unit tests or simply compilation errors – you are notified of the problem.
|  | 4 |
|  | 5 | This page describes the software and setup we use to implement all of this.
|  | 6 |
|  | 7 | **Content**
|  | 8 |
|  | 9 |
|  | 10 |
|  | 11 | {{toc minLevel="2"/}}
|  | 12 |
|  | 13 | == Software We Use ==
|  | 14 |
|  | 15 | To implement our automatic builds, we use the popular [[Maven>>url:http://maven.apache.org/||shape="rect"]] tool in conjunction with [[Tycho>>url:http://eclipse.org/tycho/||shape="rect"]], a set of Maven plug-ins that allow Maven to build Eclipse projects. Our KLay layouters library is built using [[Apache Ant>>url:http://ant.apache.org/||shape="rect"]]. To implement our continuous integration builds, we use [[Atlassian Bamboo>>url:http://www.atlassian.com/software/bamboo/overview||shape="rect"]].
|  | 16 |
|  | 17 | === Maven / Tycho ===
|  | 18 |
|  | 19 | Maven is a build tool for Java projects. It takes care of dependency management, including in-build dependencies (the order in which packages are compiled) as well as dependencies to third-party libraries. The latter are automatically fetched from special Maven repositories. Without getting too technical, a Maven build consists of several phases, such as //compile// and //package//. Within each phase, several Maven plug-ins handle different //tasks// (or //goals//, as Maven calls them). The //maven-compile-plugin// for example compiles {{code language="none"}}.java{{/code}} files into {{code language="none"}}.class{{/code}} files.
|  | 20 |
|  | 21 | To correctly compile a project, Maven needs to be told about the project. While the popular Ant build tool uses {{code language="none"}}build.xml{{/code}} files to describe the steps to be executed for building a project, Maven uses {{code language="none"}}pom.xml{{/code}} files to describe the project and figures out the steps for itself. The POM files may inherit settings from a parent POM file.
|  | 22 |
|  | 23 | Tycho is a set of Maven plugins that handles compiling and dependency management as well as bundling of Eclipse plug-ins. Tycho understands Eclipse metadata files such as {{code language="none"}}plugin.xml{{/code}} or {{code language="none"}}feature.xml{{/code}}, provides dependency information extracted from those files, and provides an Eclipse instance for compiling and packaging Eclipse bundles.
|  | 24 |
|  | 25 | === Apache Ant ===
|  | 26 |
|  | 27 | Ant is a very popular Java build tool. While Maven wants to know metadata about a project and then knows what to do to build it, Ant works by specifying exactly what to do to build a project. These steps are configured in a {{code language="none"}}build.xml{{/code}} file. We try to avoid using Ant, but still have Ant build files around for jobs too specialized to be properly handled by Maven.
|  | 28 |
|  | 29 | === Bamboo ===
|  | 30 |
|  | 31 | While Maven and Tycho know how to compile KIELER, Bamboo knows when to compile KIELER and what to do with the compiled project. Bamboo has access to our source code repositories and triggers continuous integration builds every time someone pushes new code into a repository. It also does a full build every night and copies the results onto our nightly build update site to be accessed by people all around the world. And beyond. Tell your friends!
|  | 32 |
|  | 33 | == The Automatic Build Process ==
|  | 34 |
|  | 35 | This section describes how our POM files are distributed throughout the repository structure, and how you can trigger an automatic build of KIELER.
|  | 36 |
|  | 37 | === POM Files ===
|  | 38 |
|  | 39 | The basic structure of the POM files is the same for both, the pragmatics and semantics repository, and can be seen below:
|  | 40 |
|  | 41 | [[image:attach:pomfiles.png]]
|  | 42 |
|  | 43 | Each plug-in and feature has a corresponding (usually rather small) POM file. The POM files in the {{code language="none"}}features{{/code}} and {{code language="none"}}plugins{{/code}} directories know about the different features and plug-ins. The parent POM file, which all other POM files copy basic configuration from, knows about the feature and plug-in POM files, as well as about every kind of build configuration we have (for building the pragmatics repository, for building the KWebS product, etc.). In addition, the {{code language="none"}}build{{/code}} directory also contains a bunch of subdirectories housing POM files that produce our p2 repositories and our products.
|  | 44 |
|  | 45 | === Using the KIELER Maven Build ===
|  | 46 |
|  | 47 | Using the KIELER Maven build requires two things: a working Maven installation (d'oh...) and knowledge about how exactly to trigger a build. We leave the former to you, but the latter is what this section is about.
|  | 48 |
|  | 49 | To actually build KIELER, navigate to the {{code language="none"}}/build/{{/code}} directory and run the following command line:
|  | 50 |
|  | 51 | {{code language="none"}}
|  | 52 | . /home/java/java-env # Only necessary when working on our servers
|  | 53 | mvn clean package -P <profile>
|  | 54 | {{/code}}
|  | 55 |
|  | 56 | Once Maven has finished, the different build artifacts may be found in the {{code language="none"}}/build/de.cau.cs.kieler.<profile>.repository/target{{/code}} directories. The following build profiles are available in the KIELER Pragmatics repository:
|  | 57 |
|  | 58 | * klighdning – Builds a standalone version of the KLighDning server, based on the current nightly pragmatics update site.
|  | 59 | * kwebs – Builds a standalone version of the KWebS server, based on the current nightly pragmatics update site.
|  | 60 | * pragmatics – Builds a p2 repository that contains our pragmatics features. This is what would usually be pushed online for people to download as our nightly pragmatics build.
|  | 61 | * ptolemy-rcp – Produces a standalone version of our Ptolemy Model Viewer, based on the current nightly build pragmatics update site.
|  | 62 |
|  | 63 | The following build profiles are available in the KIELER Semantics repository:
|  | 64 |
|  | 65 | {{warning title="ToDo"}}
|  | 66 | Document the Semantics build profiles.
|  | 67 | {{/warning}}
|  | 68 |
|  | 69 | === What to Be Aware of ===
|  | 70 |
|  | 71 | There are some things that people need to be aware of to keep the build files in a valid state.
|  | 72 |
|  | 73 | 1. Eclipse metadata and POM files are not synchronized. Thus, if the version of an Eclipse plug-in changes, its {{code language="none"}}pom.xml{{/code}} needs to be updated accordingly.
|  | 74 | 1. The repository POM directories contain product files and product icons. These are copies of the files found in the corresponding branding plug-ing (such as {{code language="none"}}de.cau.cs.kieler.core.product{{/code}}) and have to be manually synchronized.
|  | 75 |
|  | 76 | == Continuous and Nightly Builds ==
|  | 77 |
|  | 78 | There are basically four different kinds of build plans for each of the KIELER projects:
|  | 79 |
|  | 80 | 1. **Continuous Plugins** – Compiles the plug-ins and runs the unit tests on them. None of the compiled artifacts are published anywhere (in fact, no update site or product is even produced). This plan is triggered by pushing stuff into the repositories, giving early feedback regarding whether committed changes break anything.
|  | 81 | 1. **Nightly <Product>** – Assembles distributable product files and/or update sites. Distributable files are published in the nightly build directory {{code language="none"}}/home/kieler/public_html/files/nightly{{/code}}. Update sites are published in {{code language="none"}}/home/kieler/public_html/updatesite/nightly{{/code}}. These plans are run once every night.
|  | 82 | 1. **Nightly Rating** – Compiles the plug-ins and runs our code quality rating doclet on them. The result is a website published at {{code language="none"}}/home/kieler/public_html/rating{{/code}}. This plan is run once every night.
|  | 83 | 1. **Release Builds** – Continuous builds of release branches once a release is imminent. These usually run whenever changes are pushed into the repository. All release builds are placed in a special Bamboo project calles //KIELER Releases//.
|  | 84 |
|  | 85 | The //Semantics// project has an additional build plan:
|  | 86 |
|  | 87 | 1. **Ptolemy Update Site** – Builds the Ptolemy library and produces an update site for it. The build is triggered whenever changes are pushed into the Ptolemy repository. This build plan is necessary since both, the //Pragmatics// and the //Semantics// projects use the Ptolemy libraries.
|  | 88 |
|  | 89 | == Update Sites and Redistributables ==
|  | 90 |
|  | 91 | Our automatic builds produce a bunch of so-called //artifacts//: redistributable applications as well as a number of update sites. This table lists all artifacts, the project or repository they belong to, the build file responsible for producing them, the Bamboo build plan that builds them, and the directory they are finally placed in.
|  | 92 |
|  | 93 | {{info title="Timestamps"}}
|  | 94 | Don't be alarmed if the timestamps of the plugin and feature jar files on the updatesite don't match the current time. The time is probably UTC. Which is nice.
|  | 95 | {{/info}}
|  | 96 |
|  | 97 | (% class="wrapped" %)
|  | 98 | |=(((
|  | 99 | Artifact
|  | 100 | )))|=(((
|  | 101 | Repository
|  | 102 | )))|=(((
|  | 103 | Build File
|  | 104 | )))|=(((
|  | 105 | Bamboo Build Plan
|  | 106 | )))|=(% colspan="1" %)(% colspan="1" %)
|  | 107 | (((
|  | 108 | Final Directory
|  | 109 | )))
|  | 110 | |(((
|  | 111 | KWebS RCA
|  | 112 | )))|(((
|  | 113 | Pragmatics
|  | 114 | )))|(((
|  | 115 | {{code language="none"}}
|  | 116 | ...kwebs.repository/pom.xml
|  | 117 | {{/code}}
|  | 118 | )))|(((
|  | 119 | KIELER Pragmatics -> Nightly KWebS
|  | 120 | )))|(% colspan="1" %)(% colspan="1" %)
|  | 121 | (((
|  | 122 | {{code language="none"}}
|  | 123 | /home/kieler/public_html/files/nightly/kwebs
|  | 124 | {{/code}}
|  | 125 | )))
|  | 126 | |(((
|  | 127 | KIELER Pragmatics Updatesite
|  | 128 | )))|(((
|  | 129 | Pragmatics
|  | 130 | )))|(((
|  | 131 | {{code language="none"}}
|  | 132 | ...pragmatics.repository/pom.xml
|  | 133 | {{/code}}
|  | 134 | )))|(((
|  | 135 | KIELER Pragmatics -> Nightly Pragmatics Updatesite
|  | 136 | )))|(% colspan="1" %)(% colspan="1" %)
|  | 137 | (((
|  | 138 | {{code language="none"}}
|  | 139 | /home/kieler/public_html/updatesite/nightly/pragmatics/
|  | 140 | {{/code}}
|  | 141 | )))
|  | 142 | |(((
|  | 143 | Papyrus Layout Updatesite
|  | 144 | )))|(((
|  | 145 | Pragmatics
|  | 146 | )))|(((
|  | 147 | {{code language="none"}}
|  | 148 | ...papyrus.repository/pom.xml
|  | 149 | {{/code}}
|  | 150 | )))|(((
|  | 151 | KIELER Pragmatics -> Nightly Papyrus Updatesite
|  | 152 | )))|(% colspan="1" %)(% colspan="1" %)
|  | 153 | (((
|  | 154 | {{code language="none"}}
|  | 155 | /home/kieler/public_html/updatesite/nightly-papyrus/
|  | 156 | {{/code}}
|  | 157 | )))
|  | 158 | |(((
|  | 159 | KIELER RCA
|  | 160 | )))|(((
|  | 161 | Semantics
|  | 162 | )))|(((
|  | 163 | {{code language="none"}}
|  | 164 | ...semantics.repository/pom.xml
|  | 165 | {{/code}}
|  | 166 | )))|(((
|  | 167 | KIELER Semantics -> Nightly Semantics Product
|  | 168 | )))|(% colspan="1" %)(% colspan="1" %)
|  | 169 | (((
|  | 170 | {{code language="none"}}
|  | 171 | /home/kieler/public_html/files/nightly/
|  | 172 | {{/code}}
|  | 173 | )))
|  | 174 | |(((
|  | 175 | KIELER Semantics Updatesite
|  | 176 | )))|(((
|  | 177 | Semantics
|  | 178 | )))|(((
|  | 179 | {{code language="none"}}
|  | 180 | ...semantics.repository/pom.xml
|  | 181 | {{/code}}
|  | 182 | )))|(((
|  | 183 | KIELER Semantics -> Nightly Semantics Updatesite
|  | 184 | )))|(% colspan="1" %)(% colspan="1" %)
|  | 185 | (((
|  | 186 | {{code language="none"}}
|  | 187 | /home/kieler/public_html/updatesite/nightly/semantics/
|  | 188 | {{/code}}
|  | 189 | )))
|  | 190 | |(((
|  | 191 | Ptolemy Libraries Updatesite
|  | 192 | )))|(((
|  | 193 | Ptolemy
|  | 194 | )))|(((
|  | 195 | {{code language="none"}}
|  | 196 | ...ptolemy.repository/pom.xml
|  | 197 | {{/code}}
|  | 198 | )))|(((
|  | 199 | KIELER Semantics -> Ptolemy Updatesite
|  | 200 | )))|(% colspan="1" %)(% colspan="1" %)
|  | 201 | (((
|  | 202 | {{code language="none"}}
|  | 203 | /home/kieler/public_html/updatesite/ptolemy/
|  | 204 | {{/code}}
|  | 205 | )))

# Quick Links

KIELER on GitHub
RTSYS Homepage

XWiki 14.4.7