Skip to content

Commit

Permalink
Add demo for pde.bnd integration with classic Eclipse product build
Browse files Browse the repository at this point in the history
  • Loading branch information
fipro78 authored and laeubi committed May 17, 2024
1 parent f53ebeb commit f983ce6
Show file tree
Hide file tree
Showing 38 changed files with 617 additions and 0 deletions.
1 change: 1 addition & 0 deletions demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Sample projects demonstrating how to use Tycho.
* `itp02/`: Simple application that demonstrates [use of pom-first dependencies](https://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts)
* `itp04-rcp/`: [Trivial cross-platform RCP product application with root files which can be updated by means of p2](https://wiki.eclipse.org/Tycho/Demo_Projects/RCP_Application)
* `testing`: Demonstrate different ways to test Bundles/Plugins with Tycho see https://tycho.eclipseprojects.io/doc/master/TestingBundles.html for more details.
* `pde-automatic-manifest`: Demonstrate the combination of classical PDE project layouts with project layouts that use automatic MANIFEST generation to build an Eclipse based product.

Each demo project (except itp02) can be built by executing:

Expand Down
1 change: 1 addition & 0 deletions demo/pde-automatic-manifest/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.metadata/
8 changes: 8 additions & 0 deletions demo/pde-automatic-manifest/.mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<extensions>
<extension>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-build</artifactId>
<version>${tycho-version}</version>
</extension>
</extensions>
14 changes: 14 additions & 0 deletions demo/pde-automatic-manifest/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Build with automatic MANIFEST generation
========================================

This example shows how to combine projects that use the classical PDE project layout (MANIFEST first) with projects that use the automatic manifest generation, to build a feature based product using a pom-less setup.

It contains the following projects:

- tycho.demo.app - the application plugin project that contains the Application Model (classical PDE layout)
- tycho.demo.feature - the feature project that contains the custom plugins of this project to add to the product
- tycho.demo.inverter.ui - a plugin that contains some UI elements (classical PDE layout)
- tycho.demo.product - the product project to build the feature based product
- tycho.demo.service.api - a service API bundle (automatic manifest generation)
- tycho.demo.service.impl - a service implementation bundle (automatic manifest generation)
- tycho.demo.target - the target definition project that specifies the target platform to resolve the project dependencies
97 changes: 97 additions & 0 deletions demo/pde-automatic-manifest/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>tycho.demo</groupId>
<artifactId>parent</artifactId>
<version>1.0.0-SNAPSHOT</version>

<packaging>pom</packaging>

<name>Tycho Demo App</name>

<modules>
<!-- The Target Platform -->
<module>tycho.demo.target</module>

<!-- The Plug-in Projects -->
<module>tycho.demo.service.api</module>
<module>tycho.demo.service.impl</module>
<module>tycho.demo.inverter.ui</module>
<module>tycho.demo.app</module>

<!-- The Feature Projects -->
<module>tycho.demo.feature</module>

<!-- The Release Engineering Projects -->
<module>tycho.demo.product</module>
</modules>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<target>
<artifact>
<groupId>tycho.demo</groupId>
<artifactId>tycho.demo.target</artifactId>
<version>${project.version}</version>
</artifact>
</target>
<targetDefinitionIncludeSource>honor</targetDefinitionIncludeSource>
<executionEnvironment>JavaSE-17</executionEnvironment>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>

<!--
Add this to avoid the warning:
'build.plugins.plugin.version' for org.eclipse.tycho:tycho-p2-director-plugin is missing.
-->
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-director-plugin</artifactId>
<version>${tycho-version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
7 changes: 7 additions & 0 deletions demo/pde-automatic-manifest/tycho.demo.app/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
28 changes: 28 additions & 0 deletions demo/pde-automatic-manifest/tycho.demo.app/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tycho.demo.app</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
17 changes: 17 additions & 0 deletions demo/pde-automatic-manifest/tycho.demo.app/Application.e4xmi
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<application:Application xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:application="http://www.eclipse.org/ui/2010/UIModel/application" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" xmi:id="_c3AF0MjYEeSyMNYR5xypkQ" elementId="org.eclipse.e4.application" bindingContexts="_c3AF2cjYEeSyMNYR5xypkQ">
<children xsi:type="basic:TrimmedWindow" xmi:id="_c3AF0cjYEeSyMNYR5xypkQ" elementId="org.eclipse.e4.window.main" label="Empty E4 Application" width="500" height="400">
<children xsi:type="basic:PartSashContainer" xmi:id="_qHdNgBKWEe-5DOhW2n7UgQ" elementId="tycho.demo.app.main"/>
</children>
<rootContext xmi:id="_c3AF2cjYEeSyMNYR5xypkQ" elementId="org.eclipse.ui.contexts.dialogAndWindow" name="In Dialog and Windows">
<children xmi:id="_c3AF2sjYEeSyMNYR5xypkQ" elementId="org.eclipse.ui.contexts.window" name="In Windows"/>
<children xmi:id="_c3AF28jYEeSyMNYR5xypkQ" elementId="org.eclipse.ui.contexts.dialog" name="In Dialogs"/>
</rootContext>
<addons xmi:id="_c3AF0sjYEeSyMNYR5xypkQ" elementId="org.eclipse.e4.core.commands.service" contributionURI="bundleclass://org.eclipse.e4.core.commands/org.eclipse.e4.core.commands.CommandServiceAddon"/>
<addons xmi:id="_c3AF08jYEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.contexts.service" contributionURI="bundleclass://org.eclipse.e4.ui.services/org.eclipse.e4.ui.services.ContextServiceAddon"/>
<addons xmi:id="_c3AF1MjYEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.bindings.service" contributionURI="bundleclass://org.eclipse.e4.ui.bindings/org.eclipse.e4.ui.bindings.BindingServiceAddon"/>
<addons xmi:id="_c3AF1cjYEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.workbench.commands.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.CommandProcessingAddon"/>
<addons xmi:id="_c3AF1sjYEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.workbench.handler.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.HandlerProcessingAddon"/>
<addons xmi:id="_c3AF18jYEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.workbench.contexts.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.ContextProcessingAddon"/>
<addons xmi:id="_c3AF2MjYEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.workbench.bindings.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench.swt/org.eclipse.e4.ui.workbench.swt.util.BindingProcessingAddon"/>
</application:Application>
18 changes: 18 additions & 0 deletions demo/pde-automatic-manifest/tycho.demo.app/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: App
Bundle-SymbolicName: tycho.demo.app;singleton:=true
Bundle-Version: 1.0.0.qualifier
Require-Bundle: org.eclipse.swt,
org.eclipse.e4.ui.model.workbench,
org.eclipse.jface,
org.eclipse.e4.ui.services,
org.eclipse.e4.ui.workbench,
org.eclipse.e4.core.di,
org.eclipse.e4.ui.di,
org.eclipse.e4.core.contexts,
org.eclipse.core.runtime
Bundle-RequiredExecutionEnvironment: JavaSE-17
Import-Package: jakarta.annotation;version="[2.1.0,3.0.0)",
jakarta.inject;version="[2.0.0,3.0.0)"
Automatic-Module-Name: tycho.demo.app
7 changes: 7 additions & 0 deletions demo/pde-automatic-manifest/tycho.demo.app/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source.. = src/
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
.,\
css/default.css,\
Application.e4xmi
Empty file.
22 changes: 22 additions & 0 deletions demo/pde-automatic-manifest/tycho.demo.app/plugin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>

<extension
id="product"
point="org.eclipse.core.runtime.products">
<product
name="Tycho Demo App"
application="org.eclipse.e4.ui.workbench.swt.E4Application">
<property
name="applicationCSS"
value="platform:/plugin/tycho.demo.app/css/default.css">
</property>
<property
name="appName"
value="Tycho Demo App">
</property>
</product>
</extension>

</plugin>
17 changes: 17 additions & 0 deletions demo/pde-automatic-manifest/tycho.demo.feature/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tycho.demo.feature</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin.includes = feature.xml
35 changes: 35 additions & 0 deletions demo/pde-automatic-manifest/tycho.demo.feature/feature.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="tycho.demo.feature"
label="Feature"
version="1.0.0.qualifier">

<description url="http://www.example.com/description">
[Enter Feature Description here.]
</description>

<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>

<license url="http://www.example.com/license">
[Enter License Description here.]
</license>

<plugin
id="tycho.demo.app"
version="0.0.0"/>

<plugin
id="tycho.demo.inverter.ui"
version="0.0.0"/>

<plugin
id="tycho.demo.service.api"
version="0.0.0"/>

<plugin
id="tycho.demo.service.impl"
version="0.0.0"/>

</feature>
7 changes: 7 additions & 0 deletions demo/pde-automatic-manifest/tycho.demo.inverter.ui/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
28 changes: 28 additions & 0 deletions demo/pde-automatic-manifest/tycho.demo.inverter.ui/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tycho.demo.inverter.ui</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Ui
Bundle-SymbolicName: tycho.demo.inverter.ui
Bundle-Version: 1.0.0.qualifier
Require-Bundle: org.eclipse.swt,
org.eclipse.jface,
org.eclipse.e4.ui.model.workbench
Model-Fragment: fragment.e4xmi
Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: tycho.demo.inverter.ui
Import-Package: jakarta.annotation;version="[2.1.0,3.0.0)";resolution:=optional,
jakarta.inject;version="[2.0.0,3.0.0)",
org.eclipse.e4.core.di.extensions;version="[0.16.0,1.0.0)",
tycho.demo.service.api;version="[1.0.0,2.0.0)"
Bundle-ActivationPolicy: lazy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bin.includes = META-INF/,\
.,\
fragment.e4xmi
source.. = src/
output.. = bin/
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="ASCII"?>
<fragment:ModelFragments xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" xmi:id="_bwbLoBKYEe-5DOhW2n7UgQ">
<imports xsi:type="basic:PartSashContainer" xmi:id="_dqjWABKYEe-5DOhW2n7UgQ" elementId="tycho.demo.app.main"/>
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_iCm7YBKYEe-5DOhW2n7UgQ" featurename="children" parentElementId="tycho.demo.app.main">
<elements xsi:type="basic:Part" xmi:id="_j98msBKYEe-5DOhW2n7UgQ" elementId="tycho.demo.inverter.ui.part.0" contributionURI="bundleclass://tycho.demo.inverter.ui/tycho.demo.inverter.ui.part.InverterPart"/>
</fragments>
</fragment:ModelFragments>
Loading

0 comments on commit f983ce6

Please sign in to comment.