Skip to content

Commit c94b29e

Browse files
authored
Configure builds for JDK EA (#769)
Set up builds to work with JDK EA releases. (Thanks to @SentryMan for making me aware of this feature).
1 parent 75d8b7f commit c94b29e

File tree

4 files changed

+53
-3
lines changed

4 files changed

+53
-3
lines changed

.github/workflows/build-EA.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
os-name: [ubuntu-latest]
2525
java-version:
2626
- GA # Latest GA JDK
27-
# - EA # Current Mainline (lombok doesn't yet support)
27+
- EA # Current Mainline
2828
include:
2929
- os-name: macos-latest
3030
java-version: GA
@@ -42,7 +42,7 @@ jobs:
4242
with:
4343
website: jdk.java.net
4444
release: ${{ matrix.java-version }}
45-
45+
4646
- name: Maven cache
4747
uses: actions/cache@v4
4848
env:
@@ -51,7 +51,7 @@ jobs:
5151
path:
5252
~/.m2
5353
key: build-${{ env.cache-name }}
54-
54+
5555
- name: Compile and run tests
5656
shell: bash
5757
run: ./mvnw -B -U clean verify
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (C) 2022 - 2024, the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
// Use bsh rather than groovy since groovy does not support arbitrary JVM bytecode versions.
18+
if (Runtime.version().toString().toLowerCase().contains("ea")) {
19+
System.out.println("Error Prone does not support EA releases of the JDK.");
20+
return false;
21+
} else {
22+
System.out.println("Detected a GA release, proceeding");
23+
return true;
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (C) 2022 - 2024, the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
// Use bsh rather than groovy since groovy does not support arbitrary JVM bytecode versions.
18+
if (Runtime.version().toString().toLowerCase().contains("ea")) {
19+
System.out.println("Lombok does not support EA releases of the JDK.");
20+
return false;
21+
} else {
22+
System.out.println("Detected a GA release, proceeding");
23+
return true;
24+
}

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,13 +609,15 @@
609609
<include>**.yaml</include>
610610
<include>**/pom.xml</include>
611611
<include>**/security-suppressions.xml</include>
612+
<include>**/src/**/*.bsh</include>
612613
<include>**/src/**/*.groovy</include>
613614
<include>**/src/**/*.java</include>
614615
<include>**/src/it/settings.xml</include>
615616
</includes>
616617
</licenseSet>
617618
</licenseSets>
618619
<mapping>
620+
<bsh>SLASHSTAR_STYLE</bsh>
619621
<groovy>SLASHSTAR_STYLE</groovy>
620622
<java>SLASHSTAR_STYLE</java>
621623
<toml>SCRIPT_STYLE</toml>

0 commit comments

Comments
 (0)