feat(ios): read and set Flutter build number in Fastfile for app store deployment

This commit is contained in:
mso7nueh
2025-12-17 15:52:34 +03:00
parent 2ab3bc1cf0
commit 5c9a9c22ba
39 changed files with 65 additions and 2 deletions

View File

@@ -48,8 +48,33 @@ platform :ios do
UI.message "Configuring Flutter for release mode..."
sh("cd .. && flutter build ios --config-only --release")
# Read build number from Flutter Generated.xcconfig
generated_xcconfig_path = File.join("..", "Flutter", "Generated.xcconfig")
flutter_build_number = nil
if File.exist?(generated_xcconfig_path)
File.foreach(generated_xcconfig_path) do |line|
matches = line.match(/FLUTTER_BUILD_NUMBER=(.*)/)
if matches
flutter_build_number = matches[1].strip
break
end
end
end
if flutter_build_number.nil?
UI.user_error!("Could not find FLUTTER_BUILD_NUMBER in #{generated_xcconfig_path}")
end
UI.message "Flutter build number: #{flutter_build_number}"
match(type: "appstore", readonly: true)
increment_build_number(xcodeproj: "Runner.xcodeproj")
# Set build number explicitly instead of incrementing
increment_build_number(
xcodeproj: "Runner.xcodeproj",
build_number: flutter_build_number
)
build_app(
workspace: "Runner.xcworkspace",
@@ -74,7 +99,7 @@ platform :ios do
skip_submission: true,
distribute_external: false,
notify_external_testers: false,
changelog: "TestFlight build #{get_build_number(xcodeproj: 'Runner.xcodeproj')}",
changelog: "TestFlight build #{flutter_build_number}",
verbose: true
)
rescue => ex

View File

@@ -16,3 +16,4 @@ abstract class OAuthVerificationConfirmResponse with _$OAuthVerificationConfirmR
factory OAuthVerificationConfirmResponse.fromJson(Map<String, dynamic> json) => _$OAuthVerificationConfirmResponseFromJson(json);
}

View File

@@ -10,3 +10,4 @@ abstract class OAuthVerificationRequest with _$OAuthVerificationRequest {
factory OAuthVerificationRequest.fromJson(Map<String, dynamic> json) => _$OAuthVerificationRequestFromJson(json);
}

View File

@@ -10,3 +10,4 @@ abstract class OAuthVerificationRequestResponse with _$OAuthVerificationRequestR
factory OAuthVerificationRequestResponse.fromJson(Map<String, dynamic> json) => _$OAuthVerificationRequestResponseFromJson(json);
}

View File

@@ -140,3 +140,4 @@ void main() {

View File

@@ -75,3 +75,4 @@ void main() {

View File

@@ -89,3 +89,4 @@ void main() {

View File

@@ -38,3 +38,4 @@ void main() {

View File

@@ -34,3 +34,4 @@ void main() {

View File

@@ -31,3 +31,4 @@ void main() {

View File

@@ -35,3 +35,4 @@ void main() {

View File

@@ -114,3 +114,4 @@ void main() {

View File

@@ -38,3 +38,4 @@ void main() {

View File

@@ -32,3 +32,4 @@ void main() {

View File

@@ -68,3 +68,4 @@ void main() {

View File

@@ -120,3 +120,4 @@ void main() {

View File

@@ -57,3 +57,4 @@ void main() {

View File

@@ -139,3 +139,4 @@ void main() {

View File

@@ -100,3 +100,4 @@ void main() {

View File

@@ -168,3 +168,4 @@ void main() {

View File

@@ -61,3 +61,4 @@ void main() {

View File

@@ -46,3 +46,4 @@ void main() {

View File

@@ -100,3 +100,4 @@ void main() {

View File

@@ -80,3 +80,4 @@ void main() {

View File

@@ -69,3 +69,4 @@ void main() {

View File

@@ -75,3 +75,4 @@ void main() {

View File

@@ -62,3 +62,4 @@ void main() {

View File

@@ -94,3 +94,4 @@ void main() {

View File

@@ -112,3 +112,4 @@ void main() {

View File

@@ -142,3 +142,4 @@ void main() {

View File

@@ -54,3 +54,4 @@ void main() {

View File

@@ -55,3 +55,4 @@ void main() {

View File

@@ -64,3 +64,4 @@ void main() {