forked from firka/firka
Jenkinsfile: transform apk on f-droid builds
This commit is contained in:
30
Jenkinsfile
vendored
30
Jenkinsfile
vendored
@@ -47,6 +47,31 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Modify firka_bundle.dart') {
|
||||
when {
|
||||
branch 'main'
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
sh '''#!/bin/sh
|
||||
set -e
|
||||
|
||||
BUNDLE_FILE="firka/lib/helpers/firka_bundle.dart"
|
||||
|
||||
if [ -f "$BUNDLE_FILE" ]; then
|
||||
echo "Modifying $BUNDLE_FILE"
|
||||
sed -i 's/final bool _compressedBundle = false;/final bool _compressedBundle = Platform.isAndroid;/' "$BUNDLE_FILE"
|
||||
echo "Modified _compressedBundle setting"
|
||||
|
||||
grep "_compressedBundle" "$BUNDLE_FILE" || echo "Warning: _compressedBundle line not found after modification"
|
||||
else
|
||||
echo "$BUNDLE_FILE not found"
|
||||
exit 1
|
||||
fi
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build firka') {
|
||||
steps {
|
||||
sh 'bash -c "./tools/linux/build_apk.sh ' + env.BRANCH_NAME + '"'
|
||||
@@ -202,10 +227,11 @@ pipeline {
|
||||
rm firka/build/app/outputs/flutter-apk/app.firka.naplo_*.apk || true
|
||||
rm firka/build/app/outputs/flutter-apk/app-debug.apk || true
|
||||
rm version_code.txt || true
|
||||
git checkout -- firka/pubspec.yaml
|
||||
git checkout -- firka/pubspec.yaml || true
|
||||
git checkout -- firka/lib/helpers/firka_bundle.dart || true
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ if [ "$1" = "main" ]; then
|
||||
mkdir -p build/app/tmp
|
||||
|
||||
update_version_for_abi 1000
|
||||
flutter build apk --release --tree-shake-icons \
|
||||
TRANSFORM_APK=true flutter build apk --release --tree-shake-icons \
|
||||
--local-engine-src-path "$sdk_path/engine/src" \
|
||||
--local-engine=android_release --local-engine-host=host_release \
|
||||
--split-per-abi \
|
||||
@@ -32,7 +32,7 @@ if [ "$1" = "main" ]; then
|
||||
mv build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk build/app/tmp/
|
||||
|
||||
update_version_for_abi 2000
|
||||
flutter build apk --release --tree-shake-icons \
|
||||
TRANSFORM_APK=true flutter build apk --release --tree-shake-icons \
|
||||
--local-engine-src-path "$sdk_path/engine/src" \
|
||||
--local-engine=android_release_arm64 --local-engine-host=host_release \
|
||||
--split-per-abi \
|
||||
@@ -40,7 +40,7 @@ if [ "$1" = "main" ]; then
|
||||
mv build/app/outputs/flutter-apk/app-arm64-v8a-release.apk build/app/tmp/
|
||||
|
||||
update_version_for_abi 3000
|
||||
flutter build apk --release --tree-shake-icons \
|
||||
TRANSFORM_APK=true flutter build apk --release --tree-shake-icons \
|
||||
--local-engine-src-path "$sdk_path/engine/src" \
|
||||
--local-engine=android_release_x64 --local-engine-host=host_release \
|
||||
--split-per-abi \
|
||||
@@ -57,4 +57,4 @@ if [ "$1" = "main" ]; then
|
||||
else
|
||||
update_version_for_abi 0
|
||||
TRANSFORM_APK=true flutter build apk --debug --target-platform android-arm,android-arm64,android-x64
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user