Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2021-06-13 17:05:43 +0000
committerThomas Wolf2021-06-15 07:57:42 +0000
commit50b84b9e10f48bfd797d415cd5a792fe450bfc05 (patch)
tree8328bfef28e4b1d664b411604aec529ad31d00b4
parent3e10747deb0ec0cb7e0a37f2c7c6ef85d0790071 (diff)
downloadegit-stable-5.12.tar.gz
egit-stable-5.12.tar.xz
egit-stable-5.12.zip
[releng] Force --release and use BREE to run testsstable-5.12
Make the EGit build work if code is compiled with a Java > 1.8. This prepares for moving the BREE to Java 11: when we do that, we will need to be able to build nightly with and against Java 11, but the stable branch against Java 1.8. The downside is that for a local maven build, you'll need a ~/.m2/toolchains.xml file providing JavaSE-1.8 and JavaSE-11. The CI pods do provide such toolchain definitions for maven. Once this change is submitted and merged to master the EGit CI pipelines will be changed to no longer fix the Java version at 1.8. Change-Id: I5f4c3ea944861d1c96dbbf8e4c2849de50b25219 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/BreeSmokeTest.java34
-rw-r--r--org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/BreeSmokeTest.java34
-rw-r--r--org.eclipse.egit.mylyn.ui.test/src/org/eclipse/egit/internal/mylyn/BreeSmokeTest.java34
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/BreeSmokeTest.java34
-rw-r--r--pom.xml19
5 files changed, 155 insertions, 0 deletions
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/BreeSmokeTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/BreeSmokeTest.java
new file mode 100644
index 0000000000..befb9af9b7
--- /dev/null
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/BreeSmokeTest.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (C) 2021 Thomas Wolf <thomas.wolf@paranor.ch>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.egit.core.internal;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+
+import org.junit.Test;
+
+/**
+ * Simple test to guard against build setup errors such as --release not being
+ * effective.
+ */
+public class BreeSmokeTest {
+
+ @Test
+ public void testByteBuffer() {
+ // This test will fail if compiled against a Java 11 library without
+ // --release 8 and then run on a Java 8 JVM with Java 8 libraries
+ ByteBuffer buffer = ByteBuffer.allocate(10);
+ Buffer flipped = buffer.flip();
+ assertNotNull(flipped);
+ }
+}
diff --git a/org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/BreeSmokeTest.java b/org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/BreeSmokeTest.java
new file mode 100644
index 0000000000..664c7ffb50
--- /dev/null
+++ b/org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/BreeSmokeTest.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (C) 2021 Thomas Wolf <thomas.wolf@paranor.ch>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.egit.gitflow;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+
+import org.junit.Test;
+
+/**
+ * Simple test to guard against build setup errors such as --release not being
+ * effective.
+ */
+public class BreeSmokeTest {
+
+ @Test
+ public void testByteBuffer() {
+ // This test will fail if compiled against a Java 11 library without
+ // --release 8 and then run on a Java 8 JVM with Java 8 libraries
+ ByteBuffer buffer = ByteBuffer.allocate(10);
+ Buffer flipped = buffer.flip();
+ assertNotNull(flipped);
+ }
+}
diff --git a/org.eclipse.egit.mylyn.ui.test/src/org/eclipse/egit/internal/mylyn/BreeSmokeTest.java b/org.eclipse.egit.mylyn.ui.test/src/org/eclipse/egit/internal/mylyn/BreeSmokeTest.java
new file mode 100644
index 0000000000..119ce61848
--- /dev/null
+++ b/org.eclipse.egit.mylyn.ui.test/src/org/eclipse/egit/internal/mylyn/BreeSmokeTest.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (C) 2021 Thomas Wolf <thomas.wolf@paranor.ch>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.egit.internal.mylyn;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+
+import org.junit.Test;
+
+/**
+ * Simple test to guard against build setup errors such as --release not being
+ * effective.
+ */
+public class BreeSmokeTest {
+
+ @Test
+ public void testByteBuffer() {
+ // This test will fail if compiled against a Java 11 library without
+ // --release 8 and then run on a Java 8 JVM with Java 8 libraries
+ ByteBuffer buffer = ByteBuffer.allocate(10);
+ Buffer flipped = buffer.flip();
+ assertNotNull(flipped);
+ }
+}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/BreeSmokeTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/BreeSmokeTest.java
new file mode 100644
index 0000000000..1846e9a472
--- /dev/null
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/BreeSmokeTest.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (C) 2021 Thomas Wolf <thomas.wolf@paranor.ch>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.egit.ui.internal;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+
+import org.junit.Test;
+
+/**
+ * Simple test to guard against build setup errors such as --release not being
+ * effective.
+ */
+public class BreeSmokeTest {
+
+ @Test
+ public void testByteBuffer() {
+ // This test will fail if compiled against a Java 11 library without
+ // --release 8 and then run on a Java 8 JVM with Java 8 libraries
+ ByteBuffer buffer = ByteBuffer.allocate(10);
+ Buffer flipped = buffer.flip();
+ assertNotNull(flipped);
+ }
+}
diff --git a/pom.xml b/pom.xml
index 633dea9c62..a9b38be4e2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -81,6 +81,24 @@
<profiles>
<profile>
+ <id>compile-jdk-newer-than-8</id>
+ <!-- The release argument is allowed only if the Java version used to run maven is > 1.8 -->
+ <activation>
+ <jdk>[9,]</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-compiler-plugin</artifactId>
+ <configuration>
+ <release>8</release>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
<id>static-checks</id>
<build>
<plugins>
@@ -430,6 +448,7 @@
<version>${tycho-version}</version>
<configuration>
<trimStackTrace>false</trimStackTrace>
+ <useJDK>BREE</useJDK>
</configuration>
</plugin>
<plugin>

Back to the top