Skip to content

Commit

Permalink
Merge pull request #48919 from Expensify/Rory-FixAndroidBuildStep
Browse files Browse the repository at this point in the history
[No QA] Correctly bundle aab and set path
  • Loading branch information
luacmartins authored Sep 10, 2024
2 parents 0a20136 + fd1068a commit 72ace7a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
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

0 comments on commit 72ace7a

Please sign in to comment.