Chromium Code Reviews| Index: build/java_apk.gypi |
| diff --git a/build/java_apk.gypi b/build/java_apk.gypi |
| index 3f3e7065e403407013d9c2d1a514fe407779a06f..324b4cd056dcf71516d41a080f7598714420b4dd 100644 |
| --- a/build/java_apk.gypi |
| +++ b/build/java_apk.gypi |
| @@ -52,7 +52,6 @@ |
| { |
| 'variables': { |
| - 'asset_location%': '', |
| 'additional_input_paths': [], |
| 'input_jars_paths': [], |
| 'additional_src_dirs': [], |
| @@ -60,17 +59,24 @@ |
| 'app_manifest_version_name%': '<(android_app_version_name)', |
| 'app_manifest_version_code%': '<(android_app_version_code)', |
| 'proguard_enabled%': 'false', |
| - 'proguard_flags%': '', |
| + 'proguard_flags_path%': '<(DEPTH)/build/android/empty_proguard.flags', |
| 'native_libs_paths': [], |
| 'jar_name%': 'chromium_apk_<(_target_name).jar', |
| - 'resource_dir%':'', |
| + 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res', |
| 'R_package%':'', |
| 'additional_res_dirs': [], |
| 'additional_res_packages': [], |
| 'is_test_apk%': 0, |
| 'java_strings_grd%': '', |
| 'grit_grd_file%': '', |
| - 'library_manifest_paths%' : [], |
| + 'library_manifest_paths' : [], |
| + 'resource_input_paths': [], |
| + 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)', |
| + 'asset_location%': '<(intermediate_dir)/<(_target_name)/assets', |
|
shashi
2013/03/22 04:18:06
Does the default assets folder has target name twi
cjhopman
2013/03/25 17:38:01
Done.
|
| + 'codegen_stamp': '<(intermediate_dir)/codegen.stamp', |
| + 'compile_stamp': '<(intermediate_dir)/compile.stamp', |
| + 'android_manifest': '<(java_in_dir)/AndroidManifest.xml', |
|
shashi
2013/03/22 04:18:06
Nice, does this mean now it is possible to have di
cjhopman
2013/03/25 17:38:01
Yes, I believe so.
|
| + 'codegen_input_paths': [], |
| }, |
| 'sources': [ |
| '<@(native_libs_paths)' |
| @@ -88,7 +94,7 @@ |
| 'rule_name': 'copy_and_strip_native_libraries', |
| 'extension': 'so', |
| 'variables': { |
| - 'apk_libraries_dir': '<(PRODUCT_DIR)/<(_target_name)/libs/<(android_app_abi)', |
| + 'apk_libraries_dir': '<(intermediate_dir)/libs/<(android_app_abi)', |
| 'stripped_library_path': '<(apk_libraries_dir)/<(RULE_INPUT_ROOT).so', |
| }, |
| 'inputs': [ |
| @@ -107,6 +113,11 @@ |
| }, |
| ], |
| 'conditions': [ |
| + ['resource_dir!=""', { |
| + 'variables': { |
| + 'resource_input_paths': [ '<!@(find <(resource_dir) -name "*")' ] |
| + }, |
| + }], |
| ['R_package != ""', { |
| 'variables': { |
| # We generate R.java in package R_package (in addition to the package |
| @@ -122,6 +133,12 @@ |
| 'additional_res_dirs': ['<(out_res_dir)'], |
| # grit_grd_file is used by grit_action.gypi, included below. |
| 'grit_grd_file': '<(java_in_dir)/strings/<(java_strings_grd)', |
| + 'resource_input_paths': [ |
| + # TODO(newt): replace this with .../values/strings.xml once |
| + # the English strings.xml is generated as well? That would be |
| + # simpler and faster and should be equivalent. |
| + '<!@pymod_do_main(grit_info <@(grit_defines) --outputs "<(out_res_dir)" <(grit_grd_file))', |
| + ], |
| }, |
| 'actions': [ |
| { |
| @@ -138,88 +155,144 @@ |
| ], |
| 'actions': [ |
| { |
| - 'action_name': 'ant_<(_target_name)', |
| - 'message': 'Building <(_target_name).', |
| + 'action_name': 'ant_codegen_<(_target_name)', |
| + 'message': 'Generating R.java for <(_target_name)', |
| + 'conditions': [ |
| + ['is_test_apk == 1', { |
| + 'variables': { |
| + 'additional_res_dirs=': [], |
| + 'additional_res_packages=': [], |
| + } |
| + }], |
| + ], |
| 'inputs': [ |
| - '<(java_in_dir)/AndroidManifest.xml', |
| - '<(DEPTH)/build/android/ant/chromium-apk.xml', |
| - '<(DEPTH)/build/android/ant/common.xml', |
| - '<(DEPTH)/build/android/ant/apk-build.xml', |
| + '<(DEPTH)/build/android/ant/apk-codegen.xml', |
| + '<(android_manifest)', |
| + '>@(library_manifest_paths)' |
| + '>@(codegen_input_paths)', |
| + '>@(additional_input_paths)', |
| + ], |
| + 'outputs': [ |
| + '<(codegen_stamp)', |
| + ], |
| + 'action': [ |
| + 'ant', '-quiet', |
| + '-DANDROID_SDK_ROOT=<(android_sdk_root)', |
| + '-DANDROID_SDK_VERSION=<(android_sdk_version)', |
| + '-DANDROID_SDK_JAR=<(android_sdk_jar)', |
| + '-DOUT_DIR=<(intermediate_dir)', |
| + '-DRESOURCE_DIR=<(resource_dir)', |
| + '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', |
| + '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)', |
| + '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', |
| + '-DLIBRARY_MANIFEST_PATHS=>(library_manifest_paths)', |
| + '-DANDROID_MANIFEST=<(android_manifest)', |
| + '-DSTAMP=<(codegen_stamp)', |
| + |
| + '-Dbasedir=.', |
| + '-buildfile', |
| + '<(DEPTH)/build/android/ant/apk-codegen.xml', |
| + |
| + # Add list of inputs to the command line, so if inputs change |
| + # (e.g. if a Java file is removed), the command will be re-run. |
| + # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. |
| + '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', |
| + ], |
| + }, |
| + { |
| + 'action_name': 'ant_compile_<(_target_name)', |
| + 'message': 'Compiling java for <(_target_name)', |
| + 'inputs': [ |
| + '<(DEPTH)/build/android/ant/apk-compile.xml', |
| + '<(DEPTH)/build/android/ant/create-test-jar.js', |
| # If there is a separate find for additional_src_dirs, it will find the |
| # wrong .java files when additional_src_dirs is empty. |
| '>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")', |
| '>@(input_jars_paths)', |
| + '<(codegen_stamp)', |
| + '<(proguard_flags_path)', |
| + ], |
| + 'outputs': [ |
| + '<(compile_stamp)', |
| + ], |
| + 'action': [ |
| + 'ant', '-quiet', |
| + '-DOUT_DIR=<(intermediate_dir)', |
| + '-DANDROID_SDK_ROOT=<(android_sdk_root)', |
| + '-DANDROID_SDK_VERSION=<(android_sdk_version)', |
| + '-DANDROID_SDK_JAR=<(android_sdk_jar)', |
| + '-DANDROID_MANIFEST=<(intermediate_dir)/AndroidManifest.xml', |
|
shashi
2013/03/22 04:18:06
nit: do not need to pass ANDROID_MANIFEST here.
cjhopman
2013/03/25 17:38:01
Done.
|
| + '-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)', |
| + '-DGENERATED_SRC_DIRS=>(generated_src_dirs)', |
| + '-DINPUT_JARS_PATHS=>(input_jars_paths)', |
| + '-DSOURCE_DIR=<(java_in_dir)/src', |
| + '-DPROGUARD_FLAGS=<(proguard_flags_path)', |
| + '-DPROGUARD_ENABLED=<(proguard_enabled)', |
| + '-DJAR_PATH=<(PRODUCT_DIR)/lib.java/<(jar_name)', |
| + '-DIS_TEST_APK=<(is_test_apk)', |
| + '-DCREATE_TEST_JAR_PATH=<(DEPTH)/build/android/ant/create-test-jar.js', |
| + '-DAPK_NAME=<(apk_name)', |
| + |
| + '-DSTAMP=<(compile_stamp)', |
| + '-Dbasedir=.', |
| + '-buildfile', |
| + '<(DEPTH)/build/android/ant/apk-compile.xml', |
| + |
| + # Add list of inputs to the command line, so if inputs change |
| + # (e.g. if a Java file is removed), the command will be re-run. |
| + # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. |
| + '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', |
| + ], |
| + }, |
| + { |
| + 'action_name': 'ant_package_<(_target_name)', |
| + 'message': 'Packaging <(_target_name).', |
| + 'inputs': [ |
| + '<(DEPTH)/build/android/ant/apk-package.xml', |
| + '<(java_in_dir)/AndroidManifest.xml', |
|
shashi
2013/03/22 04:18:06
nit: Do not need dependency on AndroidManifest.xml
cjhopman
2013/03/25 17:38:01
Done.
|
| + #TODO(cjhopman): this should be the stripped library paths. |
| '>@(native_libs_paths)', |
| - '>@(additional_input_paths)', |
| - '>@(library_manifest_paths)', |
| + '<(codegen_stamp)', |
| + '<(compile_stamp)', |
| ], |
| 'conditions': [ |
| - ['resource_dir!=""', { |
| - 'inputs': ['<!@(find <(java_in_dir)/<(resource_dir) -name "*")'] |
| - }], |
| - ['java_strings_grd != ""', { |
| - 'inputs': [ |
| - # TODO(newt): replace this with .../values/strings.xml once |
| - # the English strings.xml is generated as well? That would be |
| - # simpler and faster and should be equivalent. |
| - '<!@pymod_do_main(grit_info <@(grit_defines) --outputs "<(out_res_dir)" <(grit_grd_file))', |
| - ], |
| - }], |
| ['is_test_apk == 1', { |
| 'variables': { |
| 'additional_res_dirs=': [], |
| 'additional_res_packages=': [], |
| } |
| }], |
| - ['proguard_enabled == "true" and proguard_flags != ""', { |
| - 'inputs': ['<(java_in_dir)/<(proguard_flags)'] |
| - }], |
| ], |
| 'outputs': [ |
| '<(PRODUCT_DIR)/apks/<(apk_name).apk', |
| ], |
| 'action': [ |
| 'ant', '-quiet', |
| - '-DAPP_ABI=<(android_app_abi)', |
| - '-DANDROID_GDBSERVER=<(android_gdbserver)', |
| - '-DANDROID_SDK=<(android_sdk)', |
| + '-DOUT_DIR=<(intermediate_dir)', |
| '-DANDROID_SDK_ROOT=<(android_sdk_root)', |
| - '-DANDROID_SDK_TOOLS=<(android_sdk_tools)', |
| '-DANDROID_SDK_VERSION=<(android_sdk_version)', |
| - '-DANDROID_TOOLCHAIN=<(android_toolchain)', |
| - '-DCHROMIUM_SRC=<(ant_build_out)/../..', |
| + '-DANDROID_SDK_JAR=<(android_sdk_jar)', |
| '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', |
| - '-DPRODUCT_DIR=<(ant_build_out)', |
| - |
| + '-DANDROID_MANIFEST=<(intermediate_dir)/AndroidManifest.xml', |
|
shashi
2013/03/22 04:18:06
Same here.
cjhopman
2013/03/25 17:38:01
Done.
|
| + '-DKEYSTORE_PATH=<(DEPTH)/build/android/ant/chromium-debug.keystore', |
| '-DAPK_NAME=<(apk_name)', |
| + '-DAPKS_DIR=<(PRODUCT_DIR)/apks', |
| '-DASSET_DIR=<(asset_location)', |
| - '-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)', |
| - '-DGENERATED_SRC_DIRS=>(generated_src_dirs)', |
| - '-DINPUT_JARS_PATHS=>(input_jars_paths)', |
| - '-DJAR_NAME=<(jar_name)', |
| - '-DOUT_DIR=<(ant_build_out)/<(_target_name)', |
| '-DRESOURCE_DIR=<(resource_dir)', |
| + '-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)', |
| + '-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)', |
| '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', |
| '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)', |
| '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', |
| - '-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)', |
| - '-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)', |
| - '-DPROGUARD_FLAGS=>(proguard_flags)', |
| - '-DPROGUARD_ENABLED=>(proguard_enabled)', |
| - '-DLIBRARY_MANIFEST_PATHS=>(library_manifest_paths)', |
| # Add list of inputs to the command line, so if inputs change |
| # (e.g. if a Java file is removed), the command will be re-run. |
| # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. |
| - '-DTHIS_IS_IGNORED=>(_inputs)', |
| + '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', |
| - '-Dbasedir=<(java_in_dir)', |
| + '-Dbasedir=.', |
| '-buildfile', |
| - '<(DEPTH)/build/android/ant/chromium-apk.xml', |
| - |
| - # Specify CONFIGURATION_NAME as the target for ant to build. The |
| - # buildfile will then build the appropriate SDK tools target. |
| - '<(CONFIGURATION_NAME)', |
| + '<(DEPTH)/build/android/ant/apk-package.xml', |
| ] |
| }, |
| ], |