Blame SOURCES/0004-Bug-537963-Make-the-default-EE-Java-1.8.patch

35a07c
From b7dae094376ab642339d5bcbe52e16cba0fa11f1 Mon Sep 17 00:00:00 2001
35a07c
From: Mat Booth <mat.booth@redhat.com>
35a07c
Date: Wed, 15 Aug 2018 15:58:10 +0100
35a07c
Subject: [PATCH 4/6] Bug 537963 - Make the default EE Java 1.8
35a07c
35a07c
This allows bundles that don't otherwise specify an EE (for example
35a07c
if the bundle contains only a plugin.xml, or is a documentation only
35a07c
bundle, or otherwise does not contain any bytecode) to continue
35a07c
working in environments that are supported by the latest release
35a07c
of Eclipse.
35a07c
35a07c
Change-Id: Ic6e41c3000c85e2e4222e8153e84b7701ab0e750
35a07c
Signed-off-by: Mat Booth <mat.booth@redhat.com>
35a07c
---
35a07c
 .../tycho/osgicompiler/test/OsgiCompilerTest.java |  6 +++---
35a07c
 .../ee/ExecutionEnvironmentConfigurationImpl.java |  6 +++---
35a07c
 .../ee/ExecutionEnvironmentConfigurationTest.java |  4 ++--
35a07c
 .../tycho/core/osgitools/EquinoxResolverTest.java |  2 +-
35a07c
 .../org/eclipse/tycho/core/test/TychoTest.java    |  5 ++++-
35a07c
 .../src/test/resources/projects/bree/pom.xml      |  1 +
35a07c
 .../bree/tycho-default/META-INF/MANIFEST.MF       |  5 +++++
35a07c
 .../projects/bree/tycho-default/build.properties  |  2 ++
35a07c
 .../resources/projects/bree/tycho-default/pom.xml | 15 +++++++++++++++
35a07c
 9 files changed, 36 insertions(+), 10 deletions(-)
35a07c
 create mode 100644 tycho-core/src/test/resources/projects/bree/tycho-default/META-INF/MANIFEST.MF
35a07c
 create mode 100644 tycho-core/src/test/resources/projects/bree/tycho-default/build.properties
35a07c
 create mode 100644 tycho-core/src/test/resources/projects/bree/tycho-default/pom.xml
35a07c
35a07c
diff --git a/tycho-compiler-plugin/src/test/java/org/eclipse/tycho/osgicompiler/test/OsgiCompilerTest.java b/tycho-compiler-plugin/src/test/java/org/eclipse/tycho/osgicompiler/test/OsgiCompilerTest.java
35a07c
index 7451d97..a0dae08 100644
35a07c
--- a/tycho-compiler-plugin/src/test/java/org/eclipse/tycho/osgicompiler/test/OsgiCompilerTest.java
35a07c
+++ b/tycho-compiler-plugin/src/test/java/org/eclipse/tycho/osgicompiler/test/OsgiCompilerTest.java
35a07c
@@ -37,7 +37,7 @@ import copied.org.apache.maven.plugin.CompilationFailureException;
35a07c
 public class OsgiCompilerTest extends AbstractTychoMojoTestCase {
35a07c
 
35a07c
     private static final int TARGET_1_4 = 48;
35a07c
-    private static final int TARGET_9 = 53;
35a07c
+    private static final int TARGET_8 = 52;
35a07c
 
35a07c
     protected File storage;
35a07c
 
35a07c
@@ -235,10 +235,10 @@ public class OsgiCompilerTest extends AbstractTychoMojoTestCase {
35a07c
         List<MavenProject> projects = getSortedProjects(basedir, null);
35a07c
         MavenProject project;
35a07c
         // project with neither POM nor MANIFEST configuration => must fallback to 
35a07c
-        // source/target level == 9
35a07c
+        // source/target level == 8
35a07c
         project = projects.get(1);
35a07c
         getMojo(projects, project).execute();
35a07c
-        assertBytecodeMajorLevel(TARGET_9, new File(project.getBasedir(), "target/classes/Generic.class"));
35a07c
+        assertBytecodeMajorLevel(TARGET_8, new File(project.getBasedir(), "target/classes/Generic.class"));
35a07c
 
35a07c
         // project with multiple execution envs.
35a07c
         // Minimum source and target level must be taken
35a07c
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentConfigurationImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentConfigurationImpl.java
35a07c
index 11f0ccf..ea67379 100644
35a07c
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentConfigurationImpl.java
35a07c
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentConfigurationImpl.java
35a07c
@@ -1,5 +1,5 @@
35a07c
 /*******************************************************************************
35a07c
- * Copyright (c) 2012, 2014 SAP SE and others.
35a07c
+ * Copyright (c) 2012, 2018 SAP SE and others.
35a07c
  * All rights reserved. This program and the accompanying materials
35a07c
  * are made available under the terms of the Eclipse Public License v1.0
35a07c
  * which accompanies this distribution, and is available at
35a07c
@@ -19,8 +19,8 @@ import org.eclipse.tycho.core.ee.shared.SystemCapability;
35a07c
 import org.eclipse.tycho.core.shared.BuildFailureException;
35a07c
 
35a07c
 public class ExecutionEnvironmentConfigurationImpl implements ExecutionEnvironmentConfiguration {
35a07c
-    // Most likely best to always be the latest known supported EE
35a07c
-    private static final String DEFAULT_EXECUTION_ENVIRONMENT = "JavaSE-9";
35a07c
+    // Most likely best to always be the latest known supported long-term supported EE
35a07c
+    private static final String DEFAULT_EXECUTION_ENVIRONMENT = "JavaSE-1.8";
35a07c
 
35a07c
     private static final int PRIMARY = 0;
35a07c
     private static final int SECONDARY = 1;
35a07c
diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentConfigurationTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentConfigurationTest.java
35a07c
index 5391eb2..f04fa21 100644
35a07c
--- a/tycho-core/src/test/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentConfigurationTest.java
35a07c
+++ b/tycho-core/src/test/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentConfigurationTest.java
35a07c
@@ -45,9 +45,9 @@ public class ExecutionEnvironmentConfigurationTest {
35a07c
 
35a07c
     @Test
35a07c
     public void testDefaults() {
35a07c
-        assertThat(subject.getProfileName(), is("JavaSE-9"));
35a07c
+        assertThat(subject.getProfileName(), is("JavaSE-1.8"));
35a07c
         assertThat(subject.isCustomProfile(), is(false));
35a07c
-        assertThat(subject.getFullSpecification().getProfileName(), is("JavaSE-9"));
35a07c
+        assertThat(subject.getFullSpecification().getProfileName(), is("JavaSE-1.8"));
35a07c
     }
35a07c
 
35a07c
     @Test
35a07c
diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/osgitools/EquinoxResolverTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/osgitools/EquinoxResolverTest.java
35a07c
index 54f1134..fa2ce8d 100644
35a07c
--- a/tycho-core/src/test/java/org/eclipse/tycho/core/osgitools/EquinoxResolverTest.java
35a07c
+++ b/tycho-core/src/test/java/org/eclipse/tycho/core/osgitools/EquinoxResolverTest.java
35a07c
@@ -61,7 +61,7 @@ public class EquinoxResolverTest extends AbstractTychoMojoTestCase {
35a07c
         properties.put("tycho-version", TychoVersion.getTychoVersion());
35a07c
 
35a07c
         List<MavenProject> projects = getSortedProjects(basedir, properties, null);
35a07c
-        assertEquals(6, projects.size());
35a07c
+        assertEquals(7, projects.size());
35a07c
 
35a07c
         assertEquals("executionenvironment.manifest-minimal", projects.get(2).getArtifactId());
35a07c
         ExecutionEnvironment ee = TychoProjectUtils.getExecutionEnvironmentConfiguration(projects.get(2))
35a07c
diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/test/TychoTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/test/TychoTest.java
35a07c
index e8eb7ad..a88e2e4 100644
35a07c
--- a/tycho-core/src/test/java/org/eclipse/tycho/core/test/TychoTest.java
35a07c
+++ b/tycho-core/src/test/java/org/eclipse/tycho/core/test/TychoTest.java
35a07c
@@ -360,7 +360,7 @@ public class TychoTest extends AbstractTychoMojoTestCase {
35a07c
         properties.put("tycho-version", TychoVersion.getTychoVersion());
35a07c
 
35a07c
         List<MavenProject> projects = getSortedProjects(basedir, properties, null);
35a07c
-        assertEquals(6, projects.size());
35a07c
+        assertEquals(7, projects.size());
35a07c
         int i = 0;
35a07c
 
35a07c
         assertEquals("executionenvironment.manifest", projects.get(++i).getArtifactId());
35a07c
@@ -377,6 +377,9 @@ public class TychoTest extends AbstractTychoMojoTestCase {
35a07c
 
35a07c
         assertEquals("executionenvironment.pom-default", projects.get(++i).getArtifactId());
35a07c
         assertEquals("OSGi/Minimum-1.2", getActiveEEProfile(projects.get(i)));
35a07c
+
35a07c
+        assertEquals("executionenvironment.tycho-default", projects.get(++i).getArtifactId());
35a07c
+        assertEquals("JavaSE-1.8", getActiveEEProfile(projects.get(i)));
35a07c
     }
35a07c
 
35a07c
     public void testWithProjectReferencesItself() throws Exception {
35a07c
diff --git a/tycho-core/src/test/resources/projects/bree/pom.xml b/tycho-core/src/test/resources/projects/bree/pom.xml
35a07c
index 1ddff1d..18c5885 100644
35a07c
--- a/tycho-core/src/test/resources/projects/bree/pom.xml
35a07c
+++ b/tycho-core/src/test/resources/projects/bree/pom.xml
35a07c
@@ -14,6 +14,7 @@
35a07c
 		<module>pom-hard</module>
35a07c
 		<module>buildproperties</module>
35a07c
 		<module>pom-default</module>
35a07c
+		<module>tycho-default</module>
35a07c
 	</modules>
35a07c
 
35a07c
 </project>
35a07c
diff --git a/tycho-core/src/test/resources/projects/bree/tycho-default/META-INF/MANIFEST.MF b/tycho-core/src/test/resources/projects/bree/tycho-default/META-INF/MANIFEST.MF
35a07c
new file mode 100644
35a07c
index 0000000..e6d85c6
35a07c
--- /dev/null
35a07c
+++ b/tycho-core/src/test/resources/projects/bree/tycho-default/META-INF/MANIFEST.MF
35a07c
@@ -0,0 +1,5 @@
35a07c
+Manifest-Version: 1.0
35a07c
+Bundle-ManifestVersion: 2
35a07c
+Bundle-Name: A bundle that specifies no EE at all and relies on Tycho to set one.
35a07c
+Bundle-SymbolicName: executionenvironment.tycho-default
35a07c
+Bundle-Version: 1.0.0
35a07c
diff --git a/tycho-core/src/test/resources/projects/bree/tycho-default/build.properties b/tycho-core/src/test/resources/projects/bree/tycho-default/build.properties
35a07c
new file mode 100644
35a07c
index 0000000..7b02ed4
35a07c
--- /dev/null
35a07c
+++ b/tycho-core/src/test/resources/projects/bree/tycho-default/build.properties
35a07c
@@ -0,0 +1,2 @@
35a07c
+bin.includes = META-INF/
35a07c
+
35a07c
diff --git a/tycho-core/src/test/resources/projects/bree/tycho-default/pom.xml b/tycho-core/src/test/resources/projects/bree/tycho-default/pom.xml
35a07c
new file mode 100644
35a07c
index 0000000..f538f5e
35a07c
--- /dev/null
35a07c
+++ b/tycho-core/src/test/resources/projects/bree/tycho-default/pom.xml
35a07c
@@ -0,0 +1,15 @@
35a07c
+
35a07c
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
35a07c
+	<modelVersion>4.0.0</modelVersion>
35a07c
+
35a07c
+	<parent>
35a07c
+		<groupId>executionenvironment</groupId>
35a07c
+		<artifactId>parent</artifactId>
35a07c
+		<version>1.0.0</version>
35a07c
+	</parent>
35a07c
+
35a07c
+	<artifactId>executionenvironment.tycho-default</artifactId>
35a07c
+	<version>1.0.0</version>
35a07c
+	<packaging>eclipse-plugin</packaging>
35a07c
+
35a07c
+</project>
35a07c
-- 
35a07c
2.20.1
35a07c