| 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("//build/config/android/config.gni") | 5 import("//build/config/android/config.gni") |
| 6 import("//build/config/android/internal_rules.gni") | 6 import("//build/config/android/internal_rules.gni") |
| 7 import("//tools/grit/grit_rule.gni") | 7 import("//tools/grit/grit_rule.gni") |
| 8 | 8 |
| 9 assert(is_android) | 9 assert(is_android) |
| 10 | 10 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 ] | 62 ] |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 | 65 |
| 66 config("jni_includes_${target_name}") { | 66 config("jni_includes_${target_name}") { |
| 67 include_dirs = [ base_output_dir ] | 67 include_dirs = [ base_output_dir ] |
| 68 } | 68 } |
| 69 | 69 |
| 70 group(target_name) { | 70 group(target_name) { |
| 71 deps = [ ":$foreach_target_name" ] | 71 deps = [ ":$foreach_target_name" ] |
| 72 direct_dependent_configs = [ ":jni_includes_${target_name}" ] | 72 public_configs = [ ":jni_includes_${target_name}" ] |
| 73 | 73 |
| 74 if (defined(invoker.deps)) { | 74 if (defined(invoker.deps)) { |
| 75 deps += invoker.deps | 75 deps += invoker.deps |
| 76 } | 76 } |
| 77 if (defined(invoker.forward_dependent_configs_from)) { | 77 if (defined(invoker.public_deps)) { |
| 78 forward_dependent_configs_from = invoker.forward_dependent_configs_from | 78 public_deps = invoker.public_deps |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 | 82 |
| 83 | 83 |
| 84 # Declare a jni target for a prebuilt jar | 84 # Declare a jni target for a prebuilt jar |
| 85 # | 85 # |
| 86 # This target generates the native jni bindings for a set of classes in a .jar. | 86 # This target generates the native jni bindings for a set of classes in a .jar. |
| 87 # | 87 # |
| 88 # See base/android/jni_generator/jni_generator.py for more info about the | 88 # See base/android/jni_generator/jni_generator.py for more info about the |
| 89 # format of generating JNI bindings. | 89 # format of generating JNI bindings. |
| 90 # | 90 # |
| 91 # Variables | 91 # Variables |
| 92 # classes: list of .class files in the jar to generate jni for. These should | 92 # classes: list of .class files in the jar to generate jni for. These should |
| 93 # include the full path to the .class file. | 93 # include the full path to the .class file. |
| 94 # jni_package: subdirectory path for generated bindings | 94 # jni_package: subdirectory path for generated bindings |
| 95 # jar_file: the path to the .jar. If not provided, will default to the sdk's | 95 # jar_file: the path to the .jar. If not provided, will default to the sdk's |
| 96 # android.jar | 96 # android.jar |
| 97 # | 97 # |
| 98 # deps, forward_dependent_configs_from: As normal | 98 # deps, public_deps: As normal |
| 99 # | 99 # |
| 100 # Example | 100 # Example |
| 101 # generate_jar_jni("foo_jni") { | 101 # generate_jar_jni("foo_jni") { |
| 102 # classes = [ | 102 # classes = [ |
| 103 # "android/view/Foo.class", | 103 # "android/view/Foo.class", |
| 104 # ] | 104 # ] |
| 105 # jni_package = "foo" | 105 # jni_package = "foo" |
| 106 # } | 106 # } |
| 107 template("generate_jar_jni") { | 107 template("generate_jar_jni") { |
| 108 assert(defined(invoker.classes)) | 108 assert(defined(invoker.classes)) |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 config("jni_includes_${target_name}") { | 157 config("jni_includes_${target_name}") { |
| 158 include_dirs = [ base_output_dir ] | 158 include_dirs = [ base_output_dir ] |
| 159 } | 159 } |
| 160 | 160 |
| 161 group(target_name) { | 161 group(target_name) { |
| 162 deps = jni_actions | 162 deps = jni_actions |
| 163 if (defined(invoker.deps)) { | 163 if (defined(invoker.deps)) { |
| 164 deps += invoker.deps | 164 deps += invoker.deps |
| 165 } | 165 } |
| 166 if (defined(invoker.forward_dependent_configs_from)) { | 166 if (defined(invoker.public_deps)) { |
| 167 forward_dependent_configs_from = invoker.forward_dependent_configs_from | 167 public_deps = invoker.public_deps |
| 168 } | 168 } |
| 169 direct_dependent_configs = [ ":jni_includes_${target_name}" ] | 169 public_configs = [ ":jni_includes_${target_name}" ] |
| 170 } | 170 } |
| 171 } | 171 } |
| 172 | 172 |
| 173 | 173 |
| 174 # Declare a target for c-preprocessor-generated java files | 174 # Declare a target for c-preprocessor-generated java files |
| 175 # | 175 # |
| 176 # This target generates java files using the host C pre-processor. Each file in | 176 # This target generates java files using the host C pre-processor. Each file in |
| 177 # sources will be compiled using the C pre-processor. If include_path is | 177 # sources will be compiled using the C pre-processor. If include_path is |
| 178 # specified, it will be passed (with --I) to the pre-processor. | 178 # specified, it will be passed (with --I) to the pre-processor. |
| 179 # | 179 # |
| (...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1063 args = [ | 1063 args = [ |
| 1064 "--files=$rebased_binaries_list", | 1064 "--files=$rebased_binaries_list", |
| 1065 "--files=@FileArg($rebased_libraries_list:libraries)", | 1065 "--files=@FileArg($rebased_libraries_list:libraries)", |
| 1066 ] | 1066 ] |
| 1067 } | 1067 } |
| 1068 | 1068 |
| 1069 group(target_name) { | 1069 group(target_name) { |
| 1070 deps = final_deps | 1070 deps = final_deps |
| 1071 } | 1071 } |
| 1072 } | 1072 } |
| OLD | NEW |