Skip to content

Commit 85b4ea0

Browse files
committed
Allow skipping CEF dependency on Linux ARM
1 parent 220c5a6 commit 85b4ea0

File tree

4 files changed

+81
-8
lines changed

4 files changed

+81
-8
lines changed

maven/codenameone-maven-plugin/pom.xml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2121
<maven.compiler.source>1.7</maven.compiler.source>
2222
<maven.compiler.target>1.7</maven.compiler.target>
23+
<!--
24+
Codename One embeds Chromium via the codenameone-cef artifact which is
25+
only published for x86/x64 targets. Linux ARM runners cannot resolve
26+
this dependency, so allow scripts to disable it with
27+
-Dinclude.cef=false.
28+
-->
29+
<include.cef>true</include.cef>
2330
</properties>
2431

2532
<profiles>
@@ -31,6 +38,23 @@
3138
</file>
3239
</activation>
3340
</profile>
41+
<profile>
42+
<id>include-cef</id>
43+
<activation>
44+
<property>
45+
<name>include.cef</name>
46+
<value>true</value>
47+
</property>
48+
</activation>
49+
<dependencies>
50+
<dependency>
51+
<groupId>com.codenameone</groupId>
52+
<artifactId>codenameone-cef</artifactId>
53+
<version>84.4.1-M3</version>
54+
<type>pom</type>
55+
</dependency>
56+
</dependencies>
57+
</profile>
3458
</profiles>
3559

3660
<dependencies>
@@ -116,14 +140,6 @@
116140
<artifactId>proguard-base</artifactId>
117141
</dependency>
118142

119-
<dependency>
120-
<groupId>com.codenameone</groupId>
121-
<artifactId>codenameone-cef</artifactId>
122-
<version>84.4.1-M3</version>
123-
<type>pom</type>
124-
</dependency>
125-
126-
127143
<dependency>
128144
<groupId>org.junit.jupiter</groupId>
129145
<artifactId>junit-jupiter-api</artifactId>

scripts/build-android-app.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,27 @@ DOWNLOAD_DIR="${TMPDIR%/}/codenameone-tools"
1313
ENV_DIR="$DOWNLOAD_DIR/tools"
1414
EXTRA_MVN_ARGS=("$@")
1515

16+
HOST_OS="$(uname -s)"
17+
HOST_ARCH="$(uname -m)"
18+
if [ "$HOST_OS" = "Linux" ]; then
19+
case "$HOST_ARCH" in
20+
arm64|aarch64)
21+
include_cef_arg_present=0
22+
for arg in "${EXTRA_MVN_ARGS[@]}"; do
23+
case "$arg" in
24+
-Dinclude.cef=*) include_cef_arg_present=1; break ;;
25+
esac
26+
done
27+
if [ "$include_cef_arg_present" -eq 0 ]; then
28+
ba_log "Linux ARM host detected; disabling codenameone-cef dependency"
29+
EXTRA_MVN_ARGS+=("-Dinclude.cef=false")
30+
else
31+
ba_log "Linux ARM host detected; using custom include.cef flag"
32+
fi
33+
;;
34+
esac
35+
fi
36+
1637
ENV_FILE="$ENV_DIR/env.sh"
1738
ba_log "Loading workspace environment from $ENV_FILE"
1839
if [ -f "$ENV_FILE" ]; then

scripts/build-android-port.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,27 @@ log "The DOWNLOAD_DIR is ${DOWNLOAD_DIR}"
1818
ENV_DIR="$DOWNLOAD_DIR/tools"
1919
ENV_FILE="$ENV_DIR/env.sh"
2020

21+
host_os="$(uname -s)"
22+
host_arch="$(uname -m)"
23+
if [ "$host_os" = "Linux" ]; then
24+
case "$host_arch" in
25+
arm64|aarch64)
26+
include_cef_arg_present=0
27+
for arg in "$@"; do
28+
case "$arg" in
29+
-Dinclude.cef=*) include_cef_arg_present=1; break ;;
30+
esac
31+
done
32+
if [ "$include_cef_arg_present" -eq 0 ]; then
33+
log "Linux ARM host detected; disabling codenameone-cef dependency"
34+
set -- "$@" "-Dinclude.cef=false"
35+
else
36+
log "Linux ARM host detected; using custom include.cef flag"
37+
fi
38+
;;
39+
esac
40+
fi
41+
2142
load_environment() {
2243
if [ ! -f "$ENV_FILE" ]; then
2344
return 1

scripts/setup-workspace.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,21 @@ case "$arch_name" in
6060
*) echo "Unsupported architecture: $arch_name" >&2; exit 1 ;;
6161
esac
6262

63+
if [ "$os" = "linux" ] && [ "$arch" = "aarch64" ]; then
64+
include_cef_arg_present=0
65+
for arg in "$@"; do
66+
case "$arg" in
67+
-Dinclude.cef=*) include_cef_arg_present=1; break ;;
68+
esac
69+
done
70+
if [ "$include_cef_arg_present" -eq 0 ]; then
71+
log "Linux ARM host detected; disabling codenameone-cef dependency"
72+
set -- "$@" "-Dinclude.cef=false"
73+
else
74+
log "Linux ARM host detected; using custom include.cef flag"
75+
fi
76+
fi
77+
6378
# Determine platform-specific JDK download URLs
6479
arch_jdk8="$arch"
6580
if [ "$os" = "mac" ] && [ "$arch" = "aarch64" ]; then

0 commit comments

Comments
 (0)