Skip to content

Commit 85a0173

Browse files
committed
Disable CSS generation in Android sample build
1 parent 2b938b7 commit 85a0173

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

scripts/build-android-app.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,27 @@ public class ${MAIN_NAME} {
146146
}
147147
HELLOEOF
148148

149+
SETTINGS_FILE="$APP_DIR/common/codenameone_settings.properties"
150+
log "Disabling Codename One CSS compilation for headless build environment"
151+
if [ -f "$SETTINGS_FILE" ]; then
152+
if grep -q '^codename1.cssTheme=' "$SETTINGS_FILE"; then
153+
python3 - "$SETTINGS_FILE" <<'PY'
154+
import pathlib
155+
import re
156+
import sys
157+
158+
path = pathlib.Path(sys.argv[1])
159+
text = path.read_text()
160+
text = re.sub(r'^codename1\.cssTheme=.*$', 'codename1.cssTheme=false', text, flags=re.MULTILINE)
161+
path.write_text(text if text.endswith('\n') else text + '\n')
162+
PY
163+
else
164+
printf '\ncodename1.cssTheme=false\n' >> "$SETTINGS_FILE"
165+
fi
166+
else
167+
printf 'codename1.cssTheme=false\n' > "$SETTINGS_FILE"
168+
fi
169+
149170
log "Building Android gradle project using Codename One port"
150171
"$MAVEN_HOME/bin/mvn" -q -f "$APP_DIR/pom.xml" package -DskipTests -Dcodename1.platform=android -Dcodename1.buildTarget=android-source -Dopen=false "$@"
151172

0 commit comments

Comments
 (0)