diff options
author | Thomas Wolf | 2021-06-15 19:03:02 +0000 |
---|---|---|
committer | Thomas Wolf | 2021-06-15 19:17:29 +0000 |
commit | 0aa89983a83c8d744043601d6bfeb3d9bdedc25d (patch) | |
tree | 41f94b0ddbc8edb9c695f7fec345713f2edd8feb | |
parent | d34b63998185ab279158e58f93d906a7c9109e0f (diff) | |
download | egit-github-stable-5.12.tar.gz egit-github-stable-5.12.tar.xz egit-github-stable-5.12.zip |
[releng] Force --release and use BREE to run testsstable-5.12
Make the EGit-Github 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.
This requires a ~/.m2/toolchains.xml file defining at least a
JavaSE-1.8 toolchain. The CI build pods do have such toolchain
definitions.
Change-Id: I82e9cb4c2518bc13906d44cc1ead2724f7130ffe
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 files changed, 54 insertions, 0 deletions
diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/AllHeadlessTests.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/AllHeadlessTests.java index 9d2a6923..b3f7a112 100644 --- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/AllHeadlessTests.java +++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/AllHeadlessTests.java @@ -25,6 +25,7 @@ import org.junit.runners.Suite.SuiteClasses; @SuiteClasses({ ApplicationTest.class, // AuthorizationTest.class, // BlobTest.class, // + BreeSmokeTest.class, // CollaboratorServiceTest.class, // CommentTest.class, // CommitCommentPayloadTest.class, // diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/BreeSmokeTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/BreeSmokeTest.java new file mode 100644 index 00000000..ebf33574 --- /dev/null +++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/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.github.core.tests; + +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); + } +} @@ -67,6 +67,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>platform-oxygen</id> <activation> <property> @@ -437,6 +455,7 @@ <version>${tycho-version}</version> <configuration> <trimStackTrace>false</trimStackTrace> + <useJDK>BREE</useJDK> </configuration> </plugin> <plugin> |