You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: BUILDING.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,13 @@
1
1
# Building Codename One
2
2
3
-
This guide describes how to build Codename One and its Android and iOS ports locally using Maven. It includes reproducible steps for setting up the workspace and compiling each port.
3
+
This document provides reproducible instructions for building Codename One and its Android and iOS ports with Maven. It is written so that both developers and automated tools can follow it step by step.
4
4
5
5
## Prerequisites
6
6
7
-
-**JDK 11**for building the main project and the iOS port.
7
+
-**JDK 11**(Codename One also builds with JDK 8, but these instructions use JDK 11).
8
8
-**JDK 17** for building the Android port.
9
9
-**Apache Maven 3.6+**.
10
+
- macOS with Xcode (only for building the iOS port).
10
11
11
12
The `setup-workspace.sh` script downloads these dependencies automatically when they are not already installed.
12
13
@@ -38,13 +39,14 @@ Clone the repository and run the setup script to install Maven, download JDK 11
The script runs `mvn install` in `maven/`, installs `cn1-maven-archetypes`, and ensures `~/.codenameone/CodeNameOneBuildClient.jar` is installed by invoking the `cn1:install-codenameone` Maven goal. If that goal fails, the script copies the jar from `maven/CodeNameOneBuildClient.jar`.
45
+
The script runs `mvn install` in `maven/`, installs `cn1-maven-archetypes`, and ensures `~/.codenameone/CodeNameOneBuildClient.jar` is installed by invoking the `cn1:install-codenameone` Maven goal. If that goal fails, the script copies the jar from `maven/CodeNameOneBuildClient.jar`. After the script finishes, `tools/env.sh` contains environment variables for the provisioned JDKs and Maven.
44
46
45
47
## Building the Android port
46
48
47
-
Run the Android build script. It requires `JAVA_HOME`pointing to JDK 11 and `JAVA_HOME_17`pointing to JDK 17. If these variables are unset, the script will look for the JDKs under `tools/` as provisioned by `setup-workspace.sh`:
49
+
Run the Android build script. It sources the environment from `tools/env.sh`, ensuring `JAVA_HOME`points to JDK 11 and `JAVA_HOME_17`points to JDK 17. If the JDKs are missing, the script will run `setup-workspace.sh` to download them:
48
50
49
51
```bash
50
52
./scripts/build-android-port.sh -DskipTests
@@ -54,7 +56,7 @@ The resulting artifacts are placed in `maven/android/target`.
54
56
55
57
## Building the iOS port
56
58
57
-
The iOS port can only be built on macOS with Xcode installed. The build script expects `JAVA_HOME` to point to JDK 11 and will search `tools/` if it is not set:
59
+
The iOS port can only be built on macOS with Xcode installed. The build script sources `tools/env.sh` and ensures `JAVA_HOME` points to JDK 11, running `setup-workspace.sh` if necessary:
58
60
59
61
```bash
60
62
./scripts/build-ios-port.sh -DskipTests
@@ -66,7 +68,7 @@ The build output is in `maven/ios/target`.
66
68
67
69
The `scripts` directory contains helper scripts:
68
70
69
-
-`setup-workspace.sh` – installs Maven, downloads JDK 11 and JDK 17, builds the core modules, installs Maven archetypes, and provisions the Codename One build client.
71
+
-`setup-workspace.sh` – installs Maven, downloads JDK 11 and JDK 17, builds the core modules, installs Maven archetypes, provisions the Codename One build client, and writes `tools/env.sh`.
70
72
-`build-android-port.sh` – builds the Android port using JDK 11 for Maven and JDK 17 for compilation.
71
73
-`build-ios-port.sh` – builds the iOS port on macOS with JDK 11.
0 commit comments