Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Merks2020-08-10 05:20:59 +0000
committerEd Merks2020-08-10 05:20:59 +0000
commit0a1c083f6816983eaa127aa5096804d50df1b441 (patch)
treef9a6156133a8d0c4529f9ecbc8a12728bc3caaf5
parentd566d887726204fd47732f3ac108cdaa5bd3e4a2 (diff)
downloadjustj.tools-0a1c083f6816983eaa127aa5096804d50df1b441.tar.gz
justj.tools-0a1c083f6816983eaa127aa5096804d50df1b441.tar.xz
justj.tools-0a1c083f6816983eaa127aa5096804d50df1b441.zip
Bug 562908 - Populate the JustJ Git clones with initial content
Generate an additional a.jre.* installable unit for use in a Tycho build as an execution environment. Signed-off-by: Ed Merks <ed.merks@gmail.com>
-rw-r--r--plugins/org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/model/util/Generator.java10
-rw-r--r--plugins/org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/templates/plugin/P2Inf.java236
-rw-r--r--plugins/org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/templates/releng/site/POMXML.java118
-rw-r--r--plugins/org.eclipse.justj.codegen/templates/plugin/p2.inf.jet42
-rw-r--r--plugins/org.eclipse.justj.codegen/templates/releng/site/pom.xml.jet27
5 files changed, 301 insertions, 132 deletions
diff --git a/plugins/org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/model/util/Generator.java b/plugins/org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/model/util/Generator.java
index dfb4da1..9cb9547 100644
--- a/plugins/org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/model/util/Generator.java
+++ b/plugins/org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/model/util/Generator.java
@@ -610,6 +610,16 @@ public class Generator
return result;
}
+ public static Set<String> getSystemPackages(JVM jvm)
+ {
+ Set<String> result = new TreeSet<>();
+ for (Variant variant : jvm.getVariants())
+ {
+ result.addAll(getSystemPackages(variant));
+ }
+ return result;
+ }
+
public static Set<String> getSystemPackages(Variant variant)
{
String systemPackages = ModelUtil.getAnnotation(variant, ModelUtil.MODEL_PROPERTIES_ANNOTATION_URI, Constants.FRAMEWORK_SYSTEMPACKAGES);
diff --git a/plugins/org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/templates/plugin/P2Inf.java b/plugins/org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/templates/plugin/P2Inf.java
index 933f46b..dd5e5ee 100644
--- a/plugins/org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/templates/plugin/P2Inf.java
+++ b/plugins/org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/templates/plugin/P2Inf.java
@@ -10,6 +10,7 @@
*/
package org.eclipse.justj.codegen.templates.plugin;
+import java.util.*;
import org.eclipse.justj.codegen.model.*;
import org.eclipse.justj.codegen.model.util.Generator;
@@ -27,47 +28,79 @@ public class P2Inf
public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
protected static final String _1 = "#";
protected static final String _2 = "# Declare a capability that can be used to ensure mutually exclusive installation of IUs that set the -vm option.";
- protected static final String _3 = "# Ensure that the applicable implementation fragment gets installed automatically.";
- protected static final String _4 = "# Exclude all other providers of this capability; the site depends on all the features so exclude this requirement at build time.";
- protected static final String _5 = "# Exclude the synthetic a.jre IUs from the p2 repositories; Tycho gets confused by negative requirements so filter this to avoid it at build time.";
- protected static final String _6 = "# Exclude the synthetic a.jre.javase IUs from the p2 repositories; Tycho gets confused by negative requirements so filter this to avoid it at build time.";
- protected static final String _7 = "' && x.namespace == 'org.eclipse.equinox.p2.iu')";
- protected static final String _8 = ")(!(";
- protected static final String _9 = ")(osgi.arch=";
- protected static final String _10 = ".";
- protected static final String _11 = ".buildtime=true))";
- protected static final String _12 = ".buildtime=true)))";
- protected static final String _13 = ".filter = (!(";
- protected static final String _14 = ".filter = (&(osgi.os=";
- protected static final String _15 = ".matchExp = providedCapabilities.exists(x | x.name == 'jre' && x.namespace == 'org.eclipse.justj') && !providedCapabilities.exists(x | x.name == '";
- protected static final String _16 = ".max = 0";
- protected static final String _17 = ".min = 0";
- protected static final String _18 = ".name = ";
- protected static final String _19 = ".name = a.jre";
- protected static final String _20 = ".name = a.jre.javase";
- protected static final String _21 = ".namespace = org.eclipse.equinox.p2.iu";
- protected static final String _22 = ".range = [$version$,$version$]";
- protected static final String _23 = "properties.0.name = org.eclipse.justj.model";
- protected static final String _24 = "properties.0.value = ";
- protected static final String _25 = "provides.0.name = jre";
- protected static final String _26 = "provides.0.namespace = org.eclipse.justj";
- protected static final String _27 = "provides.0.version = $version$";
- protected static final String _28 = "requires.";
- protected final String _29 = "";
- protected final String _30 = NL + _1 + NL + NL + _3 + NL;
- protected final String _31 = NL + _28;
- protected final String _32 = _21 + NL + _28;
- protected final String _33 = _22 + NL + _28;
- protected final String _34 = _12 + NL;
- protected final String _35 = NL + _5;
- protected final String _36 = _19 + NL + _28;
- protected final String _37 = _17 + NL + _28;
- protected final String _38 = _16 + NL + _28;
- protected final String _39 = _11 + NL + NL + _6;
- protected final String _40 = _20 + NL + _28;
- protected final String _41 = _11 + NL + NL + _2 + NL + _26 + NL + _25 + NL + _27 + NL + NL + _4;
- protected final String _42 = _7 + NL + _28;
- protected final String _43 = _11 + NL + NL + _23 + NL + _24;
+ protected static final String _3 = "# Define an a.jre unit that can be used as a profile ID in a Tycho build.";
+ protected static final String _4 = "# Ensure that the a.jre IU is published to the update site.";
+ protected static final String _5 = "# Ensure that the applicable implementation fragment gets installed automatically.";
+ protected static final String _6 = "# Exclude all other providers of this capability; the site depends on all the features so exclude this requirement at build time.";
+ protected static final String _7 = "# Exclude the synthetic a.jre IUs from the p2 repositories; Tycho gets confused by negative requirements so filter this to avoid it at build time.";
+ protected static final String _8 = "# Exclude the synthetic a.jre.javase IUs from the p2 repositories; Tycho gets confused by negative requirements so filter this to avoid it at build time.";
+ protected static final String _9 = "' && x.namespace == 'org.eclipse.equinox.p2.iu')";
+ protected static final String _10 = ")(!(";
+ protected static final String _11 = ")(osgi.arch=";
+ protected static final String _12 = ",";
+ protected static final String _13 = ".";
+ protected static final String _14 = ".assembletime=true)";
+ protected static final String _15 = ".buildtime=true))";
+ protected static final String _16 = ".buildtime=true)))";
+ protected static final String _17 = ".filter = (!(";
+ protected static final String _18 = ".filter = (&(osgi.os=";
+ protected static final String _19 = ".matchExp = providedCapabilities.exists(x | x.name == 'jre' && x.namespace == 'org.eclipse.justj') && !providedCapabilities.exists(x | x.name == '";
+ protected static final String _20 = ".max = 0";
+ protected static final String _21 = ".min = 0";
+ protected static final String _22 = ".name = ";
+ protected static final String _23 = ".name = a.jre";
+ protected static final String _24 = ".name = a.jre.javase";
+ protected static final String _25 = ".namespace = java.package";
+ protected static final String _26 = ".namespace = org.eclipse.equinox.p2.iu";
+ protected static final String _27 = ".namespace = osgi.ee";
+ protected static final String _28 = ".range = [$version$,$version$]";
+ protected static final String _29 = ".version = ";
+ protected static final String _30 = ".version = 0.0.0";
+ protected static final String _31 = "]";
+ protected static final String _32 = "properties.0.name = org.eclipse.justj.model";
+ protected static final String _33 = "properties.0.value = ";
+ protected static final String _34 = "provides.0.name = jre";
+ protected static final String _35 = "provides.0.namespace = org.eclipse.justj";
+ protected static final String _36 = "provides.0.version = $version$";
+ protected static final String _37 = "requires.";
+ protected static final String _38 = "requires.0.filter = (";
+ protected static final String _39 = "requires.0.greedy = true";
+ protected static final String _40 = "requires.0.name = a.jre.";
+ protected static final String _41 = "requires.0.namespace = org.eclipse.equinox.p2.iu";
+ protected static final String _42 = "requires.0.optional = true";
+ protected static final String _43 = "requires.0.range = [";
+ protected static final String _44 = "units.0.id = a.jre.";
+ protected static final String _45 = "units.0.provides.";
+ protected static final String _46 = "units.0.provides.0.name = a.jre.";
+ protected static final String _47 = "units.0.provides.0.namespace = org.eclipse.equinox.p2.iu";
+ protected static final String _48 = "units.0.provides.0.version = ";
+ protected static final String _49 = "units.0.version = ";
+ protected final String _50 = "";
+ protected final String _51 = NL + _1 + NL + NL + _3 + NL + NL + _44;
+ protected final String _52 = NL + _49;
+ protected final String _53 = NL + NL + _47 + NL + _46;
+ protected final String _54 = NL + _48;
+ protected final String _55 = NL + _45;
+ protected final String _56 = _27 + NL + _45;
+ protected final String _57 = _25 + NL + _45;
+ protected final String _58 = _30 + NL;
+ protected final String _59 = NL + _4 + NL + NL + _41 + NL + _40;
+ protected final String _60 = NL + _43;
+ protected final String _61 = _31 + NL + _38;
+ protected final String _62 = _14 + NL + _39 + NL + _42 + NL + NL + _5 + NL;
+ protected final String _63 = NL + _37;
+ protected final String _64 = _26 + NL + _37;
+ protected final String _65 = _28 + NL + _37;
+ protected final String _66 = _16 + NL;
+ protected final String _67 = NL + _7;
+ protected final String _68 = _23 + NL + _37;
+ protected final String _69 = _21 + NL + _37;
+ protected final String _70 = _20 + NL + _37;
+ protected final String _71 = _15 + NL + NL + _8;
+ protected final String _72 = _24 + NL + _37;
+ protected final String _73 = _15 + NL + NL + _2 + NL + _35 + NL + _34 + NL + _36 + NL + NL + _6;
+ protected final String _74 = _9 + NL + _37;
+ protected final String _75 = _15 + NL + NL + _32 + NL + _33;
public String generate(Object argument)
{
@@ -76,80 +109,131 @@ public class P2Inf
String jvmName = jvm.getName();
Model model = jvm.getModel();
String modelName = model.getName();
+ String version = jvm.getVersion();
+ String minorlessVersion = version.replaceAll("\\.[0-9]$", ".0");
String fullName = modelName + '.' + jvmName;
- builder.append(_29);
+ builder.append(_50);
builder.append(org.eclipse.justj.codegen.model.util.Generator.getCopyright(argument, "# ", NL));
- builder.append(_30);
+ builder.append(_51);
+ builder.append(fullName);
+ builder.append(_52);
+ builder.append(minorlessVersion);
+ builder.append(_53);
+ builder.append(fullName);
+ builder.append(_54);
+ builder.append(minorlessVersion);
+ builder.append(NL);
+ int propertyCount = 1;
+ for (Map.Entry<String, Set<String>> entry : Generator.getEECapabilities(version).entrySet()) {
+ String eeName = entry.getKey();
+ Set<String> versions = entry.getValue();
+ for (String eeVersion : versions) {
+ int capabilityNumber = propertyCount++;
+ builder.append(_55);
+ builder.append(capabilityNumber);
+ builder.append(_56);
+ builder.append(capabilityNumber);
+ builder.append(_22);
+ builder.append(eeName);
+ builder.append(_55);
+ builder.append(capabilityNumber);
+ builder.append(_29);
+ builder.append(eeVersion);
+ builder.append(NL);
+ }
+ }
+ Set<String> systemPackages = Generator.getSystemPackages(jvm);
+ for (String systemPackage : systemPackages) {
+ int capabilityNumber = propertyCount++;
+ builder.append(_55);
+ builder.append(capabilityNumber);
+ builder.append(_57);
+ builder.append(capabilityNumber);
+ builder.append(_22);
+ builder.append(systemPackage);
+ builder.append(_55);
+ builder.append(capabilityNumber);
+ builder.append(_58);
+ }
+ builder.append(_59);
+ builder.append(fullName);
+ builder.append(_60);
+ builder.append(minorlessVersion);
+ builder.append(_12);
+ builder.append(minorlessVersion);
+ builder.append(_61);
+ builder.append(modelName);
+ builder.append(_62);
int count = 0;
for (Variant variant : jvm.getVariants()) {
++count;
String os = variant.getOs();
String arch = variant.getArch();
- builder.append(_31);
+ builder.append(_63);
builder.append(count);
- builder.append(_32);
+ builder.append(_64);
builder.append(count);
- builder.append(_18);
+ builder.append(_22);
builder.append(fullName);
- builder.append(_10);
+ builder.append(_13);
builder.append(os);
- builder.append(_10);
+ builder.append(_13);
builder.append(arch);
- builder.append(_31);
+ builder.append(_63);
builder.append(count);
- builder.append(_33);
+ builder.append(_65);
builder.append(count);
- builder.append(_14);
+ builder.append(_18);
builder.append(os);
- builder.append(_9);
+ builder.append(_11);
builder.append(arch);
- builder.append(_8);
+ builder.append(_10);
builder.append(modelName);
- builder.append(_34);
+ builder.append(_66);
}
- builder.append(_35);
+ builder.append(_67);
++count;
- builder.append(_31);
+ builder.append(_63);
builder.append(count);
- builder.append(_32);
+ builder.append(_64);
builder.append(count);
- builder.append(_36);
+ builder.append(_68);
builder.append(count);
- builder.append(_37);
+ builder.append(_69);
builder.append(count);
- builder.append(_38);
+ builder.append(_70);
builder.append(count);
- builder.append(_13);
+ builder.append(_17);
builder.append(modelName);
- builder.append(_39);
+ builder.append(_71);
++count;
- builder.append(_31);
+ builder.append(_63);
builder.append(count);
- builder.append(_32);
+ builder.append(_64);
builder.append(count);
- builder.append(_40);
+ builder.append(_72);
builder.append(count);
- builder.append(_37);
+ builder.append(_69);
builder.append(count);
- builder.append(_38);
+ builder.append(_70);
builder.append(count);
- builder.append(_13);
+ builder.append(_17);
builder.append(modelName);
- builder.append(_41);
+ builder.append(_73);
++count;
- builder.append(_31);
+ builder.append(_63);
builder.append(count);
- builder.append(_15);
+ builder.append(_19);
builder.append(fullName);
- builder.append(_42);
+ builder.append(_74);
builder.append(count);
- builder.append(_37);
+ builder.append(_69);
builder.append(count);
- builder.append(_38);
+ builder.append(_70);
builder.append(count);
- builder.append(_13);
+ builder.append(_17);
builder.append(modelName);
- builder.append(_43);
+ builder.append(_75);
builder.append(Generator.getModelXMLAsPropertyValue(jvm, NL));
builder.append(NL);
return builder.toString();
diff --git a/plugins/org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/templates/releng/site/POMXML.java b/plugins/org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/templates/releng/site/POMXML.java
index c8105d1..635a2f6 100644
--- a/plugins/org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/templates/releng/site/POMXML.java
+++ b/plugins/org.eclipse.justj.codegen/src/org/eclipse/justj/codegen/templates/releng/site/POMXML.java
@@ -26,49 +26,61 @@ public class POMXML
public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
protected static final String _1 = " Build ${build.id}</repositoryName>";
protected static final String _2 = "-->";
- protected static final String _3 = ".parent</artifactId>";
- protected static final String _4 = ".parent</relativePath>";
- protected static final String _5 = ".site</artifactId>";
- protected static final String _6 = "<!--";
- protected static final String _7 = "</build>";
- protected static final String _8 = "</configuration>";
- protected static final String _9 = "</groupId>";
- protected static final String _10 = "</parent>";
- protected static final String _11 = "</plugin>";
- protected static final String _12 = "</plugins>";
- protected static final String _13 = "</project>";
- protected static final String _14 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
- protected static final String _15 = "<artifactId>";
- protected static final String _16 = "<artifactId>tycho-p2-repository-plugin</artifactId>";
- protected static final String _17 = "<build>";
- protected static final String _18 = "<configuration>";
- protected static final String _19 = "<groupId>";
- protected static final String _20 = "<groupId>org.eclipse.tycho</groupId>";
- protected static final String _21 = "<modelVersion>4.0.0</modelVersion>";
- protected static final String _22 = "<packaging>eclipse-repository</packaging>";
- protected static final String _23 = "<parent>";
- protected static final String _24 = "<plugin>";
- protected static final String _25 = "<plugins>";
- protected static final String _26 = "<project";
- protected static final String _27 = "<relativePath>../";
- protected static final String _28 = "<repositoryName>";
- protected static final String _29 = "<version>${tycho-version}</version>";
- protected static final String _30 = "<version>1.0.0-SNAPSHOT</version>";
- protected static final String _31 = "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"";
- protected static final String _32 = "xmlns=\"http://maven.apache.org/POM/4.0.0\"";
- protected static final String _33 = "xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">";
+ protected static final String _3 = ".assembletime>";
+ protected static final String _4 = ".assembletime>true</";
+ protected static final String _5 = ".parent</artifactId>";
+ protected static final String _6 = ".parent</relativePath>";
+ protected static final String _7 = ".site</artifactId>";
+ protected static final String _8 = "<";
+ protected static final String _9 = "<!--";
+ protected static final String _10 = "</build>";
+ protected static final String _11 = "</configuration>";
+ protected static final String _12 = "</dependency-resolution>";
+ protected static final String _13 = "</groupId>";
+ protected static final String _14 = "</parent>";
+ protected static final String _15 = "</plugin>";
+ protected static final String _16 = "</plugins>";
+ protected static final String _17 = "</profileProperties>";
+ protected static final String _18 = "</project>";
+ protected static final String _19 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
+ protected static final String _20 = "<artifactId>";
+ protected static final String _21 = "<artifactId>target-platform-configuration</artifactId>";
+ protected static final String _22 = "<artifactId>tycho-p2-repository-plugin</artifactId>";
+ protected static final String _23 = "<build>";
+ protected static final String _24 = "<configuration>";
+ protected static final String _25 = "<dependency-resolution>";
+ protected static final String _26 = "<groupId>";
+ protected static final String _27 = "<groupId>org.eclipse.tycho</groupId>";
+ protected static final String _28 = "<modelVersion>4.0.0</modelVersion>";
+ protected static final String _29 = "<packaging>eclipse-repository</packaging>";
+ protected static final String _30 = "<parent>";
+ protected static final String _31 = "<plugin>";
+ protected static final String _32 = "<plugins>";
+ protected static final String _33 = "<profileProperties>";
+ protected static final String _34 = "<project";
+ protected static final String _35 = "<relativePath>../";
+ protected static final String _36 = "<repositoryName>";
+ protected static final String _37 = "<version>${tycho-version}</version>";
+ protected static final String _38 = "<version>1.0.0-SNAPSHOT</version>";
+ protected static final String _39 = "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"";
+ protected static final String _40 = "xmlns=\"http://maven.apache.org/POM/4.0.0\"";
+ protected static final String _41 = "xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">";
protected final String NL_1 = NL + " ";
protected final String NL_2 = NL + " ";
protected final String NL_3 = NL + " ";
- protected final String NL_4 = NL + " ";
- protected final String NL_5 = NL + " ";
- protected final String _34 = NL + _2 + NL + _26 + NL_2 + _32 + NL_2 + _31 + NL_2 + _33 + NL_1 + _21 + NL + NL_1 + _23 + NL_2 + _19;
- protected final String _35 = _9 + NL_2 + _15;
- protected final String _36 = _3 + NL_2 + _30 + NL_2 + _27;
- protected final String _37 = _4 + NL_1 + _10 + NL + NL_1 + _19;
- protected final String _38 = _9 + NL_1 + _15;
- protected final String _39 = _5 + NL_1 + _30 + NL_1 + _22 + NL + NL_1 + _17 + NL_2 + _25 + NL_3 + _24 + NL_4 + _20 + NL_4 + _16 + NL_4 + _29 + NL_4 + _18 + NL_5 + _28;
- protected final String _40 = _1 + NL_4 + _8 + NL_3 + _11 + NL_2 + _12 + NL_1 + _7 + NL + _13;
+ protected final String NL_4 = NL + " ";
+ protected final String NL_5 = NL + " ";
+ protected final String NL_6 = NL + " ";
+ protected final String NL_7 = NL + " ";
+ protected final String _42 = NL + _2 + NL + _34 + NL_2 + _40 + NL_2 + _39 + NL_2 + _41 + NL_1 + _28 + NL + NL_1 + _30 + NL_2 + _26;
+ protected final String _43 = _13 + NL_2 + _20;
+ protected final String _44 = _5 + NL_2 + _38 + NL_2 + _35;
+ protected final String _45 = _6 + NL_1 + _14 + NL + NL_1 + _26;
+ protected final String _46 = _13 + NL_1 + _20;
+ protected final String _47 = _7 + NL_1 + _38 + NL_1 + _29 + NL + NL_1 + _23 + NL_2 + _32 + NL_3 + _31 + NL_4 + _27 + NL_4 + _22 + NL_4 + _37 + NL_4 + _24 + NL_5 + _36;
+ protected final String _48 = _1 + NL_5 + _33 + NL_6 + _8;
+ protected final String _49 = _3 + NL_5 + _17 + NL_4 + _11 + NL_3 + _15 + NL_3 + _31 + NL_4 + _27 + NL_4 + _21 + NL_4 + _37 + NL_4 + _24 + NL_5 + _25 + NL_6 + _33 + NL_7 + _8;
+ protected final String _50 = _3 + NL_6 + _17 + NL_5 + _12 + NL_4 + _11 + NL_3 + _15 + NL_2 + _16 + NL_1 + _10 + NL + _18;
public String generate(Object argument)
{
@@ -76,24 +88,32 @@ public class POMXML
Model model = (Model)argument;
String name = model.getName();
String label = model.getLabel();
- builder.append(_14);
+ builder.append(_19);
builder.append(NL);
- builder.append(_6);
+ builder.append(_9);
builder.append(NL);
builder.append(org.eclipse.justj.codegen.model.util.Generator.getCopyright(argument, "", NL));
- builder.append(_34);
+ builder.append(_42);
builder.append(name);
- builder.append(_35);
+ builder.append(_43);
builder.append(name);
- builder.append(_36);
+ builder.append(_44);
builder.append(name);
- builder.append(_37);
+ builder.append(_45);
builder.append(name);
- builder.append(_38);
+ builder.append(_46);
builder.append(name);
- builder.append(_39);
+ builder.append(_47);
builder.append(label);
- builder.append(_40);
+ builder.append(_48);
+ builder.append(name);
+ builder.append(_4);
+ builder.append(name);
+ builder.append(_49);
+ builder.append(name);
+ builder.append(_4);
+ builder.append(name);
+ builder.append(_50);
builder.append(NL);
return builder.toString();
}
diff --git a/plugins/org.eclipse.justj.codegen/templates/plugin/p2.inf.jet b/plugins/org.eclipse.justj.codegen/templates/plugin/p2.inf.jet
index 503aa2c..05880b4 100644
--- a/plugins/org.eclipse.justj.codegen/templates/plugin/p2.inf.jet
+++ b/plugins/org.eclipse.justj.codegen/templates/plugin/p2.inf.jet
@@ -8,14 +8,54 @@ https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
--%>
-<%@jet package="org.eclipse.justj.codegen.templates.plugin" class="P2Inf" imports="org.eclipse.justj.codegen.model.* org.eclipse.justj.codegen.model.util.Generator" builder="StringBuilder builder = new StringBuilder()" minimize="true"%>
+<%@jet package="org.eclipse.justj.codegen.templates.plugin" class="P2Inf" imports="java.util.* org.eclipse.justj.codegen.model.* org.eclipse.justj.codegen.model.util.Generator" builder="StringBuilder builder = new StringBuilder()" minimize="true"%>
<%JVM jvm = (JVM)argument;
String jvmName = jvm.getName();
Model model = jvm.getModel();
String modelName = model.getName();
+ String version = jvm.getVersion();
+ String minorlessVersion = version.replaceAll("\\.[0-9]$", ".0");
String fullName = modelName + '.' + jvmName;%>
<%@include file="../copyright.properties.jetinc"%>
+# Define an a.jre unit that can be used as a profile ID in a Tycho build.
+
+units.0.id = a.jre.<%=fullName%>
+units.0.version = <%=minorlessVersion%>
+
+units.0.provides.0.namespace = org.eclipse.equinox.p2.iu
+units.0.provides.0.name = a.jre.<%=fullName%>
+units.0.provides.0.version = <%=minorlessVersion%>
+
+<%int propertyCount = 1;
+ for (Map.Entry<String, Set<String>> entry : Generator.getEECapabilities(version).entrySet()) {
+ String eeName = entry.getKey();
+ Set<String> versions = entry.getValue();
+ for (String eeVersion : versions) {
+ int capabilityNumber = propertyCount++;%>
+units.0.provides.<%=capabilityNumber%>.namespace = osgi.ee
+units.0.provides.<%=capabilityNumber%>.name = <%=eeName%>
+units.0.provides.<%=capabilityNumber%>.version = <%=eeVersion%>
+
+ <%}%>
+<%}%>
+<%Set<String> systemPackages = Generator.getSystemPackages(jvm);
+ for (String systemPackage : systemPackages) {
+ int capabilityNumber = propertyCount++;%>
+units.0.provides.<%=capabilityNumber%>.namespace = java.package
+units.0.provides.<%=capabilityNumber%>.name = <%=systemPackage%>
+units.0.provides.<%=capabilityNumber%>.version = 0.0.0
+
+<%}%>
+# Ensure that the a.jre IU is published to the update site.
+
+requires.0.namespace = org.eclipse.equinox.p2.iu
+requires.0.name = a.jre.<%=fullName%>
+requires.0.range = [<%=minorlessVersion%>,<%=minorlessVersion%>]
+requires.0.filter = (<%=modelName%>.assembletime=true)
+requires.0.greedy = true
+requires.0.optional = true
+
# Ensure that the applicable implementation fragment gets installed automatically.
<%int count = 0;
diff --git a/plugins/org.eclipse.justj.codegen/templates/releng/site/pom.xml.jet b/plugins/org.eclipse.justj.codegen/templates/releng/site/pom.xml.jet
index 60b6068..a48e761 100644
--- a/plugins/org.eclipse.justj.codegen/templates/releng/site/pom.xml.jet
+++ b/plugins/org.eclipse.justj.codegen/templates/releng/site/pom.xml.jet
@@ -35,12 +35,27 @@ SPDX-License-Identifier: EPL-2.0
<build>
<plugins>
<plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-p2-repository-plugin</artifactId>
- <version>${tycho-version}</version>
- <configuration>
- <repositoryName><%=label%> Build ${build.id}</repositoryName>
- </configuration>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-repository-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <repositoryName><%=label%> Build ${build.id}</repositoryName>
+ <profileProperties>
+ <<%=name%>.assembletime>true</<%=name%>.assembletime>
+ </profileProperties>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <dependency-resolution>
+ <profileProperties>
+ <<%=name%>.assembletime>true</<%=name%>.assembletime>
+ </profileProperties>
+ </dependency-resolution>
+ </configuration>
</plugin>
</plugins>
</build>

Back to the top