Skip to content

Commit 86f8a5c

Browse files
committed
Minor changes and improved CI logic
1 parent 4d096f8 commit 86f8a5c

File tree

6 files changed

+119
-123
lines changed

6 files changed

+119
-123
lines changed

.github/workflows/scripts-android.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ name: Test Android build scripts
99
push:
1010
branches:
1111
- master
12-
paths:
13-
- 'scripts/**'
14-
- 'BUILDING.md'
12+
paths-ignore:
13+
- '**/*.md'
1514

1615
jobs:
1716
build-android:

.github/workflows/scripts-ios.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ name: Test iOS build scripts
99
push:
1010
branches:
1111
- master
12-
paths:
13-
- 'scripts/**'
14-
- 'BUILDING.md'
12+
paths-ignore:
13+
- '**/*.md'
1514

1615
jobs:
1716
build-ios:

BUILDING.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This guide explains how to build Codename One from source using Maven. It provid
44

55
## Prerequisites
66

7+
- **JDK 8**
78
- **JDK 11**
89
- **JDK 17** for building the Android port
910
- **Apache Maven 3.6+**
@@ -16,10 +17,10 @@ The helper scripts in the `scripts/` directory download these dependencies when
1617
Download binaries from [Adoptium](https://adoptium.net):
1718

1819
```bash
19-
# JDK 11 (Linux x64; adjust `_x64_linux_` for your platform)
20-
curl -L -o temurin11.tar.gz https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.28%2B6/OpenJDK11U-jdk_x64_linux_hotspot_11.0.28_6.tar.gz
21-
tar xf temurin11.tar.gz
22-
export JAVA_HOME=$PWD/jdk-11.0.28+6
20+
# JDK 8 (Linux x64; adjust `_x64_linux_` for your platform)
21+
curl -L -o temurin8.tar.gz https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u462-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u462b08.tar.gz
22+
tar xf temurin8.tar.gz
23+
export JAVA_HOME=$PWD/jdk-8.0.28+6
2324

2425
# JDK 17 (Linux x64; adjust `_x64_linux_` for your platform)
2526
curl -L -o temurin17.tar.gz https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.16%2B8/OpenJDK17U-jdk_x64_linux_hotspot_17.0.16_8.tar.gz
@@ -31,7 +32,7 @@ export PATH="$JAVA_HOME/bin:$PATH"
3132

3233
## Preparing the workspace
3334

34-
Clone the repository and run the setup script to download JDK 11 and JDK 17, install Maven, build the core modules, and install the Maven archetypes. This step must be performed before building any ports.
35+
Clone the repository and run the setup script to download JDK 8 and JDK 17, install Maven, build the core modules, and install the Maven archetypes. This step must be performed before building any ports.
3536

3637
```bash
3738
git clone https://github.com/codenameone/CodenameOne
@@ -44,7 +45,7 @@ The script runs `mvn install` in `maven/`, installs `cn1-maven-archetypes`, and
4445

4546
## Building the Android port
4647

47-
The Android port uses JDK 17 for compilation while Maven runs with JDK 11. Javadoc generation is skipped to avoid known Maven report issues. Run the build script:
48+
The Android port uses JDK 17 for compilation while Maven runs with JDK 8. Javadoc generation is skipped to avoid known Maven report issues. Run the build script:
4849

4950
```bash
5051
./scripts/build-android-port.sh -DskipTests
@@ -54,6 +55,8 @@ Artifacts are placed in `maven/android/target`.
5455

5556
## Building the iOS port
5657

58+
JDK 8 isn't commonly available for Mac OS ARM machines. As a workaround we use the x86 version of the JDK.
59+
5760
The iOS port can only be built on macOS with Xcode installed. Run the iOS script:
5861

5962
```bash
Lines changed: 99 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,99 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3-
<parent>
4-
<artifactId>codenameone</artifactId>
5-
<groupId>com.codenameone</groupId>
6-
<version>8.0-SNAPSHOT</version>
7-
</parent>
8-
<modelVersion>4.0.0</modelVersion>
9-
<artifactId>sqlite-jdbc</artifactId>
10-
<version>8.0-SNAPSHOT</version>
11-
<build>
12-
<plugins>
13-
<plugin>
14-
<artifactId>maven-source-plugin</artifactId>
15-
<version>3.2.1</version>
16-
<executions>
17-
<execution>
18-
<goals>
19-
<goal>jar</goal>
20-
</goals>
21-
</execution>
22-
</executions>
23-
</plugin>
24-
<plugin>
25-
<artifactId>maven-shade-plugin</artifactId>
26-
<version>3.3.0</version>
27-
<executions>
28-
<execution>
29-
<phase>package</phase>
30-
<goals>
31-
<goal>shade</goal>
32-
</goals>
33-
<configuration>
34-
<relocations>
35-
<relocation>
36-
<pattern>org.slf4j</pattern>
37-
<shadedPattern>com.codename1.compat.sqlite.slf4j</shadedPattern>
38-
</relocation>
39-
</relocations>
40-
</configuration>
41-
</execution>
42-
</executions>
43-
</plugin>
44-
<plugin>
45-
<artifactId>maven-dependency-plugin</artifactId>
46-
<version>3.1.2</version>
47-
<executions>
48-
<execution>
49-
<id>copy-javadoc</id>
50-
<phase>package</phase>
51-
<goals>
52-
<goal>copy</goal>
53-
</goals>
54-
<configuration>
55-
<artifactItems>
56-
<artifactItem>
57-
<groupId>org.xerial</groupId>
58-
<artifactId>sqlite-jdbc</artifactId>
59-
<version>${sqlite.jdbc.version}</version>
60-
<classifier>javadoc</classifier>
61-
<destFileName>sqlite-jdbc-javadoc.jar</destFileName>
62-
</artifactItem>
63-
</artifactItems>
64-
<outputDirectory>${project.build.directory}</outputDirectory>
65-
</configuration>
66-
</execution>
67-
</executions>
68-
</plugin>
69-
<plugin>
70-
<artifactId>maven-jar-plugin</artifactId>
71-
<version>3.2.0</version>
72-
<executions>
73-
<execution>
74-
<id>attach-javadoc</id>
75-
<phase>package</phase>
76-
<goals>
77-
<goal>jar</goal>
78-
</goals>
79-
<configuration>
80-
<classifier>javadoc</classifier>
81-
<archive>
82-
<manifest>
83-
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
84-
</manifest>
85-
</archive>
86-
<includes>
87-
<include>sqlite-jdbc-javadoc.jar</include>
88-
</includes>
89-
</configuration>
90-
</execution>
91-
</executions>
92-
</plugin>
93-
</plugins>
94-
</build>
95-
<properties>
96-
<sqlite.jdbc.version>3.46.1.0</sqlite.jdbc.version>
97-
</properties>
98-
</project>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<parent>
4+
<artifactId>codenameone</artifactId>
5+
<groupId>com.codenameone</groupId>
6+
<version>8.0-SNAPSHOT</version>
7+
</parent>
8+
<modelVersion>4.0.0</modelVersion>
9+
<artifactId>sqlite-jdbc</artifactId>
10+
<name>sqlite-jdbc</name>
11+
<version>8.0-SNAPSHOT</version>
12+
<build>
13+
<plugins>
14+
<plugin>
15+
<artifactId>maven-source-plugin</artifactId>
16+
<version>3.2.1</version>
17+
<executions>
18+
<execution>
19+
<goals>
20+
<goal>jar</goal>
21+
</goals>
22+
</execution>
23+
</executions>
24+
</plugin>
25+
<plugin>
26+
<artifactId>maven-shade-plugin</artifactId>
27+
<version>3.3.0</version>
28+
<executions>
29+
<execution>
30+
<phase>package</phase>
31+
<goals>
32+
<goal>shade</goal>
33+
</goals>
34+
<configuration>
35+
<relocations>
36+
<relocation>
37+
<pattern>org.slf4j</pattern>
38+
<shadedPattern>com.codename1.compat.sqlite.slf4j</shadedPattern>
39+
</relocation>
40+
</relocations>
41+
</configuration>
42+
</execution>
43+
</executions>
44+
</plugin>
45+
<plugin>
46+
<artifactId>maven-dependency-plugin</artifactId>
47+
<version>3.1.2</version>
48+
<executions>
49+
<execution>
50+
<id>copy-javadoc</id>
51+
<phase>package</phase>
52+
<goals>
53+
<goal>copy</goal>
54+
</goals>
55+
<configuration>
56+
<artifactItems>
57+
<artifactItem>
58+
<groupId>org.xerial</groupId>
59+
<artifactId>sqlite-jdbc</artifactId>
60+
<version>${sqlite.jdbc.version}</version>
61+
<classifier>javadoc</classifier>
62+
<destFileName>sqlite-jdbc-javadoc.jar</destFileName>
63+
</artifactItem>
64+
</artifactItems>
65+
<outputDirectory>${project.build.directory}</outputDirectory>
66+
</configuration>
67+
</execution>
68+
</executions>
69+
</plugin>
70+
<plugin>
71+
<artifactId>maven-jar-plugin</artifactId>
72+
<version>3.2.0</version>
73+
<executions>
74+
<execution>
75+
<id>attach-javadoc</id>
76+
<phase>package</phase>
77+
<goals>
78+
<goal>jar</goal>
79+
</goals>
80+
<configuration>
81+
<classifier>javadoc</classifier>
82+
<archive>
83+
<manifest>
84+
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
85+
</manifest>
86+
</archive>
87+
<includes>
88+
<include>sqlite-jdbc-javadoc.jar</include>
89+
</includes>
90+
</configuration>
91+
</execution>
92+
</executions>
93+
</plugin>
94+
</plugins>
95+
</build>
96+
<properties>
97+
<sqlite.jdbc.version>3.46.1.0</sqlite.jdbc.version>
98+
</properties>
99+
</project>

scripts/build-android-port.sh

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
#!/usr/bin/env bash
22
# Build Codename One Android port using JDK 11 for Maven and JDK 17 for compilation
33
set -euo pipefail
4-
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
5-
cd "$ROOT"
4+
DOWNLOAD_DIR="${TMPDIR:-/tmp}/codenameone-tools"
5+
ENV_DIR="$DOWNLOAD_DIR/tools"
66

7-
if [ -f "$ROOT/tools/env.sh" ]; then
8-
source "$ROOT/tools/env.sh"
7+
if [ -f "$ENV_DIR/env.sh" ]; then
8+
source "$ENV_DIR/env.sh"
99
else
1010
./scripts/setup-workspace.sh -q -DskipTests
11-
source "$ROOT/tools/env.sh"
11+
source "$ENV_DIR/env.sh"
1212
fi
1313

14-
if ! "${JAVA_HOME:-}/bin/java" -version 2>&1 | grep -q '11\.0'; then
15-
./scripts/setup-workspace.sh -q -DskipTests
16-
source "$ROOT/tools/env.sh"
17-
fi
1814
if ! "${JAVA_HOME:-}/bin/java" -version 2>&1 | grep -q '11\.0'; then
1915
echo "Failed to provision JDK 11" >&2
2016
exit 1

scripts/setup-workspace.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ log() {
99
echo "[setup-workspace] $1"
1010
}
1111

12-
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
13-
ENV_DIR="$ROOT/tools"
14-
mkdir -p "$ENV_DIR"
15-
1612
# Place downloaded tools outside the repository so it isn't filled with binaries
1713
DOWNLOAD_DIR="${TMPDIR:-/tmp}/codenameone-tools"
1814
mkdir -p "$DOWNLOAD_DIR"
15+
ENV_DIR="$DOWNLOAD_DIR/tools"
16+
mkdir -p "$ENV_DIR"
1917

2018
JAVA_HOME="${JAVA_HOME:-}"
2119
JAVA_HOME_17="${JAVA_HOME_17:-}"

0 commit comments

Comments
 (0)