Skip to content

Commit

Permalink
Adjust build script to skip Gradle on unsupported JDK versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed Dec 11, 2019
1 parent 865cd2e commit 31bd818
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ jobs:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install JDK and build project (without Gradle)
- name: Install JDK and build project
run: |
. ./.github/scripts/install-jdk.sh --feature ea --os linux-x64
./mvnw verify -Pjava14 -pl !byte-buddy-gradle-plugin
./mvnw verify -Pjava14 -pl !byte-buddy-gradle-plugin
./mvnw verify -Pjava14
hotspot-supported:
name: HotSpot (supported)
strategy:
Expand All @@ -41,10 +40,6 @@ jobs:
architecture: x64
- name: Build project
run: ./mvnw verify -Pintegration -Pjava${{ matrix.java }}
if: matrix.java < 14
- name: Build project (without Gradle)
run: ./mvnw verify -Pintegration -Pjava${{ matrix.java }} -pl !byte-buddy-gradle-plugin
if: matrix.java > 13
hotspot-unsupported:
name: HotSpot (unsupported)
strategy:
Expand Down Expand Up @@ -90,12 +85,6 @@ jobs:
run: |
. ./.github/scripts/install-jdk.sh --url "https://api.adoptopenjdk.net/v2/binary/releases/openjdk${{ matrix.java }}?openjdk_impl=openj9&os=linux&arch=x64&release=latest&type=jdk&heap_size=normal"
./mvnw verify -Pintegration -Pjava${{ matrix.java }}
if: matrix.java < 14
- name: Install JDK and build project (without Gradle)
run: |
. ./.github/scripts/install-jdk.sh --url "https://api.adoptopenjdk.net/v2/binary/releases/openjdk${{ matrix.java }}?openjdk_impl=openj9&os=linux&arch=x64&release=latest&type=jdk&heap_size=normal"
./mvnw verify -Pintegration -Pjava${{ matrix.java }} -pl !byte-buddy-gradle-plugin
if: matrix.java > 13
coverage:
name: Coverage
runs-on: ubuntu-18.04
Expand Down
4 changes: 0 additions & 4 deletions byte-buddy-gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ plugins {

apply from: './main.gradle'

if (legacy) {
throw new GradleException("Current JDK version only supports simple build (--build-file build.simple.gradle)");
}

version = pom.parent.version.text().toString()

if (gradle.gradleVersion.startsWith("2.")) { // support legacy version
Expand Down
2 changes: 0 additions & 2 deletions byte-buddy-gradle-plugin/main.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ if (!raw.startsWith("1.") && raw.contains(".")) {
current = JavaVersion.toVersion(raw)
}

ext.legacy = current < JavaVersion.VERSION_1_8

def sourceVersion = System.getProperty("net.bytebuddy.gradle.version.source")
if (sourceVersion != null) {
sourceCompatibility = JavaVersion.toVersion(sourceVersion)
Expand Down
17 changes: 17 additions & 0 deletions byte-buddy-gradle-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<properties>
<version.plugin.antrun>1.8</version.plugin.antrun>
<exec.gradle>gradlew</exec.gradle>
<gradle.disabled>false</gradle.disabled>
<!-- Actual values must be set via settings.xml or using command line arguments since they cannot be published. -->
<gradle.publish.key />
<gradle.publish.secret />
Expand Down Expand Up @@ -68,6 +69,9 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>${version.plugin.exec}</version>
<configuration>
<skip>${gradle.disabled}</skip>
</configuration>
<executions>
<execution>
<id>gradle-clean</id>
Expand Down Expand Up @@ -149,6 +153,7 @@
</build>

<profiles>
<!-- Defines the correct Gradle wrapper binary to use when run on Windows. -->
<profile>
<id>gradle-windows</id>
<activation>
Expand All @@ -162,6 +167,18 @@
</properties>
</profile>

<!-- Avoids triggering Gradle on JDK versions that Gradle does not currently support. -->
<profile>
<id>gradle-disabled</id>
<activation>
<activeByDefault>false</activeByDefault>
<jdk>[14,)</jdk>
</activation>
<properties>
<gradle.disabled>true</gradle.disabled>
</properties>
</profile>

<profile>
<id>extras</id>
<build>
Expand Down

0 comments on commit 31bd818

Please sign in to comment.