Skip to content

Commit 99216ae

Browse files
authored
Merge pull request #3571 from StoDevX/android-app-bundles
Enable Android "app bundles"
2 parents b371782 + dd6652b commit 99216ae

File tree

3 files changed

+25
-18
lines changed

3 files changed

+25
-18
lines changed

.circleci/config.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,6 @@ jobs:
345345
command: bundle exec fastlane android ci-run | tee ./logs/build
346346
environment:
347347
GIT_COMMIT_DESC: $(git log --format=oneline -n 1 $CIRCLE_SHA1)
348-
- store_artifacts:
349-
path: ./android/app/build/outputs/apk/release/
350348
- danger
351349

352350
android-nightly:

android/app/build.gradle

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,21 @@ android {
199199
}
200200
}
201201

202-
android {
203-
dexOptions {
204-
// Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
205-
preDexLibraries = preDexEnabled && !ciBuild
202+
bundle {
203+
language {
204+
enableSplit = true
206205
}
206+
density {
207+
enableSplit = true
208+
}
209+
abi {
210+
enableSplit = true
211+
}
212+
}
213+
214+
dexOptions {
215+
// Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
216+
preDexLibraries = preDexEnabled && !ciBuild
207217
}
208218

209219
configurations.all {

fastlane/platforms/android.rb

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
build_status = 0
99
begin
1010
propagate_version(track: options[:track])
11-
gradle(task: 'assemble',
11+
gradle(task: 'bundle',
1212
build_type: 'Release',
1313
print_command: true,
1414
print_command_output: true)
@@ -20,9 +20,9 @@
2020
end
2121

2222
UI.message 'Generated files:'
23-
UI.message lane_context[SharedValues::GRADLE_ALL_APK_OUTPUT_PATHS]
23+
UI.message lane_context[SharedValues::GRADLE_ALL_AAB_OUTPUT_PATHS]
2424

25-
output = lane_context[SharedValues::GRADLE_ALL_APK_OUTPUT_PATHS].to_json
25+
output = lane_context[SharedValues::GRADLE_ALL_AAB_OUTPUT_PATHS].to_json
2626
File.open('../logs/products', 'w') { |file| file.write(output) }
2727
end
2828

@@ -38,13 +38,12 @@
3838
matchesque
3939
build(track: track)
4040

41-
lane_context[SharedValues::GRADLE_ALL_APK_OUTPUT_PATHS] =
42-
lane_context[SharedValues::GRADLE_ALL_APK_OUTPUT_PATHS].select do |apk|
43-
apk.end_with? '-release.apk'
44-
end
41+
lane_context[SharedValues::GRADLE_ALL_AAB_OUTPUT_PATHS] =
42+
lane_context[SharedValues::GRADLE_ALL_AAB_OUTPUT_PATHS].select do |apk|
43+
apk.end_with? '-release.aab'
44+
end
4545

46-
supply(track: track,
47-
check_superseded_tracks: true)
46+
supply(track: track, check_superseded_tracks: true)
4847

4948
generate_sourcemap
5049
upload_sourcemap_to_bugsnag
@@ -84,12 +83,12 @@
8483
dest = File.expand_path('..', '.')
8584

8685
# we export this variable so that Gradle knows where to find the .properties file
87-
signing_props_dest = "#{dest}/android/app/signing.properties"
86+
signing_props_dest = "#{dest}/android/app/upload-keystore.properties"
8887
ENV['KEYSTORE_FILE'] = signing_props_dest
8988

9089
pairs = [
91-
{:from => "#{src}/signing.properties", :to => signing_props_dest},
92-
{:from => "#{src}/my-release-key.keystore", :to => "#{dest}/android/app/my-release-key.keystore"},
90+
{:from => "#{src}/upload-keystore.properties", :to => signing_props_dest},
91+
{:from => "#{src}/upload-keystore.keystore", :to => "#{dest}/android/app/upload-keystore.keystore"},
9392
{:from => "#{src}/play-private-key.json", :to => "#{dest}/fastlane/play-private-key.json"},
9493
]
9594

0 commit comments

Comments
 (0)