Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[No QA] Correctly bundle aab and set path #48919

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ skip_docs
opt_out_usage

KEY_GRADLE_APK_PATH = "gradleAPKOutputPath"
KEY_GRADLE_AAB_PATH = "gradleAABOutputPath"
KEY_IPA_PATH = "ipaPath"
KEY_DSYM_PATH = "dsymPath"

Expand Down Expand Up @@ -44,9 +45,13 @@ end

def setGradleOutputsInEnv()
puts "Saving Android build outputs in env..."
exportEnvVars({
env_vars = {
KEY_GRADLE_APK_PATH => lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH],
})
}
if (lane_context.key?(SharedValues::GRADLE_AAB_OUTPUT_PATH)) {
env_vars[KEY_GRADLE_AAB_PATH] = lane_context[SharedValues::GRADLE_AAB_OUTPUT_PATH]
}
exportEnvVars(env_vars)
end

def setIOSBuildOutputsInEnv()
Expand All @@ -58,8 +63,20 @@ def setIOSBuildOutputsInEnv()
end

platform :android do
desc "Generate a new local APK"
desc "Generate a production AAB"
lane :build do
ENV["ENVFILE"]=".env.production"
gradle(
project_dir: './android',
task: 'bundle',
flavor: 'Production',
build_type: 'Release',
)
setGradleOutputsInEnv()
end

desc "Generate a new local APK"
lane :build_local do
ENV["ENVFILE"]=".env.production"
gradle(
project_dir: './android',
Expand Down Expand Up @@ -132,7 +149,7 @@ platform :android do
upload_to_play_store(
package_name: "com.expensify.chat",
json_key: './android/app/android-fastlane-json-key.json',
aab: './android/app/build/outputs/bundle/productionRelease/app-production-release.aab',
aab: ENV[KEY_GRADLE_AAB_PATH],
track: 'internal',
rollout: '1.0'
)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"detectRedirectCycle": "ts-node .github/scripts/detectRedirectCycle.ts",
"desktop-build-adhoc": "scripts/build-desktop.sh adhoc",
"ios-build": "fastlane ios build_unsigned",
"android-build": "fastlane android build",
"android-build": "fastlane android build_local",
"android-build-e2e": "bundle exec fastlane android build_e2e",
"android-build-e2edelta": "bundle exec fastlane android build_e2edelta",
"test": "TZ=utc NODE_OPTIONS=--experimental-vm-modules jest",
Expand Down
Loading