Commit 3599daa6 authored by Sam Maier's avatar Sam Maier Committed by Commit Bot

Android: dexsplitter being used for feature modules

Testing done using is_java_debug=false, on patchset #6:
- Ran Monochrome.apks with just the base module, went to a few webpages
- Ran ChromeModernPublic.apks with base module only, few webpages
- Ran Monochrome.apks with base and ar modules, opened AR and it worked
- Ran ChromeModernPublic.apks with base and ar modules, ran VR fine
- Unzipped the .aab files, compared the dex files to current master:
  * base/classes.dex files were byte-for-byte identical for both
    Monochrome and ChromeModernPublic
  * ar/classes.dex file in Monochrome was a bit smaller. In total, we
    went from 170->119 methods, 88->70 types, 27->21 fields, 260->213
    strings
  * vr/classes.dex file in ChromeModernPublic was a bit smaller. We
    went from 1088->1030 methods, 330->316 types, 277->270 fields,
    987->951 strings

Since the base/classes.dex files were identical, and the vr and ar
modules worked, I have good confidence that this is functional.

Bug: 883162
Change-Id: Id1100193a0787c38680a63fe3b5f85a1c10ef926
Reviewed-on: https://chromium-review.googlesource.com/c/1327571
Commit-Queue: Sam Maier <smaier@chromium.org>
Reviewed-by: default avatarTibor Goldschwendt <tiborg@chromium.org>
Reviewed-by: default avataragrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610884}
parent 9ce5a84b
...@@ -667,13 +667,13 @@ _ANDROID_SPECIFIC_PYDEPS_FILES = [ ...@@ -667,13 +667,13 @@ _ANDROID_SPECIFIC_PYDEPS_FILES = [
'build/android/gyp/create_test_runner_script.pydeps', 'build/android/gyp/create_test_runner_script.pydeps',
'build/android/gyp/create_tool_wrapper.pydeps', 'build/android/gyp/create_tool_wrapper.pydeps',
'build/android/gyp/desugar.pydeps', 'build/android/gyp/desugar.pydeps',
'build/android/gyp/dexsplitter.pydeps',
'build/android/gyp/dex.pydeps', 'build/android/gyp/dex.pydeps',
'build/android/gyp/dist_aar.pydeps', 'build/android/gyp/dist_aar.pydeps',
'build/android/gyp/emma_instr.pydeps', 'build/android/gyp/emma_instr.pydeps',
'build/android/gyp/filter_zip.pydeps', 'build/android/gyp/filter_zip.pydeps',
'build/android/gyp/gcc_preprocess.pydeps', 'build/android/gyp/gcc_preprocess.pydeps',
'build/android/gyp/generate_linker_version_script.pydeps', 'build/android/gyp/generate_linker_version_script.pydeps',
'build/android/gyp/generate_proguarded_module_jar.pydeps',
'build/android/gyp/ijar.pydeps', 'build/android/gyp/ijar.pydeps',
'build/android/gyp/java_cpp_enum.pydeps', 'build/android/gyp/java_cpp_enum.pydeps',
'build/android/gyp/javac.pydeps', 'build/android/gyp/javac.pydeps',
...@@ -692,8 +692,8 @@ _ANDROID_SPECIFIC_PYDEPS_FILES = [ ...@@ -692,8 +692,8 @@ _ANDROID_SPECIFIC_PYDEPS_FILES = [
'build/android/test_runner.pydeps', 'build/android/test_runner.pydeps',
'build/android/test_wrapper/logdog_wrapper.pydeps', 'build/android/test_wrapper/logdog_wrapper.pydeps',
'build/protoc_java.pydeps', 'build/protoc_java.pydeps',
'build/secondary/third_party/android_platform/' ('build/secondary/third_party/android_platform/'
'development/scripts/stack.pydeps', 'development/scripts/stack.pydeps'),
'net/tools/testserver/testserver.pydeps', 'net/tools/testserver/testserver.pydeps',
] ]
......
#!/usr/bin/env python
#
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import shutil
import sys
import zipfile
from util import build_utils
def _ParseOptions(args):
parser = argparse.ArgumentParser()
parser.add_argument('--depfile', help='Path to the depfile to write to.')
parser.add_argument('--stamp', help='Path to stamp to mark when finished.')
parser.add_argument('--r8-path', help='Path to the r8.jar to use.')
parser.add_argument(
'--input-dex-zip', help='Path to dex files in zip being split.')
parser.add_argument(
'--proguard-mapping-file', help='Path to proguard mapping file.')
parser.add_argument(
'--feature-name',
action='append',
dest='feature_names',
help='The name of the feature module.')
parser.add_argument(
'--feature-jars',
action='append',
help='GN list of path to jars which compirse the corresponding feature.')
parser.add_argument(
'--dex-dest',
action='append',
dest='dex_dests',
help='Destination for dex file of the corresponding feature.')
options = parser.parse_args(args)
assert len(options.feature_names) == len(options.feature_jars) and len(
options.feature_names) == len(options.dex_dests)
options.features = {}
for i, name in enumerate(options.feature_names):
options.features[name] = build_utils.ParseGnList(options.feature_jars[i])
return options
def _RunDexsplitter(options, output_dir):
cmd = [
'java',
'-jar',
options.r8_path,
'dexsplitter',
'--output',
output_dir,
'--proguard-map',
options.proguard_mapping_file,
]
for base_jar in options.features['base']:
cmd += ['--base-jar', base_jar]
base_jars_lookup = set(options.features['base'])
for feature in options.features:
if feature == 'base':
continue
for feature_jar in options.features[feature]:
if feature_jar not in base_jars_lookup:
cmd += ['--feature-jar', feature_jar + ':' + feature]
with build_utils.TempDir() as temp_dir:
unzipped_files = build_utils.ExtractAll(options.input_dex_zip, temp_dir)
for file_name in unzipped_files:
cmd += ['--input', file_name]
build_utils.CheckOutput(cmd)
def main(args):
args = build_utils.ExpandFileArgs(args)
options = _ParseOptions(args)
input_paths = []
for feature_jars in options.features.itervalues():
for feature_jar in feature_jars:
input_paths.append(feature_jar)
with build_utils.TempDir() as dexsplitter_output_dir:
curr_location_to_dest = []
if len(options.features) == 1:
# Don't run dexsplitter since it needs at least 1 feature module.
curr_location_to_dest.append((options.input_dex_zip,
options.dex_dests[0]))
else:
_RunDexsplitter(options, dexsplitter_output_dir)
for i, dest in enumerate(options.dex_dests):
module_dex_file = os.path.join(dexsplitter_output_dir,
options.feature_names[i], 'classes.dex')
if os.path.exists(module_dex_file):
curr_location_to_dest.append((module_dex_file, dest))
else:
module_dex_file += '.zip'
assert os.path.exists(
module_dex_file), 'Dexsplitter tool output not found.'
curr_location_to_dest.append((module_dex_file + '.zip', dest))
for curr_location, dest in curr_location_to_dest:
with build_utils.AtomicOutput(dest) as f:
if curr_location.endswith('.zip'):
if dest.endswith('.zip'):
shutil.move(curr_location, f.name)
else:
with zipfile.ZipFile(curr_location, 'r') as z:
namelist = z.namelist()
assert len(namelist) == 1, (
'Unzipping to single dex file, but not single dex file in ' +
options.input_dex_zip)
z.extract(namelist[0], f.name)
else:
if dest.endswith('.zip'):
build_utils.ZipDir(
f.name, os.path.abspath(os.path.join(curr_location, os.pardir)))
else:
shutil.move(curr_location, f.name)
build_utils.Touch(options.stamp)
build_utils.WriteDepfile(options.depfile, options.stamp, inputs=input_paths)
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))
# Generated by running: # Generated by running:
# build/print_python_deps.py --root build/android/gyp --output build/android/gyp/generate_proguarded_module_jar.pydeps build/android/gyp/generate_proguarded_module_jar.py # build/print_python_deps.py --root build/android/gyp --output build/android/gyp/dexsplitter.pydeps build/android/gyp/dexsplitter.py
../../gn_helpers.py ../../gn_helpers.py
generate_proguarded_module_jar.py dexsplitter.py
util/__init__.py util/__init__.py
util/build_utils.py util/build_utils.py
util/md5_check.py util/md5_check.py
#!/usr/bin/env python
#
# Copyright (c) 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Extracts a bundle module's classes from jar created in the synchronized
proguarding step and packages them into a new jar.
Synchronized proguarding means that, when several app modules are combined into
an app bundle, all un-optimized jars for all modules are grouped and sent to a
single proguard command, which generates a single, common, intermediate
optimized jar, and its mapping file.
This script is used to extract, from this synchronized proguard jar, all the
optimized classes corresponding to a single module, into a new .jar file. The
latter will be compiled later into the module's dex file.
For this, the script reads the module's un-obfuscated class names from the
module's unoptimized jars. Then, it maps those to obfuscated class names using
the proguard mapping file. Finally, it extracts the module's class files from
the proguarded jar and zips them into a new module jar. """
import argparse
import os
import sys
import zipfile
from util import build_utils
MANIFEST = """Manifest-Version: 1.0
Created-By: generate_proguarded_module_jar.py
"""
# TODO(tiborg): Share with merge_jar_info_files.py.
def _FullJavaNameFromClassFilePath(path):
if not path.endswith('.class'):
return ''
path = os.path.splitext(path)[0]
parts = []
while path:
# Use split to be platform independent.
head, tail = os.path.split(path)
path = head
parts.append(tail)
parts.reverse() # Package comes first
return '.'.join(parts)
def main(args):
args = build_utils.ExpandFileArgs(args)
parser = argparse.ArgumentParser()
build_utils.AddDepfileOption(parser)
parser.add_argument(
'--proguarded-jar',
required=True,
help='Path to input jar produced by synchronized proguarding')
parser.add_argument(
'--proguard-mapping',
required=True,
help='Path to input proguard mapping produced by synchronized '
'proguarding')
parser.add_argument(
'--module-input-jars',
required=True,
help='GN-list of input paths to un-optimized jar files for the current '
'module. The optimized versions of their .class files will go into '
'the output jar.')
parser.add_argument(
'--output-jar',
required=True,
help='Path to output jar file containing the module\'s optimized class '
'files')
parser.add_argument(
'--is-base-module',
action='store_true',
help='Inidcates to extract class files for a base module')
options = parser.parse_args(args)
options.module_input_jars = build_utils.ParseGnList(options.module_input_jars)
# Read class names of the currently processed module.
classes = set()
for module_jar in options.module_input_jars:
with zipfile.ZipFile(module_jar) as zip_info:
for path in zip_info.namelist():
fully_qualified_name = _FullJavaNameFromClassFilePath(path)
if fully_qualified_name:
classes.add(fully_qualified_name)
# Parse the proguarding mapping to be able to map un-obfuscated to obfuscated
# names.
# Proguard mapping files have the following format:
#
# {un-obfuscated class name 1} -> {obfuscated class name 1}:
# {un-obfuscated member name 1} -> {obfuscated member name 1}
# ...
# {un-obfuscated class name 2} -> {obfuscated class name 2}:
# ...
# ...
obfuscation_map = {}
with open(options.proguard_mapping, 'r') as proguard_mapping_file:
for line in proguard_mapping_file:
# Skip indented lines since they map member names and not class names.
if line.startswith(' '):
continue
line = line.strip()
# Skip empty lines.
if not line:
continue
assert line.endswith(':')
full, obfuscated = line.strip(':').split(' -> ')
assert full
assert obfuscated
obfuscation_map[full] = obfuscated
# Collect the obfuscated names of classes, which should go into the currently
# processed module.
obfuscated_module_classes = set(
obfuscation_map[c] for c in classes if c in obfuscation_map)
# Collect horizontally merged classes to later make sure that those only go
# into the base module. Merging classes horizontally means that proguard took
# two classes that don't inherit from each other and merged them into one.
horiz_merged_classes = set()
obfuscated_classes = sorted(obfuscation_map.values())
prev_obfuscated_class = None
for obfuscated_class in obfuscated_classes:
if prev_obfuscated_class and obfuscated_class == prev_obfuscated_class:
horiz_merged_classes.add(obfuscated_class)
prev_obfuscated_class = obfuscated_class
# Move horizontally merged classes into the base module.
if options.is_base_module:
obfuscated_module_classes |= horiz_merged_classes
else:
obfuscated_module_classes -= horiz_merged_classes
# Extract module class files from proguarded jar and store them in a module
# split jar.
with zipfile.ZipFile(
os.path.abspath(options.output_jar), 'w',
zipfile.ZIP_DEFLATED) as output_jar:
with zipfile.ZipFile(os.path.abspath(options.proguarded_jar),
'r') as proguarded_jar:
for obfuscated_class in obfuscated_module_classes:
class_path = obfuscated_class.replace('.', '/') + '.class'
class_file_content = proguarded_jar.read(class_path)
output_jar.writestr(class_path, class_file_content)
output_jar.writestr('META-INF/MANIFEST.MF', MANIFEST)
if options.depfile:
build_utils.WriteDepfile(
options.depfile, options.output_jar, options.module_input_jars +
[options.proguard_mapping, options.proguarded_jar], add_pydeps=False)
if __name__ == '__main__':
main(sys.argv[1:])
...@@ -41,6 +41,7 @@ _java_target_whitelist = [ ...@@ -41,6 +41,7 @@ _java_target_whitelist = [
_java_target_blacklist = [ "*:*_unpack_aar" ] _java_target_blacklist = [ "*:*_unpack_aar" ]
_default_proguard_jar_path = "//third_party/proguard/lib/proguard.jar" _default_proguard_jar_path = "//third_party/proguard/lib/proguard.jar"
_r8_path = "//third_party/r8/lib/r8.jar"
_dexlayout_path = "//third_party/android_build_tools/art/dexlayout" _dexlayout_path = "//third_party/android_build_tools/art/dexlayout"
_profman_path = "//third_party/android_build_tools/art/profman" _profman_path = "//third_party/android_build_tools/art/profman"
...@@ -3526,7 +3527,7 @@ template("create_android_app_bundle_module") { ...@@ -3526,7 +3527,7 @@ template("create_android_app_bundle_module") {
"--format=bundle-module", "--format=bundle-module",
"--output-apk", "--output-apk",
rebase_path(invoker.module_zip_path, root_build_dir), rebase_path(invoker.module_zip_path, root_build_dir),
"--dex-file=${invoker.dex_path_file_arg}", "--dex-file=@FileArg($_rebased_build_config:final_dex:path)",
"--resource-apk=@FileArg(" + "--resource-apk=@FileArg(" +
"$_rebased_build_config:deps_info:proto_resources_path)", "$_rebased_build_config:deps_info:proto_resources_path)",
"--assets=@FileArg($_rebased_build_config:assets)", "--assets=@FileArg($_rebased_build_config:assets)",
...@@ -3548,40 +3549,51 @@ template("create_android_app_bundle_module") { ...@@ -3548,40 +3549,51 @@ template("create_android_app_bundle_module") {
} }
} }
# Extracts a bundle module's classes from jar created in the synchronized # Splits input dex file(s) based on given feature jars into seperate dex files
# proguarding step and packages them into a new jar. # for each feature.
# #
# Variables: # Variables:
# proguarded_jar: Path to input jar produced by synchronized proguarding.
# proguard_mapping: Path to input proguard mapping produced by synchronized # proguard_mapping: Path to input proguard mapping produced by synchronized
# proguarding # proguarding.
# output_jar: Path to output jar file containing the module's optimized class # input_dex_zip: Path to zipped dex files to split.
# files. # all_modules: Path to list of all modules. Each Module must have
# build_config: Path to build config of module. # build_config, name, and build_config_target properties.
# is_base_module: True if this is processing a base module. template("dexsplitter") {
template("generate_proguarded_module_jar") {
_rebased_build_config = rebase_path(invoker.build_config, root_build_dir)
action_with_pydeps(target_name) { action_with_pydeps(target_name) {
forward_variables_from(invoker, [ "deps" ]) forward_variables_from(invoker, [ "deps" ])
script = "//build/android/gyp/generate_proguarded_module_jar.py" script = "//build/android/gyp/dexsplitter.py"
inputs = [
invoker.input_dex_zip,
]
_stamp = "${target_gen_dir}/${target_name}.stamp"
outputs = [ outputs = [
invoker.output_jar, _stamp,
] ]
depfile = "${target_gen_dir}/${target_name}.d" depfile = "${target_gen_dir}/${target_name}.d"
args = [ args = [
"--stamp",
rebase_path(_stamp, root_build_dir),
"--depfile", "--depfile",
rebase_path(depfile, root_build_dir), rebase_path(depfile, root_build_dir),
"--proguarded-jar", "--r8-path",
rebase_path(invoker.proguarded_jar, root_build_dir), rebase_path(_r8_path, root_build_dir),
"--proguard-mapping", "--input-dex-zip",
rebase_path(invoker.input_dex_zip, root_build_dir),
"--proguard-mapping-file",
rebase_path(invoker.proguard_mapping, root_build_dir), rebase_path(invoker.proguard_mapping, root_build_dir),
"--module-input-jars=@FileArg(${_rebased_build_config}:deps_info:java_runtime_classpath)",
"--output-jar",
rebase_path(invoker.output_jar, root_build_dir),
] ]
if (defined(invoker.is_base_module) && invoker.is_base_module) {
args += [ "--is-base-module" ] foreach(_feature_module, invoker.all_modules) {
_rebased_module_build_config =
rebase_path(_feature_module.build_config, root_build_dir)
args += [
"--feature-name",
_feature_module.name,
"--feature-jars=@FileArg($_rebased_module_build_config:deps_info:java_runtime_classpath)",
"--dex-dest=@FileArg($_rebased_module_build_config:final_dex:path)",
]
deps += [ _feature_module.build_config_target ]
} }
} }
} }
...@@ -3806,10 +3806,27 @@ if (enable_java_templates) { ...@@ -3806,10 +3806,27 @@ if (enable_java_templates) {
# } # }
# #
template("android_app_bundle") { template("android_app_bundle") {
_bundle_base_path = "$root_build_dir/apks"
if (defined(invoker.bundle_base_path)) {
_bundle_base_path = invoker.bundle_base_path
}
_bundle_name = target_name
if (defined(invoker.bundle_name)) {
_bundle_name = invoker.bundle_name
}
_bundle_path = "$_bundle_base_path/${_bundle_name}.aab"
_rebased_bundle_path = rebase_path(_bundle_path, root_build_dir)
_base_target_name = get_label_info(invoker.base_module_target, "name")
_base_target_gen_dir =
get_label_info(invoker.base_module_target, "target_gen_dir")
_all_modules = [ _all_modules = [
{ {
name = "base" name = "base"
module_target = invoker.base_module_target module_target = invoker.base_module_target
build_config = "$_base_target_gen_dir/${_base_target_name}.build_config"
build_config_target = "${module_target}__build_config"
}, },
] ]
...@@ -3824,8 +3841,15 @@ if (enable_java_templates) { ...@@ -3824,8 +3841,15 @@ if (enable_java_templates) {
assert( assert(
defined(_module.module_target), defined(_module.module_target),
"Missing 'module_target' field for extra module ${_module.name}.") "Missing 'module_target' field for extra module ${_module.name}.")
_module_target = _module.module_target
_module_target_name = get_label_info(_module_target, "name")
_module_target_gen_dir =
get_label_info(_module_target, "target_gen_dir")
_module.build_config =
"$_module_target_gen_dir/${_module_target_name}.build_config"
_module.build_config_target = "${_module_target}__build_config"
_all_modules += [ _module ]
} }
_all_modules += invoker.extra_modules
} }
_proguard_enabled = _proguard_enabled =
...@@ -3838,8 +3862,10 @@ if (enable_java_templates) { ...@@ -3838,8 +3862,10 @@ if (enable_java_templates) {
# Make build config, which is required for synchronized proguarding. # Make build config, which is required for synchronized proguarding.
_module_targets = [] _module_targets = []
_module_build_config_targets = []
foreach(_module, _all_modules) { foreach(_module, _all_modules) {
_module_targets += [ _module.module_target ] _module_targets += [ _module.module_target ]
_module_build_config_targets += [ _module.build_config_target ]
} }
_build_config = "$target_gen_dir/${target_name}.build_config" _build_config = "$target_gen_dir/${target_name}.build_config"
_rebased_build_config = rebase_path(_build_config, root_build_dir) _rebased_build_config = rebase_path(_build_config, root_build_dir)
...@@ -3856,20 +3882,29 @@ if (enable_java_templates) { ...@@ -3856,20 +3882,29 @@ if (enable_java_templates) {
} }
if (_proguard_enabled) { if (_proguard_enabled) {
# Proguard all modules together to keep binary size small while still _proguard_mapping_path = "${_bundle_path}.mapping"
# maintaining compatibility between modules. _unsplit_dex_zip =
_proguard_output_jar_path = "${target_gen_dir}/${target_name}/${target_name}__unsplit_dex.zip"
"${target_gen_dir}/${target_name}/${target_name}.proguard.jar" _unsplit_dex_target = "${target_name}__unsplit_dex"
_sync_proguard_target = "${target_name}__sync_proguard" dex(_unsplit_dex_target) {
proguard(_sync_proguard_target) { enable_multidex = _enable_multidex
proguard_enabled = true
proguard_mapping_path = _proguard_mapping_path
forward_variables_from(invoker, [ "proguard_jar_path" ]) forward_variables_from(invoker, [ "proguard_jar_path" ])
build_config = _build_config build_config = _build_config
deps = _module_targets + [ ":$_build_config_target" ]
output_path = _proguard_output_jar_path deps = _module_targets + _module_build_config_targets +
args = [ [ ":$_build_config_target" ]
"--proguard-configs=@FileArg($_rebased_build_config:deps_info:proguard_all_configs)", output = _unsplit_dex_zip
"--input-paths=@FileArg($_rebased_build_config:deps_info:java_runtime_classpath)", }
_dexsplitter_target = "${_unsplit_dex_target}__dexspliter"
dexsplitter(_dexsplitter_target) {
input_dex_zip = _unsplit_dex_zip
proguard_mapping = _proguard_mapping_path
all_modules = _all_modules
deps = [
":${_unsplit_dex_target}",
] ]
} }
} }
...@@ -3879,65 +3914,13 @@ if (enable_java_templates) { ...@@ -3879,65 +3914,13 @@ if (enable_java_templates) {
_all_module_build_configs = [] _all_module_build_configs = []
foreach(_module, _all_modules) { foreach(_module, _all_modules) {
_module_target = _module.module_target _module_target = _module.module_target
_module_target_name = get_label_info(_module_target, "name") _module_build_config = _module.build_config
_module_target_gen_dir = get_label_info(_module_target, "target_gen_dir") _module_build_config_target = _module.build_config_target
_module_build_config_target = "${_module_target}__build_config"
_module_build_config =
"$_module_target_gen_dir/${_module_target_name}.build_config"
if (_proguard_enabled) { if (_proguard_enabled) {
# Extract optimized classes for each module and dex them. _dex_target_for_module = ":$_dexsplitter_target"
_module_final_dex_target = "${target_name}__${_module.name}__dex"
_module_final_dex_target_dep = ":$_module_final_dex_target"
if (_enable_multidex) {
_module_final_dex_path =
"$target_gen_dir/$target_name/${_module.name}/classes.dex.zip"
} else { } else {
_module_final_dex_path = _dex_target_for_module = "${_module_target}__final_dex"
"$target_gen_dir/$target_name/${_module.name}/classes.dex"
}
_module_final_dex_path_file_arg =
rebase_path(_module_final_dex_path, root_build_dir)
_module_jar_path =
"${target_gen_dir}/${target_name}/${_module.name}.optimized.jar"
_generate_proguarded_module_jar_target =
"${target_name}__${_module.name}__module_jar"
generate_proguarded_module_jar(_generate_proguarded_module_jar_target) {
proguarded_jar = _proguard_output_jar_path
build_config = _module_build_config
proguard_mapping = "${_proguard_output_jar_path}.mapping"
output_jar = _module_jar_path
is_base_module = _module.name == "base"
deps = [
":${_sync_proguard_target}",
"$_module_build_config_target",
"${_module.module_target}",
]
}
dex(_module_final_dex_target) {
deps = [
":${_generate_proguarded_module_jar_target}",
]
input_jars = [ _module_jar_path ]
output = _module_final_dex_path
if (_enable_multidex && _module.name == "base") {
enable_multidex = _enable_multidex
extra_main_dex_proguard_config =
"$_module_target_gen_dir/$_module_target_name/" +
"$_module_target_name.resources.main-dex-proguard.txt"
deps += [ "${_module_target}__compile_resources" ]
}
}
} else {
_module_final_dex_target_dep = "${_module_target}__final_dex"
_rebased_module_build_config =
rebase_path(_module_build_config, root_build_dir)
_module_final_dex_path_file_arg =
"@FileArg($_rebased_module_build_config:final_dex:path)"
} }
# Generate one module .zip file per bundle module. # Generate one module .zip file per bundle module.
...@@ -3951,11 +3934,11 @@ if (enable_java_templates) { ...@@ -3951,11 +3934,11 @@ if (enable_java_templates) {
create_android_app_bundle_module(_create_module_target) { create_android_app_bundle_module(_create_module_target) {
build_config = _module_build_config build_config = _module_build_config
module_zip_path = _module_zip_path module_zip_path = _module_zip_path
dex_path_file_arg = _module_final_dex_path_file_arg
deps = [ deps = [
"$_module_build_config_target", _dex_target_for_module,
"$_module_final_dex_target_dep", _module_build_config_target,
"$_module_target", _module_target,
] ]
} }
...@@ -3971,19 +3954,6 @@ if (enable_java_templates) { ...@@ -3971,19 +3954,6 @@ if (enable_java_templates) {
_all_rebased_module_zip_paths = _all_rebased_module_zip_paths =
rebase_path(_all_module_zip_paths, root_build_dir) rebase_path(_all_module_zip_paths, root_build_dir)
_bundle_name = target_name
if (defined(invoker.bundle_name)) {
_bundle_name = invoker.bundle_name
}
_bundle_base_path = "$root_build_dir/apks"
if (defined(invoker.bundle_base_path)) {
_bundle_base_path = invoker.bundle_base_path
}
_bundle_path = "$_bundle_base_path/$_bundle_name.aab"
_rebased_bundle_path = rebase_path(_bundle_path, root_build_dir)
_sign_bundle = defined(invoker.sign_bundle) && invoker.sign_bundle _sign_bundle = defined(invoker.sign_bundle) && invoker.sign_bundle
_split_dimensions = [] _split_dimensions = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment