Skip to content

Commit 54ede04

Browse files
committed
Fixed CI issues
1 parent 9fa6f83 commit 54ede04

6 files changed

Lines changed: 85 additions & 31 deletions

File tree

.github/workflows/ios-packaging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
9292
- name: Setup workspace
9393
run: ./scripts/setup-workspace.sh -q -DskipTests
94-
timeout-minutes: 25
94+
timeout-minutes: 40
9595

9696
- name: Build iOS port
9797
run: ./scripts/build-ios-port.sh -q -DskipTests

.github/workflows/scripts-ios.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ jobs:
127127
- name: Setup workspace
128128
run: ./scripts/setup-workspace.sh -q -DskipTests
129129
# per-step timeout
130-
timeout-minutes: 25
130+
timeout-minutes: 40
131131

132132
- name: Build iOS port
133133
run: ./scripts/build-ios-port.sh -q -DskipTests

maven/codenameone-maven-plugin/src/main/java/com/codename1/builders/IPhoneBuilder.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,9 +1634,11 @@ public void usesClassMethod(String cls, String method) {
16341634
// that the change will work for all builds. I made it "only" for the cocoapods version
16351635
// to prevent inadvertent breaking of versioned builds etc...
16361636
if (runPods) {
1637-
replaceAllInFile(pbx, "ARCHS = [^;]+;", "ARCHS = \"\\$(ARCHS_STANDARD_INCLUDING_64_BIT)\";");
1637+
replaceAllInFile(pbx, "ARCHS = [^;]+;", "ARCHS = \"\\$(ARCHS_STANDARD)\";");
1638+
replaceAllInFile(pbx, "VALID_ARCHS = [^;]+;", "VALID_ARCHS = \"\\$(ARCHS_STANDARD)\";");
16381639
} else {
1639-
replaceInFile(pbx, "ARCHS = armv7;", "ARCHS = \"armv7 arm64\";");
1640+
replaceInFile(pbx, "ARCHS = armv7;", "ARCHS = \"\\$(ARCHS_STANDARD)\";");
1641+
replaceAllInFile(pbx, "VALID_ARCHS = [^;]+;", "VALID_ARCHS = \"\\$(ARCHS_STANDARD)\";");
16401642
}
16411643
}
16421644

scripts/build-ios-app.sh

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,22 @@ bia_log "Running HelloCodenameOne Maven build with JAVA_HOME=$JAVA17_HOME"
9696
export JAVA_HOME="$JAVA17_HOME"
9797
export PATH="$JAVA_HOME/bin:$MAVEN_HOME/bin:$BASE_PATH"
9898
MVN_IOS_LOG="$ARTIFACTS_DIR/hellocn1-ios-build.log"
99+
MVN_CMD=(
100+
./mvnw package
101+
-DskipTests
102+
-Dcodename1.platform=ios
103+
-Dcodename1.buildTarget=ios-source
104+
-Dmaven.compiler.fork=true
105+
-Dmaven.compiler.executable="$JAVA17_HOME/bin/javac"
106+
-Dcodename1.arg.ios.uiscene="${IOS_UISCENE}"
107+
-Dopen=false
108+
)
109+
if [ ${#EXTRA_IOS_ARGS[@]} -gt 0 ]; then
110+
MVN_CMD+=("${EXTRA_IOS_ARGS[@]}")
111+
fi
112+
MVN_CMD+=(-U -e -X)
99113
set +e
100-
./mvnw package \
101-
-DskipTests \
102-
-Dcodename1.platform=ios \
103-
-Dcodename1.buildTarget=ios-source \
104-
-Dmaven.compiler.fork=true \
105-
-Dmaven.compiler.executable="$JAVA17_HOME/bin/javac" \
106-
-Dcodename1.arg.ios.uiscene="${IOS_UISCENE}" \
107-
-Dopen=false \
108-
"${EXTRA_IOS_ARGS[@]}" \
109-
-U -e -X > "$MVN_IOS_LOG" 2>&1
114+
"${MVN_CMD[@]}" > "$MVN_IOS_LOG" 2>&1
110115
RC=$?
111116
set -e
112117
if [ $RC -ne 0 ]; then
@@ -178,6 +183,24 @@ else
178183
bia_log "Podfile not found in generated project; skipping pod install"
179184
fi
180185

186+
WORKSPACE_XML='<?xml version="1.0" encoding="UTF-8"?>
187+
<Workspace
188+
version = "1.0">
189+
<FileRef
190+
location = "group:HelloCodenameOne.xcodeproj">
191+
</FileRef>
192+
</Workspace>'
193+
if [ ! -d "$PROJECT_DIR/HelloCodenameOne.xcworkspace" ] && [ -d "$PROJECT_DIR/HelloCodenameOne.xcodeproj" ]; then
194+
bia_log "Creating fallback xcworkspace for generated Xcode project"
195+
mkdir -p "$PROJECT_DIR/HelloCodenameOne.xcworkspace"
196+
printf '%s\n' "$WORKSPACE_XML" > "$PROJECT_DIR/HelloCodenameOne.xcworkspace/contents.xcworkspacedata"
197+
fi
198+
199+
if [ -d "$PROJECT_DIR/HelloCodenameOne.xcodeproj" ]; then
200+
bia_log "Ensuring shared Xcode scheme exists"
201+
"$REPO_ROOT/scripts/ios/create-shared-scheme.py" "$PROJECT_DIR" HelloCodenameOne
202+
fi
203+
181204
# Locate workspace or project for the next step
182205
WORKSPACE=""
183206
for candidate in "$PROJECT_DIR"/*.xcworkspace; do

scripts/run-ios-ui-tests.sh

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ fallback_sim_destination() {
370370

371371

372372
SIM_DESTINATION="${IOS_SIM_DESTINATION:-}"
373+
USE_GENERIC_BUILD_DESTINATION="false"
373374
if [ -z "$SIM_DESTINATION" ]; then
374375
SELECTED_DESTINATION="$(auto_select_destination || true)"
375376
if [ -n "${SELECTED_DESTINATION:-}" ]; then
@@ -400,14 +401,20 @@ if [ -z "$SIM_DESTINATION" ]; then
400401
FALLBACK_DESTINATION="$(fallback_sim_destination || true)"
401402
if [ -n "${FALLBACK_DESTINATION:-}" ]; then
402403
SIM_DESTINATION="$FALLBACK_DESTINATION"
404+
USE_GENERIC_BUILD_DESTINATION="true"
403405
ri_log "Using fallback simulator destination '$SIM_DESTINATION'"
404406
else
405407
SIM_DESTINATION="platform=iOS Simulator,name=iPhone 16"
408+
USE_GENERIC_BUILD_DESTINATION="true"
406409
ri_log "Falling back to default simulator destination '$SIM_DESTINATION'"
407410
fi
408411
fi
409412

410413
SIM_DESTINATION="$(normalize_destination "$SIM_DESTINATION")"
414+
BUILD_DESTINATION="$SIM_DESTINATION"
415+
if [ "$USE_GENERIC_BUILD_DESTINATION" = "true" ]; then
416+
BUILD_DESTINATION="generic/platform=iOS Simulator"
417+
fi
411418

412419
# Extract UDID and prefer id-only destination to avoid OS/SDK mismatches
413420
SIM_UDID="$(printf '%s\n' "$SIM_DESTINATION" | sed -n 's/.*id=\([^,]*\).*/\1/p' | tr -d '\r[:space:]')"
@@ -420,23 +427,45 @@ if [ -n "$SIM_UDID" ]; then
420427
echo "Simulator Boot : $(( (BOOT_END - BOOT_START) * 1000 )) ms" >> "$ARTIFACTS_DIR/ios-test-stats.txt"
421428
SIM_DESTINATION="id=$SIM_UDID"
422429
fi
430+
if [ "$USE_GENERIC_BUILD_DESTINATION" = "true" ]; then
431+
ri_log "Building with generic simulator destination '$BUILD_DESTINATION' and running on '$SIM_DESTINATION'"
432+
else
433+
BUILD_DESTINATION="$SIM_DESTINATION"
434+
fi
423435
ri_log "Running DeviceRunner on destination '$SIM_DESTINATION'"
424436

437+
HOST_ARCH="$(uname -m 2>/dev/null || echo arm64)"
438+
case "$HOST_ARCH" in
439+
arm64|x86_64) BUILD_ARCH="$HOST_ARCH" ;;
440+
*) BUILD_ARCH="arm64" ;;
441+
esac
442+
425443
DERIVED_DATA_DIR="$SCREENSHOT_TMP_DIR/derived"
426444
rm -rf "$DERIVED_DATA_DIR"
427445
BUILD_LOG="$ARTIFACTS_DIR/xcodebuild-build.log"
428446

429447
ri_log "Building simulator app with xcodebuild"
430448
COMPILE_START=$(date +%s)
431-
if ! xcodebuild \
432-
"$XCODE_CONTAINER_FLAG" "$WORKSPACE_PATH" \
433-
-scheme "$SCHEME" \
434-
-sdk iphonesimulator \
435-
-configuration Debug \
436-
-destination "$SIM_DESTINATION" \
437-
-destination-timeout 120 \
438-
-derivedDataPath "$DERIVED_DATA_DIR" \
439-
build | tee "$BUILD_LOG"; then
449+
XCODE_BUILD_CMD=(
450+
xcodebuild
451+
"$XCODE_CONTAINER_FLAG" "$WORKSPACE_PATH"
452+
-scheme "$SCHEME"
453+
-sdk iphonesimulator
454+
-configuration Debug
455+
-destination "$BUILD_DESTINATION"
456+
-destination-timeout 120
457+
-derivedDataPath "$DERIVED_DATA_DIR"
458+
)
459+
if [ "$USE_GENERIC_BUILD_DESTINATION" = "true" ]; then
460+
ri_log "Forcing simulator ARCHS=$BUILD_ARCH for generic build destination"
461+
XCODE_BUILD_CMD+=(
462+
"ARCHS=$BUILD_ARCH"
463+
"ONLY_ACTIVE_ARCH=YES"
464+
"EXCLUDED_ARCHS=armv7 armv7s"
465+
)
466+
fi
467+
XCODE_BUILD_CMD+=(build)
468+
if ! "${XCODE_BUILD_CMD[@]}" | tee "$BUILD_LOG"; then
440469
ri_log "STAGE:XCODE_BUILD_FAILED -> See $BUILD_LOG"
441470
exit 10
442471
fi

vm/ByteCodeTranslator/src/template/template.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@
270270
isa = XCBuildConfiguration;
271271
buildSettings = {
272272
ALWAYS_SEARCH_USER_PATHS = NO;
273-
ARCHS = armv7;
273+
ARCHS = "$(ARCHS_STANDARD)";
274274
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
275275
CLANG_CXX_LIBRARY = "libc++";
276276
CLANG_ENABLE_MODULES = NO;
@@ -304,7 +304,7 @@
304304
ONLY_ACTIVE_ARCH = YES;
305305
SDKROOT = iphoneos;
306306
TARGETED_DEVICE_FAMILY = "1,2";
307-
VALID_ARCHS = "armv7 arm64";
307+
VALID_ARCHS = "$(ARCHS_STANDARD)";
308308
LIBRARY_SEARCH_PATHS = (
309309
"$(inherited)",
310310
"$(PROJECT_DIR)/template-src",
@@ -316,7 +316,7 @@
316316
isa = XCBuildConfiguration;
317317
buildSettings = {
318318
ALWAYS_SEARCH_USER_PATHS = NO;
319-
ARCHS = armv7;
319+
ARCHS = "$(ARCHS_STANDARD)";
320320
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
321321
CLANG_CXX_LIBRARY = "libc++";
322322
CLANG_ENABLE_MODULES = NO;
@@ -345,7 +345,7 @@
345345
SDKROOT = iphoneos;
346346
TARGETED_DEVICE_FAMILY = "1,2";
347347
VALIDATE_PRODUCT = YES;
348-
VALID_ARCHS = "armv7 arm64";
348+
VALID_ARCHS = "$(ARCHS_STANDARD)";
349349
LIBRARY_SEARCH_PATHS = (
350350
"$(inherited)",
351351
"$(PROJECT_DIR)/template-src",
@@ -362,7 +362,7 @@
362362
GCC_PREFIX_HEADER = "template-src/template-Prefix.pch";
363363
INFOPLIST_FILE = "template-src/template-Info.plist";
364364
PRODUCT_NAME = "$(TARGET_NAME)";
365-
VALID_ARCHS = "armv7 arm64";
365+
VALID_ARCHS = "$(ARCHS_STANDARD)";
366366
WRAPPER_EXTENSION = app;
367367
};
368368
name = Debug;
@@ -377,15 +377,15 @@
377377
GCC_PREFIX_HEADER = "template-src/template-Prefix.pch";
378378
INFOPLIST_FILE = "template-src/template-Info.plist";
379379
PRODUCT_NAME = "$(TARGET_NAME)";
380-
VALID_ARCHS = "armv7 arm64";
380+
VALID_ARCHS = "$(ARCHS_STANDARD)";
381381
WRAPPER_EXTENSION = app;
382382
};
383383
name = Release;
384384
};
385385
0F634EB618E9ABBC002F3D1D /* Debug */ = {
386386
isa = XCBuildConfiguration;
387387
buildSettings = {
388-
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
388+
ARCHS = "$(ARCHS_STANDARD)";
389389
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/template.app/template-src";
390390
FRAMEWORK_SEARCH_PATHS = (
391391
"$(SDKROOT)/Developer/Library/Frameworks",
@@ -408,7 +408,7 @@
408408
0F634EB718E9ABBC002F3D1D /* Release */ = {
409409
isa = XCBuildConfiguration;
410410
buildSettings = {
411-
ARCHS = armv7;
411+
ARCHS = "$(ARCHS_STANDARD)";
412412
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/template.app/template-src";
413413
FRAMEWORK_SEARCH_PATHS = (
414414
"$(SDKROOT)/Developer/Library/Frameworks",

0 commit comments

Comments
 (0)