OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import("//base/android/linker/config.gni") | 5 import("//base/android/linker/config.gni") |
6 import("//build/config/android/config.gni") | 6 import("//build/config/android/config.gni") |
7 import("//build/config/android/internal_rules.gni") | 7 import("//build/config/android/internal_rules.gni") |
8 import("//tools/grit/grit_rule.gni") | 8 import("//tools/grit/grit_rule.gni") |
9 import("//tools/relocation_packer/config.gni") | 9 import("//tools/relocation_packer/config.gni") |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 args = [ | 60 args = [ |
61 "--depfile", | 61 "--depfile", |
62 rebase_path(depfile, root_build_dir), | 62 rebase_path(depfile, root_build_dir), |
63 "--input_file={{source}}", | 63 "--input_file={{source}}", |
64 "--optimize_generation=1", | 64 "--optimize_generation=1", |
65 "--ptr_type=long", | 65 "--ptr_type=long", |
66 "--output_dir", | 66 "--output_dir", |
67 rebase_path(jni_output_dir, root_build_dir), | 67 rebase_path(jni_output_dir, root_build_dir), |
68 "--includes", | 68 "--includes", |
69 rebase_path(jni_generator_include, "//"), | 69 rebase_path(jni_generator_include, "//"), |
| 70 "--native_exports_optional", |
70 ] | 71 ] |
71 if (defined(invoker.jni_generator_jarjar_file)) { | 72 if (defined(invoker.jni_generator_jarjar_file)) { |
72 args += [ | 73 args += [ |
73 "--jarjar", | 74 "--jarjar", |
74 rebase_path(jni_generator_jarjar_file, root_build_dir), | 75 rebase_path(jni_generator_jarjar_file, root_build_dir), |
75 ] | 76 ] |
76 } | 77 } |
77 if (!is_clang) { | |
78 # Clang builds currently fail with --native_exports_optional due to | |
79 # http://llvm.org/bugs/show_bug.cgi?id=22602 - only enable for gcc. | |
80 # http://crbug.com/442327 | |
81 args += [ "--native_exports_optional" ] | |
82 } | |
83 } | 78 } |
84 | 79 |
85 config("jni_includes_${target_name}") { | 80 config("jni_includes_${target_name}") { |
86 # TODO(cjhopman): #includes should probably all be relative to | 81 # TODO(cjhopman): #includes should probably all be relative to |
87 # base_output_dir. Remove that from this config once the includes are | 82 # base_output_dir. Remove that from this config once the includes are |
88 # updated. | 83 # updated. |
89 include_dirs = [ | 84 include_dirs = [ |
90 base_output_dir, | 85 base_output_dir, |
91 package_output_dir, | 86 package_output_dir, |
92 ] | 87 ] |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 "--jar_file", | 177 "--jar_file", |
183 rebase_path(jar_file, root_build_dir), | 178 rebase_path(jar_file, root_build_dir), |
184 "--input_file", | 179 "--input_file", |
185 class, | 180 class, |
186 "--optimize_generation=1", | 181 "--optimize_generation=1", |
187 "--ptr_type=long", | 182 "--ptr_type=long", |
188 "--output_dir", | 183 "--output_dir", |
189 rebase_path(jni_output_dir, root_build_dir), | 184 rebase_path(jni_output_dir, root_build_dir), |
190 "--includes", | 185 "--includes", |
191 rebase_path(jni_generator_include, root_build_dir), | 186 rebase_path(jni_generator_include, root_build_dir), |
| 187 "--native_exports_optional", |
192 ] | 188 ] |
193 if (!is_clang) { | |
194 # Clang builds currently fail with --native_exports_optional due to | |
195 # http://llvm.org/bugs/show_bug.cgi?id=22602 - only enable for gcc. | |
196 # http://crbug.com/442327 | |
197 args += [ "--native_exports_optional" ] | |
198 } | |
199 } | 189 } |
200 } | 190 } |
201 | 191 |
202 config("jni_includes_${target_name}") { | 192 config("jni_includes_${target_name}") { |
203 include_dirs = [ base_output_dir ] | 193 include_dirs = [ base_output_dir ] |
204 } | 194 } |
205 | 195 |
206 group(target_name) { | 196 group(target_name) { |
207 deps = jni_actions | 197 deps = jni_actions |
208 if (defined(invoker.deps)) { | 198 if (defined(invoker.deps)) { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 # android_library target's srcjar_deps will make the generated java files be | 318 # android_library target's srcjar_deps will make the generated java files be |
329 # included in that library's final outputs. | 319 # included in that library's final outputs. |
330 # | 320 # |
331 # Variables | 321 # Variables |
332 # sources: list of files to be processed by the script. For each annotated | 322 # sources: list of files to be processed by the script. For each annotated |
333 # enum contained in the sources files the script will generate a .java | 323 # enum contained in the sources files the script will generate a .java |
334 # file with the same name as the name of the enum. | 324 # file with the same name as the name of the enum. |
335 # | 325 # |
336 # outputs: list of outputs, relative to the output_dir. These paths are | 326 # outputs: list of outputs, relative to the output_dir. These paths are |
337 # verified at build time by the script. To get the list programatically run: | 327 # verified at build time by the script. To get the list programatically run: |
338 # python build/android/gyp/java_cpp_enum.py --output_dir=. \ | 328 # python build/android/gyp/java_cpp_enum.py \ |
339 # --print_output_only path/to/header/file.h | 329 # --print_output_only . path/to/header/file.h |
340 # | 330 # |
341 # Example | 331 # Example |
342 # java_cpp_enum("foo_generated_enum") { | 332 # java_cpp_enum("foo_generated_enum") { |
343 # sources = [ | 333 # sources = [ |
344 # "src/native_foo_header.h", | 334 # "src/native_foo_header.h", |
345 # ] | 335 # ] |
346 # outputs = [ | 336 # outputs = [ |
347 # "org/chromium/FooEnum.java", | 337 # "org/chromium/FooEnum.java", |
348 # ] | 338 # ] |
349 # } | 339 # } |
350 template("java_cpp_enum") { | 340 template("java_cpp_enum") { |
351 set_sources_assignment_filter([]) | 341 set_sources_assignment_filter([]) |
352 if (defined(invoker.testonly)) { | 342 if (defined(invoker.testonly)) { |
353 testonly = invoker.testonly | 343 testonly = invoker.testonly |
354 } | 344 } |
355 | 345 |
356 assert(defined(invoker.sources)) | 346 assert(defined(invoker.sources)) |
357 assert(defined(invoker.outputs)) | 347 assert(defined(invoker.outputs)) |
358 | 348 |
359 action("${target_name}__generate_enum") { | 349 action("${target_name}__generate_enum") { |
360 # The sources aren't compiled so don't check their dependencies. | 350 # The sources aren't compiled so don't check their dependencies. |
361 check_includes = false | 351 check_includes = false |
362 | 352 |
363 sources = invoker.sources | 353 sources = invoker.sources |
364 script = "//build/android/gyp/java_cpp_enum.py" | 354 script = "//build/android/gyp/java_cpp_enum.py" |
365 gen_dir = "${target_gen_dir}/${target_name}/enums" | 355 gen_dir = "${target_gen_dir}/${target_name}/enums" |
366 outputs = | 356 outputs = |
367 get_path_info(rebase_path(invoker.outputs, ".", gen_dir), "abspath") | 357 get_path_info(rebase_path(invoker.outputs, ".", gen_dir), "abspath") |
368 | 358 |
369 args = [ | 359 args = [] |
370 "--output_dir", | |
371 rebase_path(gen_dir, root_build_dir), | |
372 ] | |
373 foreach(output, rebase_path(outputs, root_build_dir)) { | 360 foreach(output, rebase_path(outputs, root_build_dir)) { |
374 args += [ | 361 args += [ |
375 "--assert_file", | 362 "--assert_file", |
376 output, | 363 output, |
377 ] | 364 ] |
378 } | 365 } |
| 366 args += [ rebase_path(gen_dir, root_build_dir) ] |
379 args += rebase_path(invoker.sources, root_build_dir) | 367 args += rebase_path(invoker.sources, root_build_dir) |
380 } | 368 } |
381 | 369 |
382 generate_enum_outputs = get_target_outputs(":${target_name}__generate_enum") | 370 generate_enum_outputs = get_target_outputs(":${target_name}__generate_enum") |
383 base_gen_dir = | 371 base_gen_dir = |
384 get_label_info(":${target_name}__generate_enum", "target_gen_dir") | 372 get_label_info(":${target_name}__generate_enum", "target_gen_dir") |
385 | 373 |
386 srcjar_path = "${target_gen_dir}/${target_name}.srcjar" | 374 srcjar_path = "${target_gen_dir}/${target_name}.srcjar" |
387 zip("${target_name}__zip_srcjar") { | 375 zip("${target_name}__zip_srcjar") { |
388 inputs = generate_enum_outputs | 376 inputs = generate_enum_outputs |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 # | 1025 # |
1038 # Variables | 1026 # Variables |
1039 # deps: specifies the dependencies of this target. Android libraries in deps | 1027 # deps: specifies the dependencies of this target. Android libraries in deps |
1040 # will be packaged into the resulting .dex.jar file. | 1028 # will be packaged into the resulting .dex.jar file. |
1041 # dex_path: location at which the output file will be put | 1029 # dex_path: location at which the output file will be put |
1042 template("android_standalone_library") { | 1030 template("android_standalone_library") { |
1043 set_sources_assignment_filter([]) | 1031 set_sources_assignment_filter([]) |
1044 deps_dex(target_name) { | 1032 deps_dex(target_name) { |
1045 deps = invoker.deps | 1033 deps = invoker.deps |
1046 dex_path = invoker.dex_path | 1034 dex_path = invoker.dex_path |
| 1035 if (defined(invoker.excluded_jars)) { |
| 1036 excluded_jars = invoker.excluded_jars |
| 1037 } |
1047 } | 1038 } |
1048 } | 1039 } |
1049 | 1040 |
1050 # Declare an Android library target for a prebuilt jar | 1041 # Declare an Android library target for a prebuilt jar |
1051 # | 1042 # |
1052 # This target creates an Android library containing java code and Android | 1043 # This target creates an Android library containing java code and Android |
1053 # resources. | 1044 # resources. |
1054 # | 1045 # |
1055 # Variables | 1046 # Variables |
1056 # deps: Specifies the dependencies of this target. Java targets in this list | 1047 # deps: Specifies the dependencies of this target. Java targets in this list |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1745 template("uiautomator_test") { | 1736 template("uiautomator_test") { |
1746 set_sources_assignment_filter([]) | 1737 set_sources_assignment_filter([]) |
1747 if (defined(invoker.testonly)) { | 1738 if (defined(invoker.testonly)) { |
1748 testonly = invoker.testonly | 1739 testonly = invoker.testonly |
1749 } | 1740 } |
1750 assert(target_name != "") | 1741 assert(target_name != "") |
1751 assert(invoker.deps != [] || true) | 1742 assert(invoker.deps != [] || true) |
1752 group(target_name) { | 1743 group(target_name) { |
1753 } | 1744 } |
1754 } | 1745 } |
OLD | NEW |