Skip to content

Commit 9189a20

Browse files
authored
Merge branch 'master' into feature/ci-container-optimization-15610411111039306208
2 parents a2efc91 + f4e9392 commit 9189a20

File tree

8 files changed

+358
-68
lines changed

8 files changed

+358
-68
lines changed

.github/workflows/pr.yml

Lines changed: 70 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,31 @@ permissions:
3434
issues: write
3535

3636
jobs:
37-
build-linux-jdk8-fx:
37+
build-test:
3838

3939
runs-on: ubuntu-latest
4040
container:
4141
image: ghcr.io/codenameone/codenameone/ci-container:latest
4242

43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
java-version: [8, 17, 21, 25]
47+
4348
steps:
4449
- uses: actions/checkout@v1
50+
- name: Set up JDK 8
51+
if: matrix.java-version == 8
52+
uses: actions/setup-java@v1
53+
with:
54+
java-version: 1.8
55+
java-package: jdk+fx
56+
- name: Set up JDK
57+
if: matrix.java-version != 8
58+
uses: actions/setup-java@v4
59+
with:
60+
distribution: 'zulu'
61+
java-version: ${{ matrix.java-version }}
4562
- name: Cache Maven dependencies
4663
uses: actions/cache@v4
4764
with:
@@ -51,8 +68,12 @@ jobs:
5168
${{ runner.os }}-m2
5269
- name: Run Unit Tests
5370
run: |
71+
MVN_ARGS=""
72+
if [ "${{ matrix.java-version }}" != "8" ]; then
73+
MVN_ARGS="-Dspotbugs.skip=true"
74+
fi
5475
cd maven
55-
mvn clean verify -DunitTests=true -pl core-unittests -am -Dmaven.javadoc.skip=true -Plocal-dev-javase
76+
mvn clean verify -DunitTests=true -pl core-unittests -am -Dmaven.javadoc.skip=true -Plocal-dev-javase $MVN_ARGS
5677
cd ..
5778
- name: Run Maven plugin tests
5879
working-directory: maven
@@ -65,7 +86,7 @@ jobs:
6586
-Dcn1.binaries="${CN1_BINARIES}" \
6687
-pl codenameone-maven-plugin -am -Plocal-dev-javase test
6788
- name: Generate static analysis HTML summaries
68-
if: ${{ always() }}
89+
if: ${{ always() && matrix.java-version == 8 }}
6990
env:
7091
QUALITY_REPORT_TARGET_DIRS: maven/core-unittests/target
7192
QUALITY_REPORT_SERVER_URL: ${{ github.server_url }}
@@ -74,7 +95,7 @@ jobs:
7495
QUALITY_REPORT_GENERATE_HTML_ONLY: "1"
7596
run: python3 .github/scripts/generate-quality-report.py
7697
- name: Collect quality artifacts
77-
if: ${{ always() }}
98+
if: ${{ always() && matrix.java-version == 8 }}
7899
run: |
79100
set -euo pipefail
80101
mkdir -p quality-artifacts/static-analysis
@@ -102,14 +123,14 @@ jobs:
102123
echo "No quality artifacts were generated." > quality-artifacts/README.txt
103124
fi
104125
- name: Upload quality artifacts
105-
if: ${{ always() }}
126+
if: ${{ always() && matrix.java-version == 8 }}
106127
id: upload-quality-artifacts
107128
uses: actions/upload-artifact@v4
108129
with:
109130
name: quality-artifacts
110131
path: quality-artifacts
111132
- name: Publish quality report previews
112-
if: ${{ always() && github.server_url == 'https://github.com' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
133+
if: ${{ always() && matrix.java-version == 8 && github.server_url == 'https://github.com' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
113134
id: publish-quality-previews
114135
env:
115136
GITHUB_TOKEN: ${{ github.token }}
@@ -175,7 +196,7 @@ jobs:
175196
echo "jacoco_url=${preview_base}/coverage/index.html" >> "$GITHUB_OUTPUT"
176197
fi
177198
- name: Generate quality report summary
178-
if: ${{ always() }}
199+
if: ${{ always() && matrix.java-version == 8 }}
179200
env:
180201
QUALITY_REPORT_TARGET_DIRS: maven/core-unittests/target
181202
QUALITY_REPORT_SERVER_URL: ${{ github.server_url }}
@@ -191,13 +212,13 @@ jobs:
191212
JACOCO_HTML_URL: ${{ steps.publish-quality-previews.outputs.jacoco_url }}
192213
run: python3 .github/scripts/generate-quality-report.py
193214
- name: Upload quality report summary
194-
if: ${{ always() }}
215+
if: ${{ always() && matrix.java-version == 8 }}
195216
uses: actions/upload-artifact@v4
196217
with:
197218
name: quality-report
198219
path: quality-report.md
199220
- name: Publish quality report comment
200-
if: ${{ github.event_name == 'pull_request' }}
221+
if: ${{ github.event_name == 'pull_request' && matrix.java-version == 8 }}
201222
uses: actions/github-script@v7
202223
with:
203224
script: |
@@ -208,13 +229,28 @@ jobs:
208229
ln -sf $CN1_BINARIES ../cn1-binaries
209230
- name: Build with Ant
210231
run: xvfb-run ant test-javase
232+
211233
- name: Build CLDC11 JAR
212-
run: ant -noinput -buildfile Ports/CLDC11/build.xml jar
234+
run: |
235+
ANT_OPTS_ARGS=""
236+
if [ "${{ matrix.java-version }}" != "8" ]; then
237+
ANT_OPTS_ARGS="-Djavac.source=1.8 -Djavac.target=1.8"
238+
fi
239+
ant $ANT_OPTS_ARGS -noinput -buildfile Ports/CLDC11/build.xml jar
240+
- name: Build with Ant
241+
run: |
242+
ANT_OPTS_ARGS=""
243+
if [ "${{ matrix.java-version }}" != "8" ]; then
244+
ANT_OPTS_ARGS="-Djavac.source=1.8 -Djavac.target=1.8"
245+
fi
246+
xvfb-run ant $ANT_OPTS_ARGS test-javase
213247
214248
- name: Build Release
249+
if: matrix.java-version == 8
215250
run: ant -noinput -buildfile CodenameOne/build.xml weeklyLibUpdate
216251

217252
- name: Build JavaDocs
253+
if: matrix.java-version == 8
218254
run: |
219255
cd CodenameOne
220256
mkdir -p build
@@ -229,12 +265,18 @@ jobs:
229265
cd ..
230266
231267
- name: Build iOS Port
232-
run: ant -noinput -buildfile Ports/iOSPort/build.xml jar
268+
run: |
269+
ANT_OPTS_ARGS=""
270+
if [ "${{ matrix.java-version }}" != "8" ]; then
271+
ANT_OPTS_ARGS="-Djavac.source=1.8 -Djavac.target=1.8"
272+
fi
273+
ant $ANT_OPTS_ARGS -noinput -buildfile Ports/iOSPort/build.xml jar
233274
234275
- name: Build iOS VM API
235276
run: mvn -f vm/JavaAPI/pom.xml package
236277

237278
- name: Upload a Build Artifact
279+
if: matrix.java-version == 8
238280
uses: actions/upload-artifact@v4
239281
with:
240282
name: JavaAPI.jar
@@ -244,27 +286,41 @@ jobs:
244286
run: mvn -f vm/ByteCodeTranslator/pom.xml package
245287

246288
- name: Build CLDC 11 VM
247-
run: ant -noinput -buildfile Ports/CLDC11/build.xml jar
289+
run: |
290+
ANT_OPTS_ARGS=""
291+
if [ "${{ matrix.java-version }}" != "8" ]; then
292+
ANT_OPTS_ARGS="-Djavac.source=1.8 -Djavac.target=1.8"
293+
fi
294+
ant $ANT_OPTS_ARGS -noinput -buildfile Ports/CLDC11/build.xml jar
248295
249296
- name: Upload a Build Artifact
297+
if: matrix.java-version == 8
250298
uses: actions/upload-artifact@v4
251299
with:
252300
name: ByteCodeTranslator.jar
253301
path: vm/ByteCodeTranslator/target/ByteCodeTranslator-1.0-SNAPSHOT.jar
254302

255303
- name: Upload a Build Artifact
304+
if: matrix.java-version == 8
256305
uses: actions/upload-artifact@v4
257306
with:
258307
name: CLDC11.jar
259308
path: Ports/CLDC11/dist/CLDC11.jar
260309

261310
- name: Build Android Port
262-
run: ant -noinput -buildfile Ports/Android/build.xml jar
311+
run: |
312+
ANT_OPTS_ARGS=""
313+
if [ "${{ matrix.java-version }}" != "8" ]; then
314+
ANT_OPTS_ARGS="-Djavac.source=1.8 -Djavac.target=1.8"
315+
fi
316+
ant $ANT_OPTS_ARGS -noinput -buildfile Ports/Android/build.xml jar
263317
264318
- name: Packaging Everything
319+
if: matrix.java-version == 8
265320
run: zip -j result.zip CodenameOne/javadocs.zip CodenameOne/dist/CodenameOne.jar CodenameOne/updatedLibs.zip Ports/JavaSE/dist/JavaSE.jar build/CodenameOneDist/CodenameOne/demos/CodenameOne_SRC.zip
266321

267322
- name: Copying Files to Server
323+
if: matrix.java-version == 8
268324
uses: marcodallasanta/[email protected]
269325
with:
270326
host: ${{ secrets.WP_HOST }}
@@ -273,6 +329,7 @@ jobs:
273329
local: result.zip
274330

275331
- name: Upload a Build Artifact
332+
if: matrix.java-version == 8
276333
uses: actions/upload-artifact@v4
277334
with:
278335
name: JavaSE.jar

maven/core/pom.xml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,25 @@
4444
<artifactId>maven-compiler-plugin</artifactId>
4545

4646
<configuration>
47-
<source>1.5</source>
48-
<target>1.5</target>
47+
<source>${maven.compiler.source}</source>
48+
<target>${maven.compiler.target}</target>
4949
</configuration>
5050
</plugin>
5151
</plugins>
5252

5353
</build>
54+
<profiles>
55+
<profile>
56+
<id>modern-jdk</id>
57+
<activation>
58+
<jdk>[9,)</jdk>
59+
</activation>
60+
<properties>
61+
<maven.compiler.source>1.8</maven.compiler.source>
62+
<maven.compiler.target>1.8</maven.compiler.target>
63+
</properties>
64+
</profile>
65+
</profiles>
5466

5567

5668
</project>

maven/parparvm/pom.xml

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
<src.dir>../../vm/ByteCodeTranslator/src</src.dir>
4444

4545
<codename1.javaapi.src.dir>../../vm/JavaAPI/src</codename1.javaapi.src.dir>
46+
<javaapi.compiler.source>1.5</javaapi.compiler.source>
47+
<javaapi.compiler.target>1.5</javaapi.compiler.target>
4648

4749
</properties>
4850

@@ -85,15 +87,6 @@
8587
<plugin>
8688
<groupId>org.apache.maven.plugins</groupId>
8789
<artifactId>maven-antrun-plugin</artifactId>
88-
<dependencies>
89-
<dependency>
90-
<groupId>com.sun</groupId>
91-
<artifactId>tools</artifactId>
92-
<version>1.5.0</version>
93-
<scope>system</scope>
94-
<systemPath>${java.home}/../lib/tools.jar</systemPath>
95-
</dependency>
96-
</dependencies>
9790
<executions>
9891
<execution>
9992
<id>compile-java-api</id>
@@ -105,8 +98,8 @@
10598
<target>
10699
<mkdir dir="${project.build.directory}/api-classes"/>
107100
<javac srcdir="${codename1.javaapi.src.dir}"
108-
source="1.5"
109-
target="1.5"
101+
source="${javaapi.compiler.source}"
102+
target="${javaapi.compiler.target}"
110103
destdir="${project.build.directory}/api-classes"
111104
failonerror="true"
112105
/>
@@ -159,6 +152,41 @@
159152
</plugin>
160153
</plugins>
161154
</build>
162-
155+
156+
<profiles>
157+
<profile>
158+
<id>legacy-jdk-tools</id>
159+
<activation>
160+
<jdk>(,9)</jdk>
161+
</activation>
162+
<build>
163+
<plugins>
164+
<plugin>
165+
<groupId>org.apache.maven.plugins</groupId>
166+
<artifactId>maven-antrun-plugin</artifactId>
167+
<dependencies>
168+
<dependency>
169+
<groupId>com.sun</groupId>
170+
<artifactId>tools</artifactId>
171+
<version>1.5.0</version>
172+
<scope>system</scope>
173+
<systemPath>${java.home}/../lib/tools.jar</systemPath>
174+
</dependency>
175+
</dependencies>
176+
</plugin>
177+
</plugins>
178+
</build>
179+
</profile>
180+
<profile>
181+
<id>modern-jdk</id>
182+
<activation>
183+
<jdk>[9,)</jdk>
184+
</activation>
185+
<properties>
186+
<javaapi.compiler.source>1.8</javaapi.compiler.source>
187+
<javaapi.compiler.target>1.8</javaapi.compiler.target>
188+
</properties>
189+
</profile>
190+
</profiles>
163191

164192
</project>

vm/ByteCodeTranslator/nbproject/project.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ dist.jar=${dist.dir}/ByteCodeTranslator.jar
2929
dist.javadoc.dir=${dist.dir}/javadoc
3030
endorsed.classpath=
3131
excludes=
32-
file.reference.asm-5.0.3.jar=../../../cn1-binaries/vm/asm-9.8.jar
33-
file.reference.asm-commons-5.0.3.jar=../../../cn1-binaries/vm/asm-commons-9.8.jar
34-
file.reference.asm-tree-5.0.3.jar=../../../cn1-binaries/vm/asm-tree-9.8.jar
32+
file.reference.asm-9.8.jar=../../../cn1-binaries/vm/asm-9.8.jar
33+
file.reference.asm-commons-9.8.jar=../../../cn1-binaries/vm/asm-commons-9.8.jar
34+
file.reference.asm-tree-9.8.jar=../../../cn1-binaries/vm/asm-tree-9.8.jar
3535
includes=**
3636
jar.compress=false
3737
javac.classpath=\

0 commit comments

Comments
 (0)