0%

构建编译bundle和assemble

差异


资源处理对比

bundle

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|------------------------------------------------------------------------
| bundleDebugResources , app| 差异 对比于 processDebugResources
|------------------------------------------------------------------------
| com.android.build.gradle.internal.res.LinkAndroidResForBundleTask_Decorated
|------------------------------------------------------------------------
| inputs file|
|-----------------------------------------------------------------
| /Users/juneleo/.gradle/caches/transforms-2/files-2.1/b663053762a1f47bbde212b9578d924e/com.google.android.material
| /Users/juneleo/.gradle/caches/transforms-2/files-2.1/d8db1f9caa389193f724effa2f6faa68/androidx.constraintlayout.widget
| /Users/juneleo/.gradle/caches/transforms-2/files-2.1/df1b2bf367f7f728ad8692322f629942/androidx.appcompat
| ...
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/res/merged/debug
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/bundle_manifest/debug/AndroidManifest.xml
| /Users/juneleo/Library/Android/sdk/platforms/android-30/android.jar
|-----------------------------------------------------------------
| outputs file|
|-----------------------------------------------------------------
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/linked_res_for_bundle/debug/bundled-res.ap_
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/incremental/bundleDebugResources
|-----------------------------------------------------------------

assemble

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|------------------------------------------------------------------------
| processDebugResources , app|
|------------------------------------------------------------------------
| com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask_Decorated
|------------------------------------------------------------------------
| inputs file|
|-----------------------------------------------------------------
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/aar_metadata_check/debug
| /Users/juneleo/.gradle/caches/transforms-2/files-2.1/b663053762a1f47bbde212b9578d924e/com.google.android.material
| /Users/juneleo/.gradle/caches/transforms-2/files-2.1/d8db1f9caa389193f724effa2f6faa68/androidx.constraintlayout.widget
| /Users/juneleo/.gradle/caches/transforms-2/files-2.1/df1b2bf367f7f728ad8692322f629942/androidx.appcompat
| ...
| /Users/juneleo/.gradle/caches/transforms-2/files-2.1/dc122ab2bc8269d2460b988c2f14982d/com.google.android.material-r.txt
| /Users/juneleo/.gradle/caches/transforms-2/files-2.1/e76b30011fe8712b8c039f1e60ac4a27/androidx.constraintlayout.widget-r.txt
| /Users/juneleo/.gradle/caches/transforms-2/files-2.1/7ae990921fd6ac908bfc0d9f356d84ad/androidx.appcompat-r.txt
| ...
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/res/merged/debug
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/packaged_manifests/debug
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/merged_manifests/debug
| /Users/juneleo/Library/Android/sdk/platforms/android-30/android.jar
|-----------------------------------------------------------------
| outputs file|
|-----------------------------------------------------------------
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/compile_and_runtime_not_namespaced_r_class_jar/debug/R.jar
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/incremental/processDebugResources
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/processed_res/debug/out
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/runtime_symbol_list/debug/R.txt
|-----------------------------------------------------------------

生成的.ap_ 文件内的差异
build/intermediates/linked_res_for_bundle/debug/bundled-res.ap_

image.png

build/intermediates/processed_res/debug/out/resources-debug.ap_
image.png

打包对比

bundle

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|------------------------------------------------------------------------
| buildDebugPreBundle , app| 同 packageDebug
|------------------------------------------------------------------------
| com.android.build.gradle.internal.tasks.PerModuleBundleTask_Decorated
|------------------------------------------------------------------------
| inputs file|
|-----------------------------------------------------------------
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/merged_assets/debug/out
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/dex/debug/mergeDexDebug
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/merged_java_res/debug/out.jar
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/stripped_native_libs/debug/out
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/linked_res_for_bundle/debug/bundled-res.ap_
|-----------------------------------------------------------------
| outputs file|
|-----------------------------------------------------------------
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/module_bundle/debug
|-----------------------------------------------------------------
|------------------------------------------------------------------------
| parseDebugIntegrityConfig , app|
|------------------------------------------------------------------------
| com.android.build.gradle.internal.tasks.ParseIntegrityConfigTask_Decorated
|------------------------------------------------------------------------
| inputs file|
|-----------------------------------------------------------------
| 没有inputs路径
|-----------------------------------------------------------------
| outputs file|
|-----------------------------------------------------------------
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/app_integrity_config/debug/AppIntegrityConfig.pb
|-----------------------------------------------------------------
|------------------------------------------------------------------------
| packageDebugBundle , app|
|------------------------------------------------------------------------
| com.android.build.gradle.internal.tasks.PackageBundleTask_Decorated
|------------------------------------------------------------------------
| inputs file|
|-----------------------------------------------------------------
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/app_metadata/debug/app-metadata.properties
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/module_bundle/debug
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/app_integrity_config/debug/AppIntegrityConfig.pb
|-----------------------------------------------------------------
| outputs file|
|-----------------------------------------------------------------
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/intermediary_bundle/debug/intermediary-bundle.aab
|-----------------------------------------------------------------

assemble

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|------------------------------------------------------------------------
| packageDebug , app|
|------------------------------------------------------------------------
| com.android.build.gradle.tasks.PackageApplication_Decorated
|------------------------------------------------------------------------
| inputs file|
|-----------------------------------------------------------------
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/app_metadata/debug/app-metadata.properties
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/compressed_assets/debug/out
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/dex/debug/mergeDexDebug
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/merged_java_res/debug/out.jar
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/stripped_native_libs/debug/out
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/packaged_manifests/debug
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/processed_res/debug/out
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/signing_config_versions/debug/signing-config-versions.json
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/validate_signing_config/debug
| /Users/juneleo/.android/debug.keystore
|-----------------------------------------------------------------
| outputs file|
|-----------------------------------------------------------------
| /Users/juneleo/demo/gradle_pom_use/app/build/outputs/apk/debug/output-metadata.json
| /Users/juneleo/demo/gradle_pom_use/app/build/intermediates/incremental/packageDebug/tmp
| /Users/juneleo/demo/gradle_pom_use/app/build/outputs/apk/debug
|-----------------------------------------------------------------

aab和apk对比
build/outputs/bundle/debug/app-debug.aab
image.png

build/outputs/apk/debug/app-debug.apk
image.png