Chromium Code Reviews| Index: build/java_apk.gypi |
| diff --git a/build/java_apk.gypi b/build/java_apk.gypi |
| index e580b2384c99a5922c7a3b259d20ecd3e2cf9499..93c749c2a924a3230d356f6d4fbadf3a4d807298 100644 |
| --- a/build/java_apk.gypi |
| +++ b/build/java_apk.gypi |
| @@ -60,7 +60,7 @@ |
| 'proguard_enabled%': 'false', |
| 'proguard_flags_path%': '<(DEPTH)/build/android/empty_proguard.flags', |
| 'native_libs_paths': [], |
| - 'jar_name%': 'chromium_apk_<(_target_name).jar', |
| + 'jar_name': 'chromium_apk_<(_target_name).jar', |
| 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res', |
| 'R_package%':'', |
| 'additional_res_dirs': [], |
| @@ -74,11 +74,19 @@ |
| 'asset_location%': '<(intermediate_dir)/assets', |
| 'codegen_stamp': '<(intermediate_dir)/codegen.stamp', |
| 'compile_stamp': '<(intermediate_dir)/compile.stamp', |
| + 'jar_stamp': '<(intermediate_dir)/jar.stamp', |
| + 'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp', |
| 'android_manifest': '<(java_in_dir)/AndroidManifest.xml', |
| + 'classes_dir': '<(intermediate_dir)/classes', |
| 'codegen_input_paths': [], |
| + 'javac_includes': [], |
| + 'jar_excluded_classes': [], |
| + 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', |
| + 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', |
| + 'dex_path': '<(intermediate_dir)/classes.dex', |
| }, |
| 'sources': [ |
| - '<@(native_libs_paths)' |
| + '<@(native_libs_paths)', |
| ], |
| # Pass the jar path to the apk's "fake" jar target. This would be better as |
| # direct_dependent_settings, but a variable set by a direct_dependent_settings |
| @@ -199,22 +207,75 @@ |
| ], |
| }, |
| { |
| - 'action_name': 'ant_compile_<(_target_name)', |
| + 'action_name': 'javac_<(_target_name)', |
| 'message': 'Compiling java for <(_target_name)', |
| + 'variables': { |
| + 'all_src_dirs': [ |
| + '>(java_in_dir)/src', |
| + '>(intermediate_dir)/gen', |
| + '>@(additional_src_dirs)', |
| + '>@(generated_src_dirs)', |
| + ], |
| + }, |
| 'inputs': [ |
| - '<(DEPTH)/build/android/ant/apk-compile.xml', |
| - '<(DEPTH)/build/android/ant/create-test-jar.js', |
| + '<(DEPTH)/build/android/pylib/build_utils.py', |
| + '<(DEPTH)/build/android/javac.py', |
| # 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': [ |
| + 'python', '<(DEPTH)/build/android/javac.py', |
| + '--output-dir=<(classes_dir)', |
| + '--classpath=>(input_jars_paths) <(android_sdk_jar)', |
|
Yaron
2013/03/23 00:15:11
Doesn't this needed to be quoted and with a ":" se
cjhopman
2013/03/25 18:00:03
Gyp expands a gyp-list (in a string context as her
|
| + '--src-dirs=>(all_src_dirs)', |
| + '--javac-includes=<(javac_includes)', |
| + '--stamp=<(compile_stamp)', |
| + |
| + # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja. |
| + '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
| + ], |
| + }, |
| + { |
| + 'action_name': 'jar_<(_target_name)', |
| + 'message': 'Creating <(_target_name) jar', |
| + 'inputs': [ |
| + '<(DEPTH)/build/android/pylib/build_utils.py', |
| + '<(DEPTH)/build/android/jar.py', |
| + '<(compile_stamp)', |
| + ], |
| + 'outputs': [ |
| + '<(jar_stamp)', |
| + ], |
| + 'action': [ |
| + 'python', '<(DEPTH)/build/android/jar.py', |
| + '--classes-dir=<(classes_dir)', |
| + '--jar-path=<(jar_path)', |
| + '--excluded-classes=<(jar_excluded_classes)', |
| + '--stamp=<(jar_stamp)', |
| + |
| + # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja. |
| + '--ignore=>!(echo \'>(_inputs)\' | md5sum)', |
| + ] |
| + }, |
| + { |
| + 'action_name': 'ant_obfuscate_<(_target_name)', |
| + 'message': 'Obfuscating <(_target_name)', |
| + 'inputs': [ |
| + '<(DEPTH)/build/android/ant/apk-obfuscate.xml', |
| + '<(DEPTH)/build/android/ant/create-test-jar.js', |
| + '<(compile_stamp)', |
| + '<(proguard_flags_path)', |
| + ], |
| + 'outputs': [ |
| + '<(obfuscate_stamp)', |
| + ], |
| + 'action': [ |
| 'ant', '-quiet', |
| '-DOUT_DIR=<(intermediate_dir)', |
| '-DANDROID_SDK_ROOT=<(android_sdk_root)', |
| @@ -223,18 +284,18 @@ |
| '-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', |
| + '-DOBFUSCATED_JAR_PATH=<(obfuscated_jar_path)', |
| '-DAPK_NAME=<(apk_name)', |
| - '-DSTAMP=<(compile_stamp)', |
| + '-DSTAMP=<(obfuscate_stamp)', |
| '-Dbasedir=.', |
| '-buildfile', |
| - '<(DEPTH)/build/android/ant/apk-compile.xml', |
| + '<(DEPTH)/build/android/ant/apk-obfuscate.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. |
| @@ -243,14 +304,50 @@ |
| ], |
| }, |
| { |
| + 'action_name': 'dex_<(_target_name)', |
| + 'message': 'Dexing <(_target_name) jar', |
| + 'variables': { |
| + 'conditions': [ |
| + ['proguard_enabled==1', { |
| + 'dex_inputs': [ '<(obfuscated_jar_path)' ], |
| + }, { |
| + 'dex_inputs': [ |
| + '>@(input_jars_paths)', |
| + '<(classes_dir)', |
| + ], |
| + }], |
| + ], |
| + }, |
| + 'inputs': [ |
| + '<(DEPTH)/build/android/pylib/build_utils.py', |
| + '<(DEPTH)/build/android/dex.py', |
| + '<(compile_stamp)', |
| + '>@(dex_inputs)', |
| + ], |
| + 'outputs': [ |
| + '<(dex_path)', |
| + ], |
| + 'action': [ |
| + 'python', '<(DEPTH)/build/android/dex.py', |
| + '--dex-path=<(dex_path)', |
| + '--android-sdk-root=<(android_sdk_root)', |
| + |
| + # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja. |
| + '--ignore=>!(echo >(_inputs) | md5sum)', |
| + |
| + '>@(dex_inputs)', |
| + ] |
| + }, |
| + { |
| 'action_name': 'ant_package_<(_target_name)', |
| 'message': 'Packaging <(_target_name).', |
| 'inputs': [ |
| '<(DEPTH)/build/android/ant/apk-package.xml', |
| #TODO(cjhopman): this should be the stripped library paths. |
| '>@(native_libs_paths)', |
| + '<(dex_path)', |
| '<(codegen_stamp)', |
| - '<(compile_stamp)', |
| + '<(obfuscate_stamp)', |
| ], |
| 'conditions': [ |
| ['is_test_apk == 1', { |