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 # Do not add any imports to non-//build directories here. | 5 # Do not add any imports to non-//build directories here. |
6 # Some projects (e.g. V8) do not have non-build directories DEPS'ed in. | 6 # Some projects (e.g. V8) do not have non-build directories DEPS'ed in. |
7 import("//build/config/android/config.gni") | 7 import("//build/config/android/config.gni") |
8 import("//build/config/android/internal_rules.gni") | 8 import("//build/config/android/internal_rules.gni") |
9 import("//build/config/compiler/compiler.gni") | 9 import("//build/config/compiler/compiler.gni") |
10 import("//build/config/dcheck_always_on.gni") | 10 import("//build/config/dcheck_always_on.gni") |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 # android_library target's srcjar_deps will make the generated java files be | 347 # android_library target's srcjar_deps will make the generated java files be |
348 # included in that library's final outputs. | 348 # included in that library's final outputs. |
349 # | 349 # |
350 # Variables | 350 # Variables |
351 # sources: list of files to be processed by the C pre-processor. For each | 351 # sources: list of files to be processed by the C pre-processor. For each |
352 # file in sources, there will be one .java file in the final .srcjar. For
a | 352 # file in sources, there will be one .java file in the final .srcjar. For
a |
353 # file named FooBar.template, a java file will be created with name | 353 # file named FooBar.template, a java file will be created with name |
354 # FooBar.java. | 354 # FooBar.java. |
355 # inputs: additional compile-time dependencies. Any files | 355 # inputs: additional compile-time dependencies. Any files |
356 # `#include`-ed in the templates should be listed here. | 356 # `#include`-ed in the templates should be listed here. |
357 # package_name: this will be the subdirectory for each .java file in the | 357 # package_path: this will be the subdirectory for each .java file in the |
358 # .srcjar. | 358 # .srcjar. |
359 # | 359 # |
360 # Example | 360 # Example |
361 # java_cpp_template("foo_generated_enum") { | 361 # java_cpp_template("foo_generated_enum") { |
362 # sources = [ | 362 # sources = [ |
363 # "android/java/templates/Foo.template", | 363 # "android/java/templates/Foo.template", |
364 # ] | 364 # ] |
365 # inputs = [ | 365 # inputs = [ |
366 # "android/java/templates/native_foo_header.h", | 366 # "android/java/templates/native_foo_header.h", |
367 # ] | 367 # ] |
368 # | 368 # |
369 # package_name = "org/chromium/base/library_loader" | 369 # package_path = "org/chromium/base/library_loader" |
370 # include_path = "android/java/templates" | 370 # include_path = "android/java/templates" |
371 # } | 371 # } |
372 template("java_cpp_template") { | 372 template("java_cpp_template") { |
373 set_sources_assignment_filter([]) | 373 set_sources_assignment_filter([]) |
374 forward_variables_from(invoker, [ "testonly" ]) | 374 forward_variables_from(invoker, [ "testonly" ]) |
375 | 375 |
376 _include_path = "//" | 376 _include_path = "//" |
377 if (defined(invoker.include_path)) { | 377 if (defined(invoker.include_path)) { |
378 _include_path = invoker.include_path | 378 _include_path = invoker.include_path |
379 } | 379 } |
380 | 380 |
381 _apply_gcc_target_name = "${target_name}__apply_gcc" | 381 _apply_gcc_target_name = "${target_name}__apply_gcc" |
382 _base_gen_dir = "${target_gen_dir}/${target_name}/java_cpp_template" | 382 _base_gen_dir = "${target_gen_dir}/${target_name}/java_cpp_template" |
383 | 383 |
| 384 if (defined(invoker.package_path)) { |
| 385 package_path = invoker.package_path |
| 386 } else { |
| 387 # TODO(jbudorick): Back this out once all clients have been switched to |
| 388 # package_path. |
| 389 assert(defined(invoker.package_name)) |
| 390 package_path = invoker.package_name |
| 391 } |
| 392 |
384 action_foreach(_apply_gcc_target_name) { | 393 action_foreach(_apply_gcc_target_name) { |
385 forward_variables_from(invoker, | 394 forward_variables_from(invoker, |
386 [ | 395 [ |
387 "deps", | 396 "deps", |
388 "public_deps", | 397 "public_deps", |
389 "data_deps", | 398 "data_deps", |
390 ]) | 399 ]) |
391 script = "//build/android/gyp/gcc_preprocess.py" | 400 script = "//build/android/gyp/gcc_preprocess.py" |
392 if (defined(invoker.inputs)) { | 401 if (defined(invoker.inputs)) { |
393 inputs = invoker.inputs + [] | 402 inputs = invoker.inputs + [] |
394 } | 403 } |
395 depfile = | 404 depfile = |
396 "${target_gen_dir}/${invoker.target_name}_{{source_name_part}}.d" | 405 "${target_gen_dir}/${invoker.target_name}_{{source_name_part}}.d" |
397 | 406 |
398 sources = invoker.sources | 407 sources = invoker.sources |
399 | 408 |
400 outputs = [ | 409 outputs = [ |
401 "$_base_gen_dir/${invoker.package_name}/{{source_name_part}}.java", | 410 "$_base_gen_dir/${package_path}/{{source_name_part}}.java", |
402 ] | 411 ] |
403 | 412 |
404 args = [ | 413 args = [ |
405 "--depfile", | 414 "--depfile", |
406 rebase_path(depfile, root_build_dir), | 415 rebase_path(depfile, root_build_dir), |
407 "--include-path", | 416 "--include-path", |
408 rebase_path(_include_path, root_build_dir), | 417 rebase_path(_include_path, root_build_dir), |
409 "--output", | 418 "--output", |
410 rebase_path(outputs[0], root_build_dir), | 419 rebase_path(outputs[0], root_build_dir), |
411 "--template={{source}}", | 420 "--template={{source}}", |
(...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1803 _rebased_android_readelf = rebase_path(android_readelf, root_build_dir) | 1812 _rebased_android_readelf = rebase_path(android_readelf, root_build_dir) |
1804 args = [ | 1813 args = [ |
1805 "--readelf=$_rebased_android_readelf", | 1814 "--readelf=$_rebased_android_readelf", |
1806 "--output=$_rebased_ordered_libraries_json", | 1815 "--output=$_rebased_ordered_libraries_json", |
1807 "--libraries-dir=.", | 1816 "--libraries-dir=.", |
1808 "--input-libraries=@FileArg($_rebased_build_config:native:libraries)", | 1817 "--input-libraries=@FileArg($_rebased_build_config:native:libraries)", |
1809 ] | 1818 ] |
1810 } | 1819 } |
1811 | 1820 |
1812 java_cpp_template("${_template_name}__native_libraries_java") { | 1821 java_cpp_template("${_template_name}__native_libraries_java") { |
1813 package_name = "org/chromium/base/library_loader" | 1822 package_path = "org/chromium/base/library_loader" |
1814 sources = [ | 1823 sources = [ |
1815 "//base/android/java/templates/NativeLibraries.template", | 1824 "//base/android/java/templates/NativeLibraries.template", |
1816 ] | 1825 ] |
1817 inputs = [ | 1826 inputs = [ |
1818 _ordered_libraries_json, | 1827 _ordered_libraries_json, |
1819 ] | 1828 ] |
1820 deps = [ | 1829 deps = [ |
1821 ":${_ordered_libraries_target}", | 1830 ":${_ordered_libraries_target}", |
1822 ] | 1831 ] |
1823 if (_native_lib_version_rule != "") { | 1832 if (_native_lib_version_rule != "") { |
(...skipping 13 matching lines...) Expand all Loading... |
1837 } | 1846 } |
1838 if (_enable_chromium_linker_tests) { | 1847 if (_enable_chromium_linker_tests) { |
1839 defines += [ "ENABLE_CHROMIUM_LINKER_TESTS" ] | 1848 defines += [ "ENABLE_CHROMIUM_LINKER_TESTS" ] |
1840 } | 1849 } |
1841 } | 1850 } |
1842 _srcjar_deps += [ ":${_template_name}__native_libraries_java" ] | 1851 _srcjar_deps += [ ":${_template_name}__native_libraries_java" ] |
1843 } | 1852 } |
1844 | 1853 |
1845 if (_generate_buildconfig_java) { | 1854 if (_generate_buildconfig_java) { |
1846 java_cpp_template("${_template_name}__build_config_java") { | 1855 java_cpp_template("${_template_name}__build_config_java") { |
1847 package_name = "org/chromium/base" | 1856 package_path = "org/chromium/base" |
1848 sources = [ | 1857 sources = [ |
1849 "//base/android/java/templates/BuildConfig.template", | 1858 "//base/android/java/templates/BuildConfig.template", |
1850 ] | 1859 ] |
1851 deps = [ | 1860 deps = [ |
1852 ":$build_config_target", | 1861 ":$build_config_target", |
1853 ] | 1862 ] |
1854 | 1863 |
1855 defines = [] | 1864 defines = [] |
1856 if (enable_multidex) { | 1865 if (enable_multidex) { |
1857 defines += [ "ENABLE_MULTIDEX" ] | 1866 defines += [ "ENABLE_MULTIDEX" ] |
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2893 # because in practice they seem to contain classes required to be in the | 2902 # because in practice they seem to contain classes required to be in the |
2894 # classpath. | 2903 # classpath. |
2895 deps += _subjar_targets | 2904 deps += _subjar_targets |
2896 } | 2905 } |
2897 if (defined(_res_target_name)) { | 2906 if (defined(_res_target_name)) { |
2898 deps += [ ":$_res_target_name" ] | 2907 deps += [ ":$_res_target_name" ] |
2899 } | 2908 } |
2900 } | 2909 } |
2901 } | 2910 } |
2902 } | 2911 } |
OLD | NEW |