Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: build/java_apk.gypi

Issue 13058003: Convert native strip from rule to action (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@libraryloader
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/android/strip_library_for_apk.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # This file is meant to be included into a target to provide a rule 5 # This file is meant to be included into a target to provide a rule
6 # to build Android APKs in a consistent manner. 6 # to build Android APKs in a consistent manner.
7 # 7 #
8 # To use this, create a gyp target with the following form: 8 # To use this, create a gyp target with the following form:
9 # { 9 # {
10 # 'target_name': 'my_package_apk', 10 # 'target_name': 'my_package_apk',
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res', 64 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res',
65 'R_package%':'', 65 'R_package%':'',
66 'additional_res_dirs': [], 66 'additional_res_dirs': [],
67 'additional_res_packages': [], 67 'additional_res_packages': [],
68 'is_test_apk%': 0, 68 'is_test_apk%': 0,
69 'java_strings_grd%': '', 69 'java_strings_grd%': '',
70 'library_manifest_paths' : [], 70 'library_manifest_paths' : [],
71 'resource_input_paths': [], 71 'resource_input_paths': [],
72 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)', 72 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)',
73 'asset_location%': '<(intermediate_dir)/assets', 73 'asset_location%': '<(intermediate_dir)/assets',
74 'codegen_stamp': '<(intermediate_dir)/codegen.stamp',
75 'compile_input_paths': [ ], 74 'compile_input_paths': [ ],
76 'compile_stamp': '<(intermediate_dir)/compile.stamp',
77 'jar_stamp': '<(intermediate_dir)/jar.stamp',
78 'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp',
79 'classes_dir': '<(intermediate_dir)/classes', 75 'classes_dir': '<(intermediate_dir)/classes',
80 'javac_includes': [], 76 'javac_includes': [],
81 'jar_excluded_classes': [], 77 'jar_excluded_classes': [],
82 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', 78 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)',
83 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', 79 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar',
84 'dex_path': '<(intermediate_dir)/classes.dex', 80 'dex_path': '<(intermediate_dir)/classes.dex',
85 'android_manifest': '<(java_in_dir)/AndroidManifest.xml', 81 'android_manifest': '<(java_in_dir)/AndroidManifest.xml',
86 'codegen_input_paths': [], 82 'codegen_input_paths': [],
87 'ordered_libraries_path': '<(intermediate_dir)/native_libraries.json', 83 'ordered_libraries_path': '<(intermediate_dir)/native_libraries.json',
88 'native_libraries_template': '<(DEPTH)/content/public/android/java/src/org/c hromium/content/app/NativeLibraries.java', 84 'native_libraries_template': '<(DEPTH)/content/public/android/java/src/org/c hromium/content/app/NativeLibraries.java',
89 'native_libraries_java_dir': '<(intermediate_dir)/native_libraries_java/', 85 'native_libraries_java_dir': '<(intermediate_dir)/native_libraries_java/',
90 'native_libraries_java_path': '<(intermediate_dir)/native_libraries_java/Nat iveLibraries.java', 86 'native_libraries_java_path': '<(intermediate_dir)/native_libraries_java/Nat iveLibraries.java',
87
91 'native_libraries_stamp': '<(intermediate_dir)/native_libraries.stamp', 88 'native_libraries_stamp': '<(intermediate_dir)/native_libraries.stamp',
89 'strip_stamp': '<(intermediate_dir)/strip.stamp',
90 'codegen_stamp': '<(intermediate_dir)/codegen.stamp',
91 'compile_stamp': '<(intermediate_dir)/compile.stamp',
92 'jar_stamp': '<(intermediate_dir)/jar.stamp',
93 'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp',
92 }, 94 },
93 'sources': [ 95 'sources': [
94 '<@(native_libs_paths)', 96 '<@(native_libs_paths)',
Yaron 2013/03/29 00:17:03 It seems like this is unneeded now. Actually proba
cjhopman 2013/03/29 20:37:09 Done.
95 ], 97 ],
96 # Pass the jar path to the apk's "fake" jar target. This would be better as 98 # Pass the jar path to the apk's "fake" jar target. This would be better as
97 # direct_dependent_settings, but a variable set by a direct_dependent_settings 99 # direct_dependent_settings, but a variable set by a direct_dependent_settings
98 # cannot be lifted in a dependent to all_dependent_settings. 100 # cannot be lifted in a dependent to all_dependent_settings.
99 'all_dependent_settings': { 101 'all_dependent_settings': {
100 'variables': { 102 'variables': {
101 'apk_output_jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', 103 'apk_output_jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)',
102 }, 104 },
103 }, 105 },
104 'rules': [
105 {
106 'rule_name': 'copy_and_strip_native_libraries',
107 'extension': 'so',
108 'variables': {
109 'apk_libraries_dir': '<(intermediate_dir)/libs/<(android_app_abi)',
110 'stripped_library_path': '<(apk_libraries_dir)/<(RULE_INPUT_ROOT).so',
111 },
112 'inputs': [
113 '<(DEPTH)/build/android/strip_library_for_apk.py',
114 ],
115 'outputs': [
116 '<(stripped_library_path)',
117 ],
118 'action': [
119 'python', '<(DEPTH)/build/android/strip_library_for_apk.py',
120 '--android-strip=<(android_strip)',
121 '--android-strip-arg=--strip-unneeded',
122 '--stripped-libraries-dir=<(apk_libraries_dir)',
123 '<(RULE_INPUT_PATH)',
124 ],
125 },
126 ],
127 'conditions': [ 106 'conditions': [
128 ['resource_dir!=""', { 107 ['resource_dir!=""', {
129 'variables': { 108 'variables': {
130 'resource_input_paths': [ '<!@(find <(resource_dir) -name "*")' ] 109 'resource_input_paths': [ '<!@(find <(resource_dir) -name "*")' ]
131 }, 110 },
132 }], 111 }],
133 ['R_package != ""', { 112 ['R_package != ""', {
134 'variables': { 113 'variables': {
135 # We generate R.java in package R_package (in addition to the package 114 # We generate R.java in package R_package (in addition to the package
136 # listed in the AndroidManifest.xml, which is unavoidable). 115 # listed in the AndroidManifest.xml, which is unavoidable).
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 '<(native_libraries_stamp)', 154 '<(native_libraries_stamp)',
176 ], 155 ],
177 'action': [ 156 'action': [
178 'python', '<(DEPTH)/build/android/create_native_libraries_java.py', 157 'python', '<(DEPTH)/build/android/create_native_libraries_java.py',
179 '--template=<(native_libraries_template)', 158 '--template=<(native_libraries_template)',
180 '--ordered-libraries=<(ordered_libraries_path)', 159 '--ordered-libraries=<(ordered_libraries_path)',
181 '--output=<(native_libraries_java_path)', 160 '--output=<(native_libraries_java_path)',
182 '--stamp=<(native_libraries_stamp)', 161 '--stamp=<(native_libraries_stamp)',
183 ], 162 ],
184 }, 163 },
164 {
165 'action_name': 'strip_native_libraries',
166 'message': 'Stripping libraries for <(_target_name)',
167 'variables': {
168 'apk_libraries_dir': '<(intermediate_dir)/libs/<(android_app_abi)',
169 },
170 'inputs': [
171 '<(DEPTH)/build/android/pylib/build_utils.py',
172 '<(DEPTH)/build/android/strip_library_for_apk.py',
173 '<(ordered_libraries_path)'
174 ],
175 'outputs': [
176 '<(strip_stamp)',
177 ],
178 'action': [
179 'python', '<(DEPTH)/build/android/strip_library_for_apk.py',
180 '--android-strip=<(android_strip)',
181 '--android-strip-arg=--strip-unneeded',
182 '--stripped-libraries-dir=<(apk_libraries_dir)',
183 '--libraries-dir=<(SHARED_LIB_DIR)',
184 '--libraries-file=<(ordered_libraries_path)',
185 ],
186 },
185 ], 187 ],
186 }], 188 }],
187 ['java_strings_grd != ""', { 189 ['java_strings_grd != ""', {
188 'variables': { 190 'variables': {
189 'res_grit_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)_apk/res_grit ', 191 'res_grit_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)_apk/res_grit ',
190 'additional_res_dirs': ['<(res_grit_dir)'], 192 'additional_res_dirs': ['<(res_grit_dir)'],
191 # grit_grd_file is used by grit_action.gypi, included below. 193 # grit_grd_file is used by grit_action.gypi, included below.
192 'grit_grd_file': '<(java_in_dir)/strings/<(java_strings_grd)', 194 'grit_grd_file': '<(java_in_dir)/strings/<(java_strings_grd)',
193 'resource_input_paths': [ 195 'resource_input_paths': [
194 '<!@pymod_do_main(grit_info <@(grit_defines) --outputs "<(res_grit_dir )" <(grit_grd_file))' 196 '<!@pymod_do_main(grit_info <@(grit_defines) --outputs "<(res_grit_dir )" <(grit_grd_file))'
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 392
391 '>@(dex_inputs)', 393 '>@(dex_inputs)',
392 '>@(dex_generated_inputs)', 394 '>@(dex_generated_inputs)',
393 ] 395 ]
394 }, 396 },
395 { 397 {
396 'action_name': 'ant_package_<(_target_name)', 398 'action_name': 'ant_package_<(_target_name)',
397 'message': 'Packaging <(_target_name).', 399 'message': 'Packaging <(_target_name).',
398 'inputs': [ 400 'inputs': [
399 '<(DEPTH)/build/android/ant/apk-package.xml', 401 '<(DEPTH)/build/android/ant/apk-package.xml',
400 #TODO(cjhopman): this should be the stripped library paths.
401 '>@(native_libs_paths)',
402 '<(dex_path)', 402 '<(dex_path)',
403 '<(codegen_stamp)', 403 '<(codegen_stamp)',
404 '<(obfuscate_stamp)', 404 '<(obfuscate_stamp)',
405 '<(strip_stamp)',
405 ], 406 ],
406 'conditions': [ 407 'conditions': [
407 ['is_test_apk == 1', { 408 ['is_test_apk == 1', {
408 'variables': { 409 'variables': {
409 'additional_res_dirs=': [], 410 'additional_res_dirs=': [],
410 'additional_res_packages=': [], 411 'additional_res_packages=': [],
411 } 412 }
412 }], 413 }],
413 ], 414 ],
414 'outputs': [ 415 'outputs': [
(...skipping 24 matching lines...) Expand all
439 440
440 # Add list of inputs to the command line, so if inputs change 441 # Add list of inputs to the command line, so if inputs change
441 # (e.g. if a Java file is removed), the command will be re-run. 442 # (e.g. if a Java file is removed), the command will be re-run.
442 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. 443 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja.
443 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', 444 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)',
444 445
445 ] 446 ]
446 }, 447 },
447 ], 448 ],
448 } 449 }
OLDNEW
« no previous file with comments | « build/android/strip_library_for_apk.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698