Skip to content

Commit

Permalink
Changement script de build
Browse files Browse the repository at this point in the history
- Deux builds ("store" et "open") sont faites pour chaque OS
- Les noms de paquets changent en fonction de la build
  • Loading branch information
johan-perso committed Apr 17, 2024
1 parent 8992153 commit 8a45dcf
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 21 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (flutterVersionName == null) {
}

android {
namespace "fr.johanstick.stendmobile"
namespace "fr.johanstick.stendmobile.dev"
compileSdkVersion 34
ndkVersion flutter.ndkVersion

Expand All @@ -41,7 +41,7 @@ android {
}

defaultConfig {
applicationId "fr.johanstick.stendmobile"
applicationId "fr.johanstick.stendmobile.dev"
minSdkVersion 20
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package fr.johanstick.stendmobile
package fr.johanstick.stendmobile.dev

import io.flutter.embedding.android.FlutterActivity

Expand Down
48 changes: 33 additions & 15 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,47 @@

DATE=$(date +"%Y-%m-%d")

echo "================= 1/3 - Android"
# fr.johanstick.stendmobile
echo "================= 1/4 - Android (Store)"
sed -i '' 's/fr.johanstick.stendmobile.dev/fr.johanstick.stendmobile/g' android/app/build.gradle
sed -i '' 's/fr.johanstick.stendmobile.dev/fr.johanstick.stendmobile/g' android/app/src/main/kotlin/com/example/stendmobile/MainActivity.kt
flutter build apk --release --dart-define="storeRelease=true"
mv build/app/outputs/flutter-apk/app-release.apk build/
rm -f build/StendMobile-android-$DATE-store.apk
mv build/app-release.apk build/StendMobile-android-$DATE-store.apk

# fr.johanstick.stendmobile.dev
echo "================= 2/4 - Android (Open)"
sed -i '' 's/fr.johanstick.stendmobile"/fr.johanstick.stendmobile.dev"/g' android/app/build.gradle
sed -i '' '/fr\.johanstick\.stendmobile\.dev/! s/fr\.johanstick\.stendmobile/fr.johanstick.stendmobile.dev/g' android/app/src/main/kotlin/com/example/stendmobile/MainActivity.kt
flutter build apk --release
mv build/app/outputs/flutter-apk/app-release.apk build/
rm -f build/StendMobile-android-$DATE.apk
mv build/app-release.apk build/StendMobile-android-$DATE.apk
rm -f build/StendMobile-android-$DATE-open.apk
mv build/app-release.apk build/StendMobile-android-$DATE-open.apk

echo "================= 2/3 - iOS (Open)"
flutter build ios --release
# fr.johanstick.stendmobile
echo "================= 3/4 - iOS (Store)"
# sed -i '' 's/fr.johanstick.stendmobile.dev/fr.johanstick.stendmobile/g' ios/Runner.xcodeproj/project.pbxproj
flutter build ios --release --dart-define="storeRelease=true"
sh ./toipa.sh build/ios/iphoneos/Runner.app
mv build/ios/iphoneos/Runner.ipa build/
rm -f build/StendMobile-ios-open-$DATE.ipa
mv build/Runner.ipa build/StendMobile-ios-open-$DATE.ipa
rm -f build/StendMobile-ios-$DATE-store.ipa
mv build/Runner.ipa build/StendMobile-ios-$DATE-store.ipa

echo "================= 3/3 - iOS (Store)"
flutter build ios --release --dart-define="storeRelease=true"
# fr.johanstick.stendmobile.dev
echo "================= 4/4 - iOS (Open)"
sed -i '' 's/fr.johanstick.stendmobile;/fr.johanstick.stendmobile.dev;/g' ios/Runner.xcodeproj/project.pbxproj
sed -i '' 's/fr.johanstick.stendmobile.Runner/fr.johanstick.stendmobile.dev.Runner/g' ios/Runner.xcodeproj/project.pbxproj
flutter build ios --release
sh ./toipa.sh build/ios/iphoneos/Runner.app
mv build/ios/iphoneos/Runner.ipa build/
rm -f build/StendMobile-ios-store-$DATE.ipa
mv build/Runner.ipa build/StendMobile-ios-store-$DATE.ipa
rm -f build/StendMobile-ios-$DATE-open.ipa
mv build/Runner.ipa build/StendMobile-ios-$DATE-open.ipa

echo "================= Files paths:"
echo "iOS (Store): $(pwd)/build/StendMobile-ios-store-$DATE.ipa"
echo "iOS (Open): $(pwd)/build/StendMobile-ios-open-$DATE.ipa"
echo "Android: $(pwd)/build/StendMobile-android-open-$DATE.apk"
echo "Folder: $(pwd)/build"
echo "iOS (Store): $(pwd)/build/StendMobile-ios-$DATE-store.ipa"
echo "iOS (Open): $(pwd)/build/StendMobile-ios-$DATE-open.ipa"
echo "Android (Store): $(pwd)/build/StendMobile-android-$DATE-store.apk"
echo "Android (Open): $(pwd)/build/StendMobile-android-$DATE-open.apk"
echo "Folder: $(pwd)/build"
echo "================="
6 changes: 3 additions & 3 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = fr.johanstick.stendmobile.RunnerTests;
PRODUCT_BUNDLE_IDENTIFIER = fr.johanstick.stendmobile.dev.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand All @@ -514,7 +514,7 @@
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = fr.johanstick.stendmobile.RunnerTests;
PRODUCT_BUNDLE_IDENTIFIER = fr.johanstick.stendmobile.dev.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
Expand All @@ -530,7 +530,7 @@
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = fr.johanstick.stendmobile.RunnerTests;
PRODUCT_BUNDLE_IDENTIFIER = fr.johanstick.stendmobile.dev.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
Expand Down

0 comments on commit 8a45dcf

Please sign in to comment.