Skip to content

Commit a80fd14

Browse files
Add CLDC11 compatibility check workflow and APIChecker tool
This change introduces a new GitHub Actions pipeline (`.github/workflows/cldc11-check.yml`) that verifies `Ports/CLDC11` is a binary compatible subset of JavaSE 11 and `vm/JavaAPI`. It also adds a custom tool `scripts/api-checker`, implemented in Java using ASM, to perform the binary compatibility analysis (checking classes, methods, fields, superclasses, and interfaces). The tool generates a report of extra APIs present in the reference (e.g., `vm/JavaAPI`) as requested.
1 parent 7af2bce commit a80fd14

File tree

3 files changed

+402
-0
lines changed

3 files changed

+402
-0
lines changed

.github/workflows/cldc11-check.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CLDC11 Compatibility Check
2+
3+
on:
4+
push:
5+
paths:
6+
- 'Ports/CLDC11/**'
7+
- 'vm/JavaAPI/**'
8+
- '.github/workflows/cldc11-check.yml'
9+
pull_request:
10+
paths:
11+
- 'Ports/CLDC11/**'
12+
- 'vm/JavaAPI/**'
13+
- '.github/workflows/cldc11-check.yml'
14+
15+
jobs:
16+
check-cldc11:
17+
runs-on: ubuntu-latest
18+
container:
19+
image: ghcr.io/codenameone/codenameone/ci-container:latest
20+
defaults:
21+
run:
22+
shell: bash
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Build APIChecker
29+
run: mvn package -f scripts/api-checker/pom.xml
30+
31+
- name: Build Ports/CLDC11
32+
run: |
33+
cd Ports/CLDC11
34+
ant jar
35+
36+
- name: Build vm/JavaAPI
37+
run: mvn package -f vm/JavaAPI/pom.xml -DskipTests
38+
39+
- name: Check CLDC11 vs JavaSE 11
40+
run: |
41+
$JAVA11_HOME/bin/java -jar scripts/api-checker/target/api-checker-1.0-SNAPSHOT.jar \
42+
--subject Ports/CLDC11/dist/CLDC11.jar \
43+
--reference java11
44+
45+
- name: Check CLDC11 vs vm/JavaAPI
46+
run: |
47+
$JAVA11_HOME/bin/java -jar scripts/api-checker/target/api-checker-1.0-SNAPSHOT.jar \
48+
--subject Ports/CLDC11/dist/CLDC11.jar \
49+
--reference vm/JavaAPI/target/classes \
50+
--report extra_apis_report.json
51+
52+
- name: Upload Extra APIs Report
53+
if: always()
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: extra-apis-report
57+
path: extra_apis_report.json

scripts/api-checker/pom.xml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>com.codename1.tools</groupId>
7+
<artifactId>api-checker</artifactId>
8+
<version>1.0-SNAPSHOT</version>
9+
<packaging>jar</packaging>
10+
11+
<properties>
12+
<maven.compiler.source>11</maven.compiler.source>
13+
<maven.compiler.target>11</maven.compiler.target>
14+
<asm.version>9.6</asm.version>
15+
</properties>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>org.ow2.asm</groupId>
20+
<artifactId>asm</artifactId>
21+
<version>${asm.version}</version>
22+
</dependency>
23+
<dependency>
24+
<groupId>org.ow2.asm</groupId>
25+
<artifactId>asm-tree</artifactId>
26+
<version>${asm.version}</version>
27+
</dependency>
28+
<dependency>
29+
<groupId>org.ow2.asm</groupId>
30+
<artifactId>asm-commons</artifactId>
31+
<version>${asm.version}</version>
32+
</dependency>
33+
<dependency>
34+
<groupId>com.fasterxml.jackson.core</groupId>
35+
<artifactId>jackson-databind</artifactId>
36+
<version>2.15.2</version>
37+
</dependency>
38+
</dependencies>
39+
40+
<build>
41+
<plugins>
42+
<plugin>
43+
<groupId>org.apache.maven.plugins</groupId>
44+
<artifactId>maven-shade-plugin</artifactId>
45+
<version>3.5.0</version>
46+
<executions>
47+
<execution>
48+
<phase>package</phase>
49+
<goals>
50+
<goal>shade</goal>
51+
</goals>
52+
<configuration>
53+
<transformers>
54+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
55+
<mainClass>com.codename1.apichecker.APIChecker</mainClass>
56+
</transformer>
57+
</transformers>
58+
</configuration>
59+
</execution>
60+
</executions>
61+
</plugin>
62+
</plugins>
63+
</build>
64+
</project>

0 commit comments

Comments
 (0)