Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 63 additions & 15 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,28 @@ permissions:
issues: write

jobs:
build-linux-jdk8-fx:
build-test:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java-version: [8, 17, 21, 25]

steps:
- uses: actions/checkout@v1
- name: Set up JDK 8
if: matrix.java-version == 8
uses: actions/setup-java@v1
with:
java-version: 1.8
java-package: jdk+fx
- name: Set up JDK
if: matrix.java-version != 8
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.java-version }}
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
Expand All @@ -54,8 +65,12 @@ jobs:
${{ runner.os }}-m2
- name: Run Unit Tests
run: |
MVN_ARGS=""
if [ "${{ matrix.java-version }}" != "8" ]; then
MVN_ARGS="-Dspotbugs.skip=true"
fi
cd maven
mvn clean verify -DunitTests=true -pl core-unittests -am -Dmaven.javadoc.skip=true -Plocal-dev-javase
mvn clean verify -DunitTests=true -pl core-unittests -am -Dmaven.javadoc.skip=true -Plocal-dev-javase $MVN_ARGS
cd ..
- name: Prepare Codename One binaries for Maven plugin tests
run: |
Expand All @@ -73,7 +88,7 @@ jobs:
-Dcn1.binaries="${CN1_BINARIES}" \
-pl codenameone-maven-plugin -am -Plocal-dev-javase test
- name: Generate static analysis HTML summaries
if: ${{ always() }}
if: ${{ always() && matrix.java-version == 8 }}
env:
QUALITY_REPORT_TARGET_DIRS: maven/core-unittests/target
QUALITY_REPORT_SERVER_URL: ${{ github.server_url }}
Expand All @@ -82,7 +97,7 @@ jobs:
QUALITY_REPORT_GENERATE_HTML_ONLY: "1"
run: python3 .github/scripts/generate-quality-report.py
- name: Collect quality artifacts
if: ${{ always() }}
if: ${{ always() && matrix.java-version == 8 }}
run: |
set -euo pipefail
mkdir -p quality-artifacts/static-analysis
Expand Down Expand Up @@ -110,14 +125,14 @@ jobs:
echo "No quality artifacts were generated." > quality-artifacts/README.txt
fi
- name: Upload quality artifacts
if: ${{ always() }}
if: ${{ always() && matrix.java-version == 8 }}
id: upload-quality-artifacts
uses: actions/upload-artifact@v4
with:
name: quality-artifacts
path: quality-artifacts
- name: Publish quality report previews
if: ${{ always() && github.server_url == 'https://github.com' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
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) }}
id: publish-quality-previews
env:
GITHUB_TOKEN: ${{ github.token }}
Expand Down Expand Up @@ -183,7 +198,7 @@ jobs:
echo "jacoco_url=${preview_base}/coverage/index.html" >> "$GITHUB_OUTPUT"
fi
- name: Generate quality report summary
if: ${{ always() }}
if: ${{ always() && matrix.java-version == 8 }}
env:
QUALITY_REPORT_TARGET_DIRS: maven/core-unittests/target
QUALITY_REPORT_SERVER_URL: ${{ github.server_url }}
Expand All @@ -199,13 +214,13 @@ jobs:
JACOCO_HTML_URL: ${{ steps.publish-quality-previews.outputs.jacoco_url }}
run: python3 .github/scripts/generate-quality-report.py
- name: Upload quality report summary
if: ${{ always() }}
if: ${{ always() && matrix.java-version == 8 }}
uses: actions/upload-artifact@v4
with:
name: quality-report
path: quality-report.md
- name: Publish quality report comment
if: ${{ github.event_name == 'pull_request' }}
if: ${{ github.event_name == 'pull_request' && matrix.java-version == 8 }}
uses: actions/github-script@v7
with:
script: |
Expand All @@ -217,15 +232,27 @@ jobs:
wget https://github.com/codenameone/cn1-binaries/archive/refs/heads/master.zip
unzip master.zip -d ..
mv ../cn1-binaries-master ../cn1-binaries
- name: Build with Ant
run: xvfb-run ant test-javase
- name: Build CLDC11 JAR
run: ant -noinput -buildfile Ports/CLDC11/build.xml jar
run: |
ANT_OPTS_ARGS=""
if [ "${{ matrix.java-version }}" != "8" ]; then
ANT_OPTS_ARGS="-Djavac.source=1.8 -Djavac.target=1.8"
fi
ant $ANT_OPTS_ARGS -noinput -buildfile Ports/CLDC11/build.xml jar
- name: Build with Ant
run: |
ANT_OPTS_ARGS=""
if [ "${{ matrix.java-version }}" != "8" ]; then
ANT_OPTS_ARGS="-Djavac.source=1.8 -Djavac.target=1.8"
fi
xvfb-run ant $ANT_OPTS_ARGS test-javase

- name: Build Release
if: matrix.java-version == 8
run: ant -noinput -buildfile CodenameOne/build.xml weeklyLibUpdate

- name: Build JavaDocs
if: matrix.java-version == 8
run: |
cd CodenameOne
mkdir -p build
Expand All @@ -240,12 +267,18 @@ jobs:
cd ..

- name: Build iOS Port
run: ant -noinput -buildfile Ports/iOSPort/build.xml jar
run: |
ANT_OPTS_ARGS=""
if [ "${{ matrix.java-version }}" != "8" ]; then
ANT_OPTS_ARGS="-Djavac.source=1.8 -Djavac.target=1.8"
fi
ant $ANT_OPTS_ARGS -noinput -buildfile Ports/iOSPort/build.xml jar

- name: Build iOS VM API
run: mvn -f vm/JavaAPI/pom.xml package

- name: Upload a Build Artifact
if: matrix.java-version == 8
uses: actions/upload-artifact@v4
with:
name: JavaAPI.jar
Expand All @@ -255,27 +288,41 @@ jobs:
run: mvn -f vm/ByteCodeTranslator/pom.xml package

- name: Build CLDC 11 VM
run: ant -noinput -buildfile Ports/CLDC11/build.xml jar
run: |
ANT_OPTS_ARGS=""
if [ "${{ matrix.java-version }}" != "8" ]; then
ANT_OPTS_ARGS="-Djavac.source=1.8 -Djavac.target=1.8"
fi
ant $ANT_OPTS_ARGS -noinput -buildfile Ports/CLDC11/build.xml jar

- name: Upload a Build Artifact
if: matrix.java-version == 8
uses: actions/upload-artifact@v4
with:
name: ByteCodeTranslator.jar
path: vm/ByteCodeTranslator/target/ByteCodeTranslator-1.0-SNAPSHOT.jar

- name: Upload a Build Artifact
if: matrix.java-version == 8
uses: actions/upload-artifact@v4
with:
name: CLDC11.jar
path: Ports/CLDC11/dist/CLDC11.jar

- name: Build Android Port
run: ant -noinput -buildfile Ports/Android/build.xml jar
run: |
ANT_OPTS_ARGS=""
if [ "${{ matrix.java-version }}" != "8" ]; then
ANT_OPTS_ARGS="-Djavac.source=1.8 -Djavac.target=1.8"
fi
ant $ANT_OPTS_ARGS -noinput -buildfile Ports/Android/build.xml jar

- name: Packaging Everything
if: matrix.java-version == 8
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

- name: Copying Files to Server
if: matrix.java-version == 8
uses: marcodallasanta/[email protected]
with:
host: ${{ secrets.WP_HOST }}
Expand All @@ -284,6 +331,7 @@ jobs:
local: result.zip

- name: Upload a Build Artifact
if: matrix.java-version == 8
uses: actions/upload-artifact@v4
with:
name: JavaSE.jar
Expand Down
16 changes: 14 additions & 2 deletions maven/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,25 @@
<artifactId>maven-compiler-plugin</artifactId>

<configuration>
<source>1.5</source>
<target>1.5</target>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
</plugins>

</build>
<profiles>
<profile>
<id>modern-jdk</id>
<activation>
<jdk>[9,)</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</profile>
</profiles>


</project>
52 changes: 40 additions & 12 deletions maven/parparvm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
<src.dir>../../vm/ByteCodeTranslator/src</src.dir>

<codename1.javaapi.src.dir>../../vm/JavaAPI/src</codename1.javaapi.src.dir>
<javaapi.compiler.source>1.5</javaapi.compiler.source>
<javaapi.compiler.target>1.5</javaapi.compiler.target>

</properties>

Expand Down Expand Up @@ -85,15 +87,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.5.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
<executions>
<execution>
<id>compile-java-api</id>
Expand All @@ -105,8 +98,8 @@
<target>
<mkdir dir="${project.build.directory}/api-classes"/>
<javac srcdir="${codename1.javaapi.src.dir}"
source="1.5"
target="1.5"
source="${javaapi.compiler.source}"
target="${javaapi.compiler.target}"
destdir="${project.build.directory}/api-classes"
failonerror="true"
/>
Expand Down Expand Up @@ -159,6 +152,41 @@
</plugin>
</plugins>
</build>


<profiles>
<profile>
<id>legacy-jdk-tools</id>
<activation>
<jdk>(,9)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.5.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>modern-jdk</id>
<activation>
<jdk>[9,)</jdk>
</activation>
<properties>
<javaapi.compiler.source>1.8</javaapi.compiler.source>
<javaapi.compiler.target>1.8</javaapi.compiler.target>
</properties>
</profile>
</profiles>

</project>
22 changes: 20 additions & 2 deletions vm/JavaAPI/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@
<packaging>jar</packaging>
<name>JavaAPI</name>

<properties>
<maven.compiler.source>1.5</maven.compiler.source>
<maven.compiler.target>1.5</maven.compiler.target>
</properties>

<profiles>
<profile>
<id>modern-jdk</id>
<activation>
<jdk>[9,)</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</profile>
</profiles>

<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
Expand All @@ -21,8 +39,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<!-- Allow compiling java.* packages -->
<compilerArgs>
<arg>-Xlint:-options</arg>
Expand Down
Loading