diff options
Diffstat (limited to 'build')
-rwxr-xr-x | build/android/gyp/package_resources.py | 7 | ||||
-rwxr-xr-x | build/android/gyp/process_resources.py | 10 | ||||
-rw-r--r-- | build/android/package_resources_action.gypi | 2 | ||||
-rw-r--r-- | build/config/android/internal_rules.gni | 24 | ||||
-rw-r--r-- | build/config/android/rules.gni | 3 | ||||
-rw-r--r-- | build/java.gypi | 2 | ||||
-rw-r--r-- | build/java_apk.gypi | 2 |
7 files changed, 35 insertions, 15 deletions
diff --git a/build/android/gyp/package_resources.py b/build/android/gyp/package_resources.py index a1f3840..536d5e5 100755 --- a/build/android/gyp/package_resources.py +++ b/build/android/gyp/package_resources.py @@ -80,7 +80,8 @@ def _ParseArgs(args): """ parser = optparse.OptionParser() build_utils.AddDepfileOption(parser) - parser.add_option('--android-sdk', help='path to the Android SDK folder') + parser.add_option('--android-sdk-jar', + help='path to the Android SDK jar.') parser.add_option('--aapt-path', help='path to the Android aapt tool') @@ -123,7 +124,7 @@ def _ParseArgs(args): parser.error('No positional arguments should be given.') # Check that required options have been provided. - required_options = ('android_sdk', 'aapt_path', 'configuration_name', + required_options = ('android_sdk_jar', 'aapt_path', 'configuration_name', 'android_manifest', 'version_code', 'version_name', 'apk_path') @@ -226,7 +227,7 @@ def _ConstructMostAaptArgs(options): '--no-crunch', '-f', '--auto-add-overlay', - '-I', os.path.join(options.android_sdk, 'android.jar'), + '-I', options.android_sdk_jar, '-F', options.apk_path, '--ignore-assets', build_utils.AAPT_IGNORE_PATTERN, ] diff --git a/build/android/gyp/process_resources.py b/build/android/gyp/process_resources.py index 441a798..36e80d4 100755 --- a/build/android/gyp/process_resources.py +++ b/build/android/gyp/process_resources.py @@ -42,7 +42,8 @@ def _ParseArgs(args): parser = optparse.OptionParser() build_utils.AddDepfileOption(parser) - parser.add_option('--android-sdk', help='path to the Android SDK folder') + parser.add_option('--android-sdk-jar', + help='the path to android jar file.') parser.add_option('--aapt-path', help='path to the Android aapt tool') parser.add_option('--non-constant-id', action='store_true') @@ -110,7 +111,7 @@ def _ParseArgs(args): # Check that required options have been provided. required_options = ( - 'android_sdk', + 'android_sdk_jar', 'aapt_path', 'android_manifest', 'dependencies_res_zips', @@ -341,7 +342,6 @@ def CombineZips(zip_files, output_path): def _OnStaleMd5(options): - android_jar = os.path.join(options.android_sdk, 'android.jar') aapt = options.aapt_path with build_utils.TempDir() as temp_dir: deps_dir = os.path.join(temp_dir, 'deps') @@ -379,7 +379,7 @@ def _OnStaleMd5(options): '-m', '-M', options.android_manifest, '--auto-add-overlay', - '-I', android_jar, + '-I', options.android_sdk_jar, '--output-text-symbols', gen_dir, '-J', gen_dir, '--ignore-assets', build_utils.AAPT_IGNORE_PATTERN] @@ -463,7 +463,7 @@ def main(args): # of them does not change what gets written to the depsfile. input_strings = options.extra_res_packages + [ options.aapt_path, - options.android_sdk, + options.android_sdk_jar, options.app_as_shared_lib, options.custom_package, options.include_all_resources, diff --git a/build/android/package_resources_action.gypi b/build/android/package_resources_action.gypi index c3529b3..a83c02d 100644 --- a/build/android/package_resources_action.gypi +++ b/build/android/package_resources_action.gypi @@ -48,7 +48,7 @@ ], 'action': [ 'python', '<(DEPTH)/build/android/gyp/package_resources.py', - '--android-sdk', '<(android_sdk)', + '--android-sdk-jar', '<(android_sdk_jar)', '--aapt-path', '<(android_aapt_path)', '--configuration-name', '<(CONFIGURATION_NAME)', '--android-manifest', '<(android_manifest_path)', diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni index 444e3f6..8ae340c 100644 --- a/build/config/android/internal_rules.gni +++ b/build/config/android/internal_rules.gni @@ -933,11 +933,18 @@ template("create_apk") { _android_aapt_path = android_default_aapt_path } + if (defined(invoker.alternative_android_sdk_jar)) { + _rebased_android_sdk_jar = + rebase_path(invoker.alternative_android_sdk_jar) + } else { + _rebased_android_sdk_jar = rebased_android_sdk_jar + } + args = [ "--depfile", rebase_path(depfile, root_build_dir), - "--android-sdk", - rebased_android_sdk, + "--android-sdk-jar", + _rebased_android_sdk_jar, "--aapt-path", _android_aapt_path, "--configuration-name=$android_configuration_name", @@ -988,6 +995,7 @@ template("create_apk") { package_resources_helper(_package_resources_target_name) { forward_variables_from(invoker, [ + "alternative_android_sdk_jar", "android_aapt_path", "extensions_to_not_compress", ]) @@ -1035,6 +1043,7 @@ template("create_apk") { package_resources_helper(_incremental_package_resources_target_name) { forward_variables_from(invoker, [ + "alternative_android_sdk_jar", "android_aapt_path", "extensions_to_not_compress", ]) @@ -1780,11 +1789,18 @@ template("process_resources") { _android_aapt_path = android_default_aapt_path } + if (defined(invoker.alternative_android_sdk_jar)) { + _rebased_android_sdk_jar = + rebase_path(invoker.alternative_android_sdk_jar) + } else { + _rebased_android_sdk_jar = rebased_android_sdk_jar + } + args = [ "--depfile", rebase_path(depfile, root_build_dir), - "--android-sdk", - rebase_path(android_sdk, root_build_dir), + "--android-sdk-jar", + _rebased_android_sdk_jar, "--aapt-path", _android_aapt_path, "--android-manifest", diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni index d547796..da9a853 100644 --- a/build/config/android/rules.gni +++ b/build/config/android/rules.gni @@ -1422,6 +1422,7 @@ template("android_apk") { process_resources(process_resources_target) { forward_variables_from(invoker, [ + "alternative_android_sdk_jar", "android_aapt_path", "app_as_shared_lib", "include_all_resources", @@ -1685,6 +1686,7 @@ template("android_apk") { deps = [] forward_variables_from(invoker, [ + "alternative_android_sdk_jar", "android_aapt_path", "app_as_shared_lib", "deps", @@ -1779,6 +1781,7 @@ template("android_apk") { deps = [] forward_variables_from(invoker, [ + "alternative_android_sdk_jar", "android_aapt_path", "deps", "native_lib_placeholders", diff --git a/build/java.gypi b/build/java.gypi index ab6687f..b2996f3 100644 --- a/build/java.gypi +++ b/build/java.gypi @@ -189,7 +189,7 @@ ], 'action': [ 'python', '<(DEPTH)/build/android/gyp/process_resources.py', - '--android-sdk', '<(android_sdk)', + '--android-sdk-jar', '<(android_sdk_jar)', '--aapt-path', '<(android_aapt_path)', # Need to generate onResourcesLoaded() in R.java, so could be used in java lib. '--shared-resources', diff --git a/build/java_apk.gypi b/build/java_apk.gypi index 93913b2..ab49dc6 100644 --- a/build/java_apk.gypi +++ b/build/java_apk.gypi @@ -892,7 +892,7 @@ ], 'action': [ 'python', '<(DEPTH)/build/android/gyp/process_resources.py', - '--android-sdk', '<(android_sdk)', + '--android-sdk-jar', '<(android_sdk_jar)', '--aapt-path', '<(android_aapt_path)', '--android-manifest', '<(android_manifest_path)', |