0. Ready to run RCP application with a bundle based product
(pre-requisite for Tycho training)
- PDE build exports as functional RCP application
0. Ready to run RCP application with a bundle based product
(pre-requisite for Tycho training)
- PDE build exports as functional RCP application
1a. Pom-ify com.example.e4.rcp.todo.model bundle by adding a pom.xml
- Bare minimum of <groupId>:<artifactId>:<version>
- "mvn clean install" succeeds without effect though
1b. Activate/enable Tycho to use "eclipse-plugin" packaging type
- mvn install complains about non-resolvable project dependencies
1c. Define (p2) repository where to find third party dependencies
- mvn install resolves dependencies correctly
-- We are lucky that Kepler simrel repository contains all required
dependencies in matching versions
- mvn install eventually fails due to <version> number inconsistencies
with OSGi MANIFEST metadata
1d. Fix version inconsistencies between OSGi MANIFEST metadata and
Maven/Tycho metadata by removing ".qualifier" suffix
1e. Use "-SNAPSHOT" instead of removing ".qualifier" to indicate this
software component (aka bundle) is under active development. Causes
Maven/Tycho to always grab the latest version during _every_ build
(without "-SNAPSHOT" version suffix Maven does not
re-resolve/re-download) a component again.
2a. Build multiple bundles with Tycho
- Copied .model pom.xml to .service bundle and adapted <artifactId>
accordingly
- mvn install fails even though it can resolve (one of the) project
dependency .model from (local) .m2/ repository
2b. Build .events bundles with Tycho
- Copied .model pom.xml to .events bundle and adapted <artifactId>
accordingly
- mvn install succeeds for .events and .service afterwards
-- Lot of redundancy
-- Need to know bundle dependency chain to kick off build in correct
order
2c. Extract common parts of all three bundle poms into a (master/parent)
pom.xml in separate project
- All three bundle poms refer to parent pom relatively
- Packaging type of parent pom is basic "pom" type
2d. Add list of (nested) modules to .aggregator pom.xml
- .aggregator module serves as composition
- pom.xml in root folder acts as main entry point to project and all-in-one build
- Order of list does not matter. Tycho determines order from OSGi
metadata
2e. Configure Tycho compiler
- Add debug symbols to .class files
- Treat input as being UTF-8 encoded
2f. Fight duplication by using properties
- Properties are a commonly used concept even in Maven itself
2g. Set Tycho compiler to build each bundle with a JDK that matches the
bundle's Bundle-RequiredExecutionEnvironment (BREE) defined in its OSGi
MANIFEST.MF
- Create a $user.home/.m2/toolchains.xml file that maps BREEs to (local)
JDKs
2h. Fix Maven warning about platform dependent build due to implicit
resource filter usage
- Explicitly set resource filter to be "UTF-8"
3a. Create a feature (project) named c.e.e4.rcp.todo.model.feature that
groups the functionality provided by the three bundles .model, .events
and .service
3b. Create pom.xml for feature with packaging type "eclipse-feature" and
add the feature to the aggregator pom in the root folder
- Again order in module list does not matter
- mvn install builds feature successfully
3c. Show what build.properties in features (as well as bundles) is used
for by including an (extra) README.txt file in the final feature
(build.properties is a (ancient) PDE build concept which is re-used by
Maven Tycho).
3d. Create second feature to group the UI parts of the RCP app
- Add poms to both bundles that make up the UI parts
- Add all three Maven modules to aggregator
3e. Declare feature inclusions and feature dependencies for
.todo.feature towards
- org.eclipse.* as dependencies
- com.example.e4.* as inclusion