diff --git a/plugins/org.eclipse.oomph.base/META-INF/MANIFEST.MF b/plugins/org.eclipse.oomph.base/META-INF/MANIFEST.MF index 58b977637..37c3a3826 100644 --- a/plugins/org.eclipse.oomph.base/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.oomph.base/META-INF/MANIFEST.MF @@ -15,6 +15,6 @@ Export-Package: org.eclipse.oomph.base;version="1.15.0";x-internal:=true, Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)", org.eclipse.emf.ecore;bundle-version="[2.10.0,3.0.0)";visibility:=reexport, org.eclipse.emf.ecore.xmi;bundle-version="[2.10.0,3.0.0)";visibility:=reexport, - org.eclipse.oomph.util;bundle-version="[1.16.0,2.0.0)";visibility:=reexport + org.eclipse.oomph.util;bundle-version="[1.17.0,2.0.0)";visibility:=reexport Bundle-ActivationPolicy: lazy Automatic-Module-Name: org.eclipse.oomph.base diff --git a/plugins/org.eclipse.oomph.extractor.lib.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.oomph.extractor.lib.tests/META-INF/MANIFEST.MF index 55ebd2e45..404fb5d2d 100644 --- a/plugins/org.eclipse.oomph.extractor.lib.tests/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.oomph.extractor.lib.tests/META-INF/MANIFEST.MF @@ -1,13 +1,13 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.oomph.extractor.lib.tests -Bundle-Version: 1.6.0.qualifier +Bundle-Version: 1.7.0.qualifier Bundle-Localization: plugin Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-RequiredExecutionEnvironment: J2SE-1.5 Bundle-ClassPath: . -Export-Package: org.eclipse.oomph.extractor.lib.tests;version="1.6.0" -Require-Bundle: org.eclipse.oomph.extractor.lib;bundle-version="[1.5.0,2.0.0)", +Export-Package: org.eclipse.oomph.extractor.lib.tests;version="1.7.0" +Require-Bundle: org.eclipse.oomph.extractor.lib;bundle-version="[1.9.0,2.0.0)", org.junit;bundle-version="[4.0.0,5.0.0)" Automatic-Module-Name: org.eclipse.oomph.extractor.lib.tests diff --git a/plugins/org.eclipse.oomph.extractor.lib.tests/pom.xml b/plugins/org.eclipse.oomph.extractor.lib.tests/pom.xml index e2d1082bc..ed85694d5 100644 --- a/plugins/org.eclipse.oomph.extractor.lib.tests/pom.xml +++ b/plugins/org.eclipse.oomph.extractor.lib.tests/pom.xml @@ -20,7 +20,7 @@ org.eclipse.oomph org.eclipse.oomph.extractor.lib.tests - 1.6.0-SNAPSHOT + 1.7.0-SNAPSHOT eclipse-plugin diff --git a/plugins/org.eclipse.oomph.extractor.lib.tests/src/org/eclipse/oomph/extractor/lib/tests/JRETest.java b/plugins/org.eclipse.oomph.extractor.lib.tests/src/org/eclipse/oomph/extractor/lib/tests/JRETest.java index a54ab4304..24f513781 100644 --- a/plugins/org.eclipse.oomph.extractor.lib.tests/src/org/eclipse/oomph/extractor/lib/tests/JRETest.java +++ b/plugins/org.eclipse.oomph.extractor.lib.tests/src/org/eclipse/oomph/extractor/lib/tests/JRETest.java @@ -24,6 +24,11 @@ public static void main(String[] args) throws Exception System.out.println("minor: " + jre.getMinor()); System.out.println("micro: " + jre.getMicro()); System.out.println("bitness: " + jre.getBitness()); + System.out.println("home: " + jre.getJavaHome()); + System.out.println("arch: " + jre.getArch()); + + System.out.println(); + System.out.println("jre: " + jre); System.out.println(); System.out.println(new JREData().satisfies(new JREData(1, 6, 0, 32))); diff --git a/plugins/org.eclipse.oomph.extractor.lib/META-INF/MANIFEST.MF b/plugins/org.eclipse.oomph.extractor.lib/META-INF/MANIFEST.MF index fd73f3634..ba454a0d4 100644 --- a/plugins/org.eclipse.oomph.extractor.lib/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.oomph.extractor.lib/META-INF/MANIFEST.MF @@ -1,11 +1,11 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.oomph.extractor.lib -Bundle-Version: 1.8.0.qualifier +Bundle-Version: 1.9.0.qualifier Bundle-Localization: plugin Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-RequiredExecutionEnvironment: JRE-1.1 Bundle-ClassPath: . -Export-Package: org.eclipse.oomph.extractor.lib;version="1.8.0" +Export-Package: org.eclipse.oomph.extractor.lib;version="1.9.0" Automatic-Module-Name: org.eclipse.oomph.extractor.lib diff --git a/plugins/org.eclipse.oomph.extractor.lib/pom.xml b/plugins/org.eclipse.oomph.extractor.lib/pom.xml index 650b8c66b..ebac444d4 100644 --- a/plugins/org.eclipse.oomph.extractor.lib/pom.xml +++ b/plugins/org.eclipse.oomph.extractor.lib/pom.xml @@ -20,7 +20,7 @@ org.eclipse.oomph org.eclipse.oomph.extractor.lib - 1.8.0-SNAPSHOT + 1.9.0-SNAPSHOT eclipse-plugin diff --git a/plugins/org.eclipse.oomph.extractor.lib/src/org/eclipse/oomph/extractor/lib/JREData.java b/plugins/org.eclipse.oomph.extractor.lib/src/org/eclipse/oomph/extractor/lib/JREData.java index d6c3dd178..1130d29dd 100644 --- a/plugins/org.eclipse.oomph.extractor.lib/src/org/eclipse/oomph/extractor/lib/JREData.java +++ b/plugins/org.eclipse.oomph.extractor.lib/src/org/eclipse/oomph/extractor/lib/JREData.java @@ -23,6 +23,8 @@ public final class JREData private final int bitness; + private final String arch; + private final String javaHome; public JREData(int major, int minor, int micro, int bitness) @@ -32,6 +34,7 @@ public JREData(int major, int minor, int micro, int bitness) this.micro = micro; this.bitness = bitness; javaHome = ""; //$NON-NLS-1$ + arch = ""; //$NON-NLS-1$ } public JREData(String args) @@ -45,6 +48,7 @@ public JREData(String[] args) minor = parseInt(args[1]); micro = parseInt(args[2]); bitness = parseInt(args[3]); + if (args.length > 4) { javaHome = args[4].replace("%25", "%").replace("%20", " "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ @@ -53,6 +57,15 @@ public JREData(String[] args) { javaHome = ""; //$NON-NLS-1$ } + + if (args.length > 5) + { + arch = args[5]; + } + else + { + arch = ""; //$NON-NLS-1$ + } } public JREData() @@ -92,6 +105,8 @@ public JREData() bitness = determineBitness(); javaHome = System.getProperty("java.home"); //$NON-NLS-1$ + String osArchProperty = System.getProperty("os.arch"); //$NON-NLS-1$ + arch = "amd64".equals(osArchProperty) ? "x86_64" : osArchProperty; //$NON-NLS-1$ //$NON-NLS-2$ } public int getMajor() @@ -119,6 +134,11 @@ public String getJavaHome() return javaHome; } + public String getArch() + { + return arch; + } + public boolean satisfies(JREData requirement) { if (bitness != requirement.bitness) @@ -151,6 +171,12 @@ public boolean satisfies(JREData requirement) return false; } + String requirementArch = requirement.getArch(); + if (!"".equals(requirementArch) && !requirementArch.equals(arch)) //$NON-NLS-1$ + { + return false; + } + return true; } @@ -191,6 +217,12 @@ public String toString() } } } + + if (!"".equals(arch)) //$NON-NLS-1$ + { + result.append(' '); + result.append(arch); + } } return result.toString(); diff --git a/plugins/org.eclipse.oomph.gitbash/META-INF/MANIFEST.MF b/plugins/org.eclipse.oomph.gitbash/META-INF/MANIFEST.MF index 666699069..f5f4cf374 100644 --- a/plugins/org.eclipse.oomph.gitbash/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.oomph.gitbash/META-INF/MANIFEST.MF @@ -17,7 +17,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)", org.eclipse.egit.ui;bundle-version="[2.0.0,10.0.0)", org.eclipse.mylyn.tasks.core;bundle-version="[3.3.0,4.0.0)";resolution:=optional, org.eclipse.mylyn.tasks.ui;bundle-version="[3.3.0,4.0.0)";resolution:=optional, - org.eclipse.oomph.util;bundle-version="[1.16.0,2.0.0)" + org.eclipse.oomph.util;bundle-version="[1.17.0,2.0.0)" Bundle-RequiredExecutionEnvironment: J2SE-1.5 Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.oomph.gitbash;version="1.16.0";x-internal:=true, diff --git a/plugins/org.eclipse.oomph.jreinfo.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.oomph.jreinfo.ui/META-INF/MANIFEST.MF index cd96c0ec5..9fc376623 100644 --- a/plugins/org.eclipse.oomph.jreinfo.ui/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.oomph.jreinfo.ui/META-INF/MANIFEST.MF @@ -10,6 +10,6 @@ Bundle-Activator: org.eclipse.oomph.jreinfo.ui.JREInfoUIPlugin$Implementation Bundle-ActivationPolicy: lazy Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)", org.eclipse.oomph.ui;bundle-version="[1.15.0,2.0.0)", - org.eclipse.oomph.jreinfo;bundle-version="[1.14.0,2.0.0)";visibility:=reexport + org.eclipse.oomph.jreinfo;bundle-version="[1.15.0,2.0.0)";visibility:=reexport Export-Package: org.eclipse.oomph.jreinfo.ui;version="1.13.0";x-internal:=true Automatic-Module-Name: org.eclipse.oomph.jreinfo.ui diff --git a/plugins/org.eclipse.oomph.jreinfo.ui/src/org/eclipse/oomph/jreinfo/ui/JREComposite.java b/plugins/org.eclipse.oomph.jreinfo.ui/src/org/eclipse/oomph/jreinfo/ui/JREComposite.java index c02f934b8..e0c247c97 100644 --- a/plugins/org.eclipse.oomph.jreinfo.ui/src/org/eclipse/oomph/jreinfo/ui/JREComposite.java +++ b/plugins/org.eclipse.oomph.jreinfo.ui/src/org/eclipse/oomph/jreinfo/ui/JREComposite.java @@ -20,6 +20,7 @@ import org.eclipse.oomph.util.OS; import org.eclipse.oomph.util.PropertiesUtil; import org.eclipse.oomph.util.Request; +import org.eclipse.oomph.util.StringUtil; import org.eclipse.emf.edit.provider.IItemFontProvider; import org.eclipse.emf.edit.ui.provider.ExtendedFontRegistry; @@ -198,7 +199,7 @@ public void keyPressed(KeyEvent e) TreeColumn bitnessColumn = new TreeColumn(tree, SWT.LEFT); bitnessColumn.setText(Messages.JREComposite_column_bitness); - treeLayout.setColumnData(bitnessColumn, new ColumnWeightData(1, 60 + EXTRA_WIDTH)); + treeLayout.setColumnData(bitnessColumn, new ColumnWeightData(1, 100 + EXTRA_WIDTH)); TreeColumn typeColumn = new TreeColumn(tree, SWT.LEFT); typeColumn.setText(Messages.JREComposite_column_type); @@ -578,7 +579,7 @@ public String getColumnText(Object element, int columnIndex) case 1: return jre.getMajor() + "." + jre.getMinor() + "." + jre.getMicro(); //$NON-NLS-1$ //$NON-NLS-2$ case 2: - return jre.getBitness() + " " + Messages.JREComposite_bit; //$NON-NLS-1$ + return jre.getBitness() + " " + Messages.JREComposite_bit + (StringUtil.isEmpty(jre.getArch()) ? "" : " (" + jre.getArch() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ case 3: return jre.isJDK() ? "JDK" : "JRE"; //$NON-NLS-1$ //$NON-NLS-2$ } diff --git a/plugins/org.eclipse.oomph.jreinfo/META-INF/MANIFEST.MF b/plugins/org.eclipse.oomph.jreinfo/META-INF/MANIFEST.MF index f2b09f1de..796011401 100644 --- a/plugins/org.eclipse.oomph.jreinfo/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.oomph.jreinfo/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.oomph.jreinfo -Bundle-Version: 1.14.0.qualifier +Bundle-Version: 1.15.0.qualifier Bundle-Localization: plugin Bundle-Name: %pluginName Bundle-Vendor: %providerName @@ -10,8 +10,8 @@ Bundle-ClassPath: . Bundle-Activator: org.eclipse.oomph.internal.jreinfo.JREInfoPlugin$Implementation Bundle-ActivationPolicy: lazy Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)", - org.eclipse.oomph.util;bundle-version="[1.15.0,2.0.0)";visibility:=reexport, - org.eclipse.oomph.extractor.lib;bundle-version="[1.8.0,2.0.0)" -Export-Package: org.eclipse.oomph.internal.jreinfo;version="1.14.0";x-internal:=true, - org.eclipse.oomph.jreinfo;version="1.14.0";x-internal:=true + org.eclipse.oomph.util;bundle-version="[1.17.0,2.0.0)";visibility:=reexport, + org.eclipse.oomph.extractor.lib;bundle-version="[1.9.0,2.0.0)" +Export-Package: org.eclipse.oomph.internal.jreinfo;version="1.15.0";x-internal:=true, + org.eclipse.oomph.jreinfo;version="1.15.0";x-internal:=true Automatic-Module-Name: org.eclipse.oomph.jreinfo diff --git a/plugins/org.eclipse.oomph.jreinfo/pom.xml b/plugins/org.eclipse.oomph.jreinfo/pom.xml index e289c44ce..cd081ccf9 100644 --- a/plugins/org.eclipse.oomph.jreinfo/pom.xml +++ b/plugins/org.eclipse.oomph.jreinfo/pom.xml @@ -20,7 +20,7 @@ org.eclipse.oomph org.eclipse.oomph.jreinfo - 1.14.0-SNAPSHOT + 1.15.0-SNAPSHOT eclipse-plugin diff --git a/plugins/org.eclipse.oomph.jreinfo/src/org/eclipse/oomph/jreinfo/InfoManager.java b/plugins/org.eclipse.oomph.jreinfo/src/org/eclipse/oomph/jreinfo/InfoManager.java index 411cad130..1791b5723 100644 --- a/plugins/org.eclipse.oomph.jreinfo/src/org/eclipse/oomph/jreinfo/InfoManager.java +++ b/plugins/org.eclipse.oomph.jreinfo/src/org/eclipse/oomph/jreinfo/InfoManager.java @@ -68,13 +68,14 @@ public synchronized JRE getInfo(File canonicalJavaHome) int minor = result.getMinor(); int micro = result.getMicro(); int bitness = result.getBitness(); + String arch = result.getArch(); boolean jdk = JREInfo.isJDK(canonicalJavaHome) == 1; File executable = JRE.getExecutable(canonicalJavaHome); long lastModified = executable.lastModified(); - jre = new JRE(canonicalJavaHome, major, minor, micro, bitness, jdk, lastModified); + jre = new JRE(canonicalJavaHome, major, minor, micro, bitness, arch, jdk, lastModified); infos.put(canonicalJavaHome, jre); try @@ -116,10 +117,15 @@ private void loadInfos() { try { - JRE jre = new JRE(line); - if (jre.isValid()) + // Ignore if the arch is missing. + String[] tokens = line.split(JRE.SEPARATOR); + if (tokens.length > 7) { - infos.put(jre.getJavaHome(), jre); + JRE jre = new JRE(line); + if (jre.isValid()) + { + infos.put(jre.getJavaHome(), jre); + } } } catch (RuntimeException ex) diff --git a/plugins/org.eclipse.oomph.jreinfo/src/org/eclipse/oomph/jreinfo/JRE.java b/plugins/org.eclipse.oomph.jreinfo/src/org/eclipse/oomph/jreinfo/JRE.java index 011c53619..75a7edbf4 100644 --- a/plugins/org.eclipse.oomph.jreinfo/src/org/eclipse/oomph/jreinfo/JRE.java +++ b/plugins/org.eclipse.oomph.jreinfo/src/org/eclipse/oomph/jreinfo/JRE.java @@ -10,6 +10,8 @@ */ package org.eclipse.oomph.jreinfo; +import org.eclipse.oomph.util.StringUtil; + import java.io.File; /** @@ -17,7 +19,7 @@ */ public final class JRE implements Comparable { - private static final String SEPARATOR = File.pathSeparator; + static final String SEPARATOR = File.pathSeparator; private final File javaHome; @@ -31,11 +33,18 @@ public final class JRE implements Comparable private final int bitness; + private final String arch; + private final boolean jdk; private final long lastModified; public JRE(File javaHome, int major, int minor, int micro, int bitness, boolean jdk, long lastModified) + { + this(javaHome, major, minor, micro, bitness, "", jdk, lastModified); //$NON-NLS-1$ + } + + public JRE(File javaHome, int major, int minor, int micro, int bitness, String arch, boolean jdk, long lastModified) { this.javaHome = javaHome; descriptor = null; @@ -43,6 +52,7 @@ public JRE(File javaHome, int major, int minor, int micro, int bitness, boolean this.minor = minor; this.micro = micro; this.bitness = bitness; + this.arch = arch; this.jdk = jdk; this.lastModified = lastModified; } @@ -55,6 +65,7 @@ public JRE(File javaHome, int major, int minor, int micro, int bitness, boolean minor = descriptor.getMinor(); micro = descriptor.getMicro(); bitness = descriptor.getBitness(); + arch = ""; //$NON-NLS-1$ jdk = descriptor.isJDK(); lastModified = -1; } @@ -67,6 +78,7 @@ public JRE(File javaHome, int major, int minor, int micro, int bitness, boolean minor = info.minor; micro = info.micro; bitness = info.bitness; + arch = info.arch; jdk = info.jdk; lastModified = info.lastModified; } @@ -82,6 +94,7 @@ public JRE(File javaHome, int major, int minor, int micro, int bitness, boolean bitness = Integer.parseInt(tokens[4]); jdk = Boolean.parseBoolean(tokens[5]); lastModified = Long.parseLong(tokens[6]); + arch = tokens.length > 7 ? tokens[7] : ""; //$NON-NLS-1$ } public File getJavaHome() @@ -119,6 +132,11 @@ public int getBitness() return bitness; } + public String getArch() + { + return arch; + } + public boolean isJDK() { return jdk; @@ -219,6 +237,12 @@ public boolean isMatch(JREFilter filter) return false; } + String filterArch = filter.getArch(); + if (!StringUtil.isEmpty(filterArch) && !StringUtil.isEmpty(arch) && !filterArch.equals(arch)) + { + return false; + } + return true; } @@ -315,7 +339,7 @@ public String toString() String toLine() { return javaHome.getAbsolutePath() + SEPARATOR + major + SEPARATOR + minor + SEPARATOR + micro + SEPARATOR + bitness + SEPARATOR + jdk + SEPARATOR - + lastModified; + + lastModified + SEPARATOR + arch; } static File getExecutable(File javaHome) diff --git a/plugins/org.eclipse.oomph.jreinfo/src/org/eclipse/oomph/jreinfo/JREFilter.java b/plugins/org.eclipse.oomph.jreinfo/src/org/eclipse/oomph/jreinfo/JREFilter.java index b95f51a2c..a5eb68173 100644 --- a/plugins/org.eclipse.oomph.jreinfo/src/org/eclipse/oomph/jreinfo/JREFilter.java +++ b/plugins/org.eclipse.oomph.jreinfo/src/org/eclipse/oomph/jreinfo/JREFilter.java @@ -25,6 +25,8 @@ public final class JREFilter private final Integer bitness; + private final String arch; + private final Boolean jdk; private final Boolean descriptor; @@ -62,6 +64,7 @@ public JREFilter(Integer major, Integer minor, Integer micro, Integer bitness, B this.bitness = bitness; this.jdk = jdk; descriptor = Boolean.FALSE; + arch = ""; //$NON-NLS-1$ } public JREFilter(int bitness) @@ -80,6 +83,11 @@ public JREFilter(String version, Integer bitness, Boolean jdk) } public JREFilter(String version, Integer bitness, Boolean jdk, Boolean descriptor) + { + this(version, bitness, jdk, descriptor, ""); //$NON-NLS-1$ + } + + public JREFilter(String version, Integer bitness, Boolean jdk, Boolean descriptor, String arch) { if (StringUtil.isEmpty(version)) { @@ -98,6 +106,7 @@ public JREFilter(String version, Integer bitness, Boolean jdk, Boolean descripto this.bitness = bitness; this.jdk = jdk; this.descriptor = descriptor; + this.arch = arch; } public Integer getMajor() @@ -120,6 +129,11 @@ public Integer getBitness() return bitness; } + public String getArch() + { + return arch; + } + public Boolean isJDK() { return jdk; @@ -171,6 +185,11 @@ public String toString() builder.append(" "); //$NON-NLS-1$ } + if (!StringUtil.isEmpty(arch)) + { + builder.append(arch); + } + if (jdk != null) { builder.append(jdk ? " JDK" : " JRE"); //$NON-NLS-1$ //$NON-NLS-2$ diff --git a/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/AugmentedJREController.java b/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/AugmentedJREController.java index 8ce944d2c..d37554296 100644 --- a/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/AugmentedJREController.java +++ b/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/AugmentedJREController.java @@ -54,7 +54,12 @@ public AugmentedJREController(Label label, StructuredViewer viewer, Handler down protected JREFilter createJREFilter() { // Creates a filter that permits descriptor-based JREs. - return new JREFilter(getJavaVersion(), getBitness(), null, null); + return new JREFilter(getJavaVersion(), getBitness(), null, null, getArch()); + } + + protected String getArch() + { + return ""; //$NON-NLS-1$ } /** diff --git a/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/ProductCatalogGenerator.java b/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/ProductCatalogGenerator.java index 1503c1d9b..63ee1c168 100644 --- a/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/ProductCatalogGenerator.java +++ b/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/ProductCatalogGenerator.java @@ -167,6 +167,8 @@ public class ProductCatalogGenerator implements IApplication private static final Pattern ARCH_OS_FILTER_PATTERN = Pattern.compile("\\(\\&\\(osgi\\.arch=([^)]+)\\)\\(osgi\\.os=([^)]+)\\)\\)"); + private static final Pattern ARCH_OS_WS_FILTER_PATTERN = Pattern.compile("\\(\\&\\(osgi\\.arch=([^)]+)\\)\\(osgi\\.os=([^)]+)\\)\\(osgi\\.ws=([^)]+)\\)\\)"); + private static final boolean IS_RANGE_NARROW = Boolean.FALSE; private static final String JUSTJ_JRES = "https://download.eclipse.org/justj/jres"; @@ -1331,11 +1333,13 @@ else if (train != getMostRecentTrain() && train != getMostRecentReleasedTrain() requirement.setVersionRange(versionRange); p2Task.getRequirements().add(requirement); addRootIURequirements(p2Task.getRequirements(), versionSegment, ius); - addAdditionalInstallRootIURequirements(p2Task.getRequirements(), productName, train, ius); + addAdditionalInstallRootIURequirements(p2Task.getRequirements(), productName, train); } else { - addAllRootIURequirements(p2Task.getRequirements(), versionSegment, ius); + EList requirements = p2Task.getRequirements(); + addAllRootIURequirements(requirements, versionSegment, ius); + requirements.move(0, requirements.size() - 1); } if (!SPECIAL_PRODUCT_IDS.contains(productName) && packageRepository != null) @@ -1416,6 +1420,48 @@ else if (train != getMostRecentTrain() && train != getMostRecentReleasedTrain() } } + String configurationID = "tooling" + (SPECIAL_PRODUCT_IDS.contains(productName) || ALL_PRODUCT_ID.equals(productName) ? "epp.package.java" + : ECLIPSE_PLATFORM_SDK_PRODUCT_ID.equals(productName) ? "org.eclipse.platform.sdk" : productName) + ".configuration"; + Iterator configurationIUs = P2Util.asIterable(metadDataRepository.query(QueryUtil.createIUQuery(configurationID), null)).iterator(); + if (configurationIUs.hasNext()) + { + IInstallableUnit configurationIU = configurationIUs.next(); + Set filterValues = new TreeSet(); + for (IRequirement requirement : configurationIU.getRequirements()) + { + IMatchExpression filter = requirement.getFilter(); + if (filter != null) + { + String value = RequirementImpl.formatMatchExpression(filter); + Matcher matcher = ARCH_OS_WS_FILTER_PATTERN.matcher(value); + if (matcher.matches()) + { + filterValues.add(value); + } + } + } + + if (!filterValues.isEmpty()) + { + StringBuilder compositeFilter = new StringBuilder("(|"); + for (String value : filterValues) + { + compositeFilter.append(value); + } + + String applicationFilter = compositeFilter.append(')').toString(); + p2Task.getRequirements().get(0).setFilter(applicationFilter); + } + else + { + System.err.println("###"); + } + } + else + { + System.err.println("###"); + } + if (siteURI != null) { BaseUtil.setAnnotation(productVersion, AnnotationConstants.ANNOTATION_BRANDING_INFO, AnnotationConstants.KEY_SITE_URI, siteURI.toString()); @@ -1666,7 +1712,7 @@ private void addRootIURequirements(EList requirements, VersionSegme } } - private void addAdditionalInstallRootIURequirements(EList requirements, String productName, String train, Map> ius) + private void addAdditionalInstallRootIURequirements(EList requirements, String productName, String train) { IMetadataRepository eppMetadataRepository = eppMetaDataRepositories.get(train); IInstallableUnit maxProductIU = null; @@ -1683,7 +1729,7 @@ private void addAdditionalInstallRootIURequirements(EList requireme if (maxProductIU != null) { - Set rootInstallIUs = getRootInstallIUs(train, maxProductIU); + Set rootInstallIUs = getRootInstallIUs(maxProductIU); if (rootInstallIUs != null) { for (String id : rootInstallIUs) @@ -2071,7 +2117,7 @@ private void getPlatformPackageBrandingSites(URI releasePackages) } } - private Set getRootInstallIUs(String release, IInstallableUnit productIU) + private Set getRootInstallIUs(IInstallableUnit productIU) { Set rootInstallIUs = new TreeSet(); for (IRequirement requirement : productIU.getRequirements()) diff --git a/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/ProductPage.java b/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/ProductPage.java index 8c2dfb216..7b8eba410 100644 --- a/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/ProductPage.java +++ b/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/ProductPage.java @@ -18,6 +18,7 @@ import org.eclipse.oomph.jreinfo.JREManager; import org.eclipse.oomph.jreinfo.ui.JREController; import org.eclipse.oomph.jreinfo.ui.JREInfoUIPlugin; +import org.eclipse.oomph.p2.Requirement; import org.eclipse.oomph.p2.core.AgentManager; import org.eclipse.oomph.p2.core.BundlePool; import org.eclipse.oomph.p2.core.P2Util; @@ -33,10 +34,12 @@ import org.eclipse.oomph.setup.Scope; import org.eclipse.oomph.setup.SetupFactory; import org.eclipse.oomph.setup.SetupPackage; +import org.eclipse.oomph.setup.SetupTask; import org.eclipse.oomph.setup.Workspace; import org.eclipse.oomph.setup.internal.core.SetupContext; import org.eclipse.oomph.setup.internal.core.util.CatalogManager; import org.eclipse.oomph.setup.internal.core.util.SetupCoreUtil; +import org.eclipse.oomph.setup.p2.P2Task; import org.eclipse.oomph.setup.provider.CatalogSelectionItemProvider; import org.eclipse.oomph.setup.provider.IndexItemProvider; import org.eclipse.oomph.setup.provider.InstallationItemProvider; @@ -275,7 +278,7 @@ public void run() @Override public Object[] getElements(Object object) { - return getValidProductVersions((Product)object, null).toArray(); + return getValidProductVersions((Product)object, null, getWizard().getOS()).toArray(); } }); @@ -406,6 +409,13 @@ protected void modelEmpty(boolean empty) setPageComplete(!empty); } + @Override + protected String getArch() + { + OS os = getWizard().getOS(); + return os.isMac() ? os.getOsgiArch() : super.getArch(); + } + @Override protected void jreChanged(JRE jre) { @@ -1001,7 +1011,7 @@ private void updateProductDetails(boolean initial) if (productSelected) { - ProductVersion version = getDefaultProductVersion(catalogSelector.getCatalogManager(), product); + ProductVersion version = getDefaultProductVersion(catalogSelector.getCatalogManager(), product, getWizard().getOS()); if (version != null) { versionComboViewer.setSelection(new StructuredSelection(version)); @@ -1300,9 +1310,14 @@ private ProductVersion getSelectedProductVersion() } public static ProductVersion getDefaultProductVersion(CatalogManager catalogManager, Product product) + { + return getDefaultProductVersion(catalogManager, product, OS.INSTANCE); + } + + public static ProductVersion getDefaultProductVersion(CatalogManager catalogManager, Product product, OS os) { ProductVersion version = catalogManager.getSelection().getDefaultProductVersions().get(product); - List validProductVersions = getValidProductVersions(product, null); + List validProductVersions = getValidProductVersions(product, null, os); if (!validProductVersions.contains(version)) { ProductVersion firstReleasedProductVersion = null; @@ -1447,6 +1462,11 @@ public static String getVMOption(JRE jre) } public static List getValidProductVersions(Product product, Pattern filter) + { + return getValidProductVersions(product, filter, OS.INSTANCE); + } + + public static List getValidProductVersions(Product product, Pattern filter, OS os) { List versions = new ArrayList(product.getVersions()); if (OS.INSTANCE.isMac()) @@ -1476,6 +1496,33 @@ public static List getValidProductVersions(Product product, Patt } } + if (os != null) + { + LOOP: // + for (Iterator it = versions.iterator(); it.hasNext();) + { + ProductVersion version = it.next(); + for (SetupTask setupTask : version.getSetupTasks()) + { + if (setupTask instanceof P2Task) + { + P2Task p2Task = (P2Task)setupTask; + for (Requirement requirement : p2Task.getRequirements()) + { + if (!requirement.isOptional()) + { + String requirementFilter = requirement.getFilter(); + if (requirementFilter != null && requirementFilter.contains("osgi.arch=") && !SetupWizard.matchesFilterContext(requirementFilter, os)) //$NON-NLS-1$ + { + it.remove(); + continue LOOP; + } + } + } + } + } + } + } return versions; } diff --git a/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/SimpleVariablePage.java b/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/SimpleVariablePage.java index e76cd461d..31e784936 100644 --- a/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/SimpleVariablePage.java +++ b/plugins/org.eclipse.oomph.setup.installer/src/org/eclipse/oomph/setup/internal/installer/SimpleVariablePage.java @@ -446,6 +446,12 @@ protected void modelEmpty(boolean empty) validatePage(); } + @Override + protected String getArch() + { + return OS.INSTANCE.isMac() ? OS.INSTANCE.getOsgiArch() : super.getArch(); + } + @Override protected void jreChanged(JRE jre) { diff --git a/plugins/org.eclipse.oomph.setup.ui/src/org/eclipse/oomph/setup/ui/wizards/SetupWizard.java b/plugins/org.eclipse.oomph.setup.ui/src/org/eclipse/oomph/setup/ui/wizards/SetupWizard.java index df7f71347..673b2ff11 100644 --- a/plugins/org.eclipse.oomph.setup.ui/src/org/eclipse/oomph/setup/ui/wizards/SetupWizard.java +++ b/plugins/org.eclipse.oomph.setup.ui/src/org/eclipse/oomph/setup/ui/wizards/SetupWizard.java @@ -994,6 +994,34 @@ public static Image getBrandingImage(Scope scope) return getImage(imageURI); } + @SuppressWarnings("restriction") + public static boolean matchesFilterContext(String filter, OS os) + { + if (StringUtil.isEmpty(filter)) + { + return true; + } + + Map filterContext = new LinkedHashMap(); + filterContext.put("osgi.ws", os.getOsgiWS()); //$NON-NLS-1$ + filterContext.put("osgi.os", os.getOsgiOS()); //$NON-NLS-1$ + filterContext.put("osgi.arch", os.getOsgiArch()); //$NON-NLS-1$ + + org.eclipse.equinox.internal.p2.metadata.InstallableUnit filterContextIU = (org.eclipse.equinox.internal.p2.metadata.InstallableUnit)org.eclipse.equinox.internal.p2.metadata.InstallableUnit + .contextIU(filterContext); + + try + { + IMatchExpression matchExpression = org.eclipse.equinox.internal.p2.metadata.InstallableUnit.parseFilter(filter); + return matchExpression.isMatch(filterContextIU); + } + catch (RuntimeException ex) + { + // If the filter can't be parsed, assume it matches nothing. + return false; + } + } + private static String getImageURI(URI imageURI) { Image remoteImage = getImage(imageURI); @@ -1396,7 +1424,7 @@ protected void indexLoaded(final Index index) // The requirements capture filter information about arch/os combinations for which JREs are available. // We should not offer a JRE feature for which there isn't really an actual JRE fragment for the current arch/os available. String filter = requirement.getFilter(); - if (!matchesFilterContext(filter)) + if (!matchesFilterContext(filter, wizard.getOS())) { continue LOOP; } @@ -1422,35 +1450,6 @@ protected void indexLoaded(final Index index) } } - @SuppressWarnings("restriction") - private boolean matchesFilterContext(String filter) - { - if (StringUtil.isEmpty(filter)) - { - return true; - } - - OS os = wizard.getOS(); - Map filterContext = new LinkedHashMap(); - filterContext.put("osgi.ws", os.getOsgiWS()); //$NON-NLS-1$ - filterContext.put("osgi.os", os.getOsgiOS()); //$NON-NLS-1$ - filterContext.put("osgi.arch", os.getOsgiArch()); //$NON-NLS-1$ - - org.eclipse.equinox.internal.p2.metadata.InstallableUnit filterContextIU = (org.eclipse.equinox.internal.p2.metadata.InstallableUnit)org.eclipse.equinox.internal.p2.metadata.InstallableUnit - .contextIU(filterContext); - - try - { - IMatchExpression matchExpression = org.eclipse.equinox.internal.p2.metadata.InstallableUnit.parseFilter(filter); - return matchExpression.isMatch(filterContextIU); - } - catch (RuntimeException ex) - { - // If the filter can't be parsed, assume it matches nothing. - return false; - } - } - protected boolean shouldReload(EClass eClass) { return true; diff --git a/plugins/org.eclipse.oomph.util/META-INF/MANIFEST.MF b/plugins/org.eclipse.oomph.util/META-INF/MANIFEST.MF index 69ad467be..0206b1ad7 100644 --- a/plugins/org.eclipse.oomph.util/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.oomph.util/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.oomph.util;singleton:=true -Bundle-Version: 1.16.0.qualifier +Bundle-Version: 1.17.0.qualifier Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin @@ -13,8 +13,8 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)", org.apache.httpcomponents.httpclient;bundle-version="[4.0.0,5.0.0)", org.eclipse.emf.common;bundle-version="[2.10.0,3.0.0)";visibility:=reexport Import-Package: org.osgi.framework;version="[1.3.0,2.0.0)" -Export-Package: org.eclipse.oomph.internal.util;version="1.16.0";x-internal:=true, - org.eclipse.oomph.internal.util.table;version="1.16.0";x-internal:=true, - org.eclipse.oomph.util;version="1.16.0";x-internal:=true +Export-Package: org.eclipse.oomph.internal.util;version="1.17.0";x-internal:=true, + org.eclipse.oomph.internal.util.table;version="1.17.0";x-internal:=true, + org.eclipse.oomph.util;version="1.17.0";x-internal:=true Eclipse-BuddyPolicy: registered Automatic-Module-Name: org.eclipse.oomph.util diff --git a/plugins/org.eclipse.oomph.util/Remote Debug (Port 8123).launch b/plugins/org.eclipse.oomph.util/Remote Debug (Port 8123).launch index b17b0e795..3a6b15693 100644 --- a/plugins/org.eclipse.oomph.util/Remote Debug (Port 8123).launch +++ b/plugins/org.eclipse.oomph.util/Remote Debug (Port 8123).launch @@ -1,22 +1,22 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/plugins/org.eclipse.oomph.util/pom.xml b/plugins/org.eclipse.oomph.util/pom.xml index 040e9f8c0..aeefad2d3 100644 --- a/plugins/org.eclipse.oomph.util/pom.xml +++ b/plugins/org.eclipse.oomph.util/pom.xml @@ -20,7 +20,7 @@ org.eclipse.oomph org.eclipse.oomph.util - 1.16.0-SNAPSHOT + 1.17.0-SNAPSHOT eclipse-plugin diff --git a/plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/OS.java b/plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/OS.java index 0391c9b0d..c8084a6bb 100644 --- a/plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/OS.java +++ b/plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/OS.java @@ -296,6 +296,11 @@ public static void close(Closeable closeable) private static OS create() { + if (Boolean.FALSE) + { + return new Mac(Platform.WS_COCOA, Platform.ARCH_AARCH64); + } + String os = Platform.getOS(); String ws = Platform.getWS(); String arch = Platform.getOSArch(); @@ -330,8 +335,9 @@ private static List createAll() result.add(Win64.INSTANCE); result.add(Win32.INSTANCE); result.add(new Mac(Platform.WS_COCOA, Platform.ARCH_X86_64)); + result.add(new Mac(Platform.WS_COCOA, Platform.ARCH_AARCH64)); result.add(new Linux(Platform.WS_GTK, Platform.ARCH_X86_64)); - result.add(new Linux(Platform.WS_GTK, Platform.ARCH_X86)); + result.add(new Linux(Platform.WS_GTK, Platform.ARCH_AARCH64)); return Collections.unmodifiableList(result); } diff --git a/products/org.eclipse.oomph.setup.installer.product/pom.xml b/products/org.eclipse.oomph.setup.installer.product/pom.xml index 7c876de15..168e0ed07 100644 --- a/products/org.eclipse.oomph.setup.installer.product/pom.xml +++ b/products/org.eclipse.oomph.setup.installer.product/pom.xml @@ -80,6 +80,33 @@ + + env-macaarch64 + + + env + macaarch64 + + + + + + org.eclipse.tycho + target-platform-configuration + ${tycho-version} + + + + macosx + cocoa + aarch64 + + + + + + + env-linux64 diff --git a/products/org.eclipse.oomph.setup.installer.product/repackage-products.sh b/products/org.eclipse.oomph.setup.installer.product/repackage-products.sh index a1a0aaf34..302946e68 100644 --- a/products/org.eclipse.oomph.setup.installer.product/repackage-products.sh +++ b/products/org.eclipse.oomph.setup.installer.product/repackage-products.sh @@ -53,6 +53,18 @@ for i in $(ls); do $product \ $marker > ../repackaged-products/$extractor + elif [[ $i == *mac*aarch64.dmg ]]; then + if [[ $i == *with-jre* ]]; then + cp $i ../repackaged-products/eclipse-inst-jre$restricted-mac-aarch64.dmg + else + cp $i ../repackaged-products/eclipse-inst$restricted-mac-aarch64.dmg + fi + elif [[ $i == *mac*aarch64* ]]; then + if [[ $i == *with-jre* ]]; then + cp $i ../repackaged-products/eclipse-inst-jre$restricted-mac-aarch64.tar.gz + else + cp $i ../repackaged-products/eclipse-inst$restricted-mac-aarch64.tar.gz + fi elif [[ $i == *mac*.dmg ]]; then if [[ $i == *with-jre* ]]; then cp $i ../repackaged-products/eclipse-inst-jre$restricted-mac64.dmg diff --git a/releng/org.eclipse.oomph.parent/pom.xml b/releng/org.eclipse.oomph.parent/pom.xml index 7dbab318d..3e5cbdb59 100644 --- a/releng/org.eclipse.oomph.parent/pom.xml +++ b/releng/org.eclipse.oomph.parent/pom.xml @@ -147,7 +147,7 @@ Eike Stepper - initial API and implementation - org.eclipse.justj.openjdk.hotspot.jre.minimal-16 + org.eclipse.justj.openjdk.hotspot.jre.minimal-17 true @@ -160,6 +160,11 @@ Eike Stepper - initial API and implementation cocoa x86_64 + + macosx + cocoa + aarch64 + linux gtk diff --git a/releng/org.eclipse.oomph.parent/tp/org.eclipse.oomph.tp.target b/releng/org.eclipse.oomph.parent/tp/org.eclipse.oomph.tp.target index 59b0e63c8..2cc9aec7b 100644 --- a/releng/org.eclipse.oomph.parent/tp/org.eclipse.oomph.tp.target +++ b/releng/org.eclipse.oomph.parent/tp/org.eclipse.oomph.tp.target @@ -23,7 +23,7 @@ - + diff --git a/releng/org.eclipse.oomph.releng/Build All 64bit.launch b/releng/org.eclipse.oomph.releng/Build All 64bit.launch index 79b567fa4..9639a8e28 100644 --- a/releng/org.eclipse.oomph.releng/Build All 64bit.launch +++ b/releng/org.eclipse.oomph.releng/Build All 64bit.launch @@ -1,15 +1,15 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/releng/org.eclipse.oomph.releng/Build Windows 64bit.launch b/releng/org.eclipse.oomph.releng/Build Windows 64bit.launch index 341f90734..7e972ddf7 100644 --- a/releng/org.eclipse.oomph.releng/Build Windows 64bit.launch +++ b/releng/org.eclipse.oomph.releng/Build Windows 64bit.launch @@ -1,15 +1,15 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/releng/org.eclipse.oomph.releng/hudson/product-index.sh b/releng/org.eclipse.oomph.releng/hudson/product-index.sh index 2d319e17e..a6105c4df 100644 --- a/releng/org.eclipse.oomph.releng/hudson/product-index.sh +++ b/releng/org.eclipse.oomph.releng/hudson/product-index.sh @@ -35,6 +35,8 @@ for i in $named_releases $numbered_releases; do if [ -f $prefix$os$b.exe ]; then candidate=$prefix$os$b.exe + elif [ -f $prefix$os-$b.dmg ]; then + candidate=$prefix$os-$b.dmg elif [ -f $prefix$os$b.dmg ]; then candidate=$prefix$os$b.dmg elif [ -f $prefix$os-$b.tar.gz ]; then diff --git a/setups/Oomph.setup b/setups/Oomph.setup index 8bb366b27..580f74aa8 100644 --- a/setups/Oomph.setup +++ b/setups/Oomph.setup @@ -518,7 +518,7 @@ + url="https://download.eclipse.org/justj/jres/17/updates/release/17.0.0"/>