Adam Michael | 8741940 | 2017-01-05 16:05:56 +0000 | [diff] [blame] | 1 | package(default_visibility = ["//visibility:public"]) |
| 2 | |
| 3 | alias( |
| 4 | name = "sdk", |
| 5 | actual = "//external:android/sdk", |
| 6 | ) |
| 7 | |
| 8 | android_library( |
| 9 | name = "incremental_stub_application", |
| 10 | deps = ["//src/tools/android/java/com/google/devtools/build/android/incrementaldeployment:incremental_stub_application"], |
| 11 | ) |
| 12 | |
| 13 | android_library( |
| 14 | name = "incremental_split_stub_application", |
| 15 | deps = ["//src/tools/android/java/com/google/devtools/build/android/incrementaldeployment:incremental_split_stub_application"], |
| 16 | ) |
| 17 | |
| 18 | alias( |
Googler | 7ba40f8 | 2017-02-08 20:10:46 +0000 | [diff] [blame] | 19 | name = "busybox", |
| 20 | actual = "//src/tools/android/java/com/google/devtools/build/android:ResourceProcessorBusyBox", |
Adam Michael | 8741940 | 2017-01-05 16:05:56 +0000 | [diff] [blame] | 21 | ) |
| 22 | |
| 23 | alias( |
| 24 | name = "merge_dexzips", |
| 25 | actual = "//src/tools/android/java/com/google/devtools/build/android/ziputils:reducer", |
| 26 | ) |
| 27 | |
| 28 | alias( |
| 29 | name = "shuffle_jars", |
| 30 | actual = "//src/tools/android/java/com/google/devtools/build/android/ziputils:mapper", |
| 31 | ) |
| 32 | |
| 33 | alias( |
| 34 | name = "dexbuilder", |
| 35 | actual = "//src/tools/android/java/com/google/devtools/build/android/dexer:DexBuilder", |
| 36 | ) |
| 37 | |
| 38 | alias( |
| 39 | name = "dexmerger", |
| 40 | actual = "//src/tools/android/java/com/google/devtools/build/android/dexer:DexFileMerger", |
| 41 | ) |
| 42 | |
Adam Michael | 29aa0eb | 2017-02-10 02:43:34 +0000 | [diff] [blame] | 43 | alias( |
Adam Michael | 8741940 | 2017-01-05 16:05:56 +0000 | [diff] [blame] | 44 | name = "desugar_java8", |
ajmichael | 20824c1 | 2017-05-10 11:17:30 -0400 | [diff] [blame] | 45 | actual = "//src/tools/android/java/com/google/devtools/build/android/desugar:Desugar_embedded", |
Adam Michael | 8741940 | 2017-01-05 16:05:56 +0000 | [diff] [blame] | 46 | ) |
| 47 | |
Adam Michael | 29aa0eb | 2017-02-10 02:43:34 +0000 | [diff] [blame] | 48 | # Bazel puts this on the bootclasspath of android_* targets to support Java 8 |
| 49 | # if requested. |
Adam Michael | 8741940 | 2017-01-05 16:05:56 +0000 | [diff] [blame] | 50 | filegroup( |
| 51 | name = "desugar_java8_extra_bootclasspath", |
cushon | 40d9cb3 | 2017-05-06 12:15:25 -0400 | [diff] [blame] | 52 | srcs = ["java_lang_extras.jar"], |
Adam Michael | 8741940 | 2017-01-05 16:05:56 +0000 | [diff] [blame] | 53 | visibility = ["//visibility:public"], |
| 54 | ) |
| 55 | |
cushon | 40d9cb3 | 2017-05-06 12:15:25 -0400 | [diff] [blame] | 56 | # javac needs this Jar to compile lambdas, method references, and type annotations. |
| 57 | # These classes are not part of the android.jar. |
Adam Michael | 29aa0eb | 2017-02-10 02:43:34 +0000 | [diff] [blame] | 58 | genrule( |
cushon | 40d9cb3 | 2017-05-06 12:15:25 -0400 | [diff] [blame] | 59 | name = "gen_java_lang_extras_jar", |
Adam Michael | 29aa0eb | 2017-02-10 02:43:34 +0000 | [diff] [blame] | 60 | srcs = [ |
Adam Michael | 29aa0eb | 2017-02-10 02:43:34 +0000 | [diff] [blame] | 61 | "@local_jdk//:bootclasspath" |
| 62 | ], |
Adam Michael | b95d4a9 | 2017-02-10 22:21:47 +0000 | [diff] [blame] | 63 | tools = [ |
xingao | 202d591 | 2017-06-01 19:23:29 +0200 | [diff] [blame] | 64 | "@bazel_tools//tools/jdk:singlejar", |
Adam Michael | b95d4a9 | 2017-02-10 22:21:47 +0000 | [diff] [blame] | 65 | ], |
cushon | 40d9cb3 | 2017-05-06 12:15:25 -0400 | [diff] [blame] | 66 | outs = ["java_lang_extras.jar"], |
Adam Michael | 29aa0eb | 2017-02-10 02:43:34 +0000 | [diff] [blame] | 67 | cmd = """ |
| 68 | for jar in $(locations @local_jdk//:bootclasspath); do |
| 69 | if [[ "$${jar}" == *"/rt.jar" ]]; then |
xingao | 202d591 | 2017-06-01 19:23:29 +0200 | [diff] [blame] | 70 | $(location @bazel_tools//tools/jdk:singlejar) \ |
Adam Michael | 29aa0eb | 2017-02-10 02:43:34 +0000 | [diff] [blame] | 71 | --exclude_build_data \ |
| 72 | --dont_change_compression \ |
| 73 | --sources $${jar} \ |
| 74 | --include_prefixes "java/lang/invoke/" \ |
cushon | 40d9cb3 | 2017-05-06 12:15:25 -0400 | [diff] [blame] | 75 | --include_prefixes "java/lang/annotation/" \ |
Adam Michael | 29aa0eb | 2017-02-10 02:43:34 +0000 | [diff] [blame] | 76 | --output $@ |
| 77 | break |
| 78 | fi |
| 79 | done |
| 80 | """, |
| 81 | visibility = ["//visibility:private"], |
| 82 | ) |
| 83 | |
Adam Michael | 8741940 | 2017-01-05 16:05:56 +0000 | [diff] [blame] | 84 | alias( |
| 85 | name = "IdlClass", |
| 86 | actual = "//src/tools/android/java/com/google/devtools/build/android/idlclass:IdlClass", |
| 87 | ) |
| 88 | |
Adam Michael | 2433b60 | 2017-01-06 23:46:51 +0000 | [diff] [blame] | 89 | alias( |
Adam Michael | 8741940 | 2017-01-05 16:05:56 +0000 | [diff] [blame] | 90 | name = "JarFilter", |
Adam Michael | 2433b60 | 2017-01-06 23:46:51 +0000 | [diff] [blame] | 91 | actual = "//src/tools/android/java/com/google/devtools/build/android/ideinfo:JarFilter", |
Adam Michael | 8741940 | 2017-01-05 16:05:56 +0000 | [diff] [blame] | 92 | ) |
| 93 | |
Adam Michael | 2433b60 | 2017-01-06 23:46:51 +0000 | [diff] [blame] | 94 | alias( |
Adam Michael | 8741940 | 2017-01-05 16:05:56 +0000 | [diff] [blame] | 95 | name = "PackageParser", |
Adam Michael | 2433b60 | 2017-01-06 23:46:51 +0000 | [diff] [blame] | 96 | actual = "//src/tools/android/java/com/google/devtools/build/android/ideinfo:PackageParser", |
Adam Michael | 8741940 | 2017-01-05 16:05:56 +0000 | [diff] [blame] | 97 | ) |
| 98 | |
| 99 | py_binary( |
| 100 | name = "merge_manifests", |
| 101 | srcs = [ |
| 102 | "android_permissions.py", |
| 103 | "merge_manifests.py", |
| 104 | ], |
| 105 | deps = [ |
| 106 | "//third_party/py/gflags", |
| 107 | ], |
| 108 | ) |
| 109 | |
| 110 | py_binary( |
| 111 | name = "build_incremental_dexmanifest", |
| 112 | srcs = [":build_incremental_dexmanifest.py"], |
| 113 | deps = [], |
| 114 | ) |
| 115 | |
| 116 | py_binary( |
| 117 | name = "build_split_manifest", |
| 118 | srcs = ["build_split_manifest.py"], |
| 119 | deps = [ |
| 120 | "//third_party/py/gflags", |
| 121 | ], |
| 122 | ) |
| 123 | |
| 124 | py_binary( |
| 125 | name = "incremental_install", |
| 126 | srcs = ["incremental_install.py"], |
| 127 | deps = [ |
| 128 | "//third_party/py/concurrent:futures", |
| 129 | "//third_party/py/gflags", |
| 130 | ], |
| 131 | ) |
| 132 | |
| 133 | py_binary( |
| 134 | name = "strip_resources", |
| 135 | srcs = ["strip_resources.py"], |
| 136 | deps = [ |
| 137 | "//third_party/py/gflags", |
| 138 | ], |
| 139 | ) |
| 140 | |
| 141 | py_binary( |
| 142 | name = "aar_native_libs_zip_creator", |
| 143 | srcs = [ |
| 144 | "aar_native_libs_zip_creator.py", |
| 145 | ], |
| 146 | deps = [ |
| 147 | "//third_party/py/gflags", |
| 148 | ], |
| 149 | ) |
| 150 | |
| 151 | py_binary( |
| 152 | name = "stubify_manifest", |
| 153 | srcs = ["stubify_manifest.py"], |
| 154 | deps = [ |
| 155 | "//third_party/py/gflags", |
| 156 | ], |
| 157 | ) |
| 158 | |
| 159 | sh_binary( |
| 160 | name = "rex_wrapper", |
| 161 | srcs = ["fail.sh"], |
| 162 | ) |
| 163 | |
| 164 | sh_binary( |
| 165 | name = "zip_manifest_creator", |
| 166 | srcs = ["zip_manifest_creator.sh"], |
| 167 | data = ["//tools/zip:zipper"], |
| 168 | ) |
| 169 | |
| 170 | py_binary( |
| 171 | name = "aar_embedded_jars_extractor", |
| 172 | srcs = ["aar_embedded_jars_extractor.py"], |
| 173 | deps = ["//third_party/py/gflags"], |
| 174 | ) |
| 175 | |
| 176 | py_binary( |
| 177 | name = "resource_extractor", |
| 178 | srcs = ["resource_extractor.py"], |
| 179 | ) |
| 180 | |
Adam Michael | d6eaf58 | 2017-01-27 01:57:25 +0000 | [diff] [blame] | 181 | alias( |
| 182 | name = "android_runtest", |
| 183 | actual = "fail.sh", |
| 184 | ) |
| 185 | |
| 186 | alias( |
| 187 | name = "adb_static", |
| 188 | actual = "fail.sh", |
| 189 | ) |
| 190 | |
| 191 | alias( |
| 192 | name = "adb", |
| 193 | actual = "@androidsdk//:adb", |
| 194 | ) |
| 195 | |
Adam Michael | 8741940 | 2017-01-05 16:05:56 +0000 | [diff] [blame] | 196 | # If needed, this file can be regenerated by (validity is 30 * 365 days): |
| 197 | # keytool -genkeypair \ |
| 198 | # -alias androiddebugkey \ |
| 199 | # -dname "CN=Android Debug, O=Android, C=US" \ |
| 200 | # -keystore cica \ |
| 201 | # -sigalg SHA256withDSA \ |
| 202 | # -validity 10950 |
| 203 | filegroup( |
| 204 | name = "debug_keystore", |
| 205 | srcs = ["bazel_debug.keystore"], |
| 206 | ) |
gregce | ed666fc | 2017-04-17 19:42:12 +0200 | [diff] [blame] | 207 | |
| 208 | alias( |
| 209 | name = "databinding_annotation_processor", |
| 210 | actual = "@android_databinding//:annotation_processor", |
| 211 | ) |
ajmichael | 71ed1ee | 2017-05-05 05:15:02 +0200 | [diff] [blame] | 212 | |
| 213 | # This is the default binding of //external:android/sdk. If someone attempts to |
| 214 | # build a rule that depends on //external:android/sdk without setting up |
| 215 | # android_sdk_repository in their WORKSPACE, the genrule will fail with a |
| 216 | # helpful error message. |
| 217 | android_sdk( |
| 218 | name = "poison_pill_android_sdk", |
| 219 | proguard = ":error_message", |
| 220 | aapt = ":error_message", |
| 221 | dx = ":error_message", |
| 222 | main_dex_list_creator = ":error_message", |
| 223 | adb = ":error_message", |
| 224 | framework_aidl = ":error_message", |
| 225 | aidl = ":error_message", |
| 226 | android_jar = ":error_message.jar", |
| 227 | shrinked_android_jar = ":error_message.jar", |
| 228 | annotations_jar = ":error_message.jar", |
| 229 | main_dex_classes = ":error_message", |
| 230 | apksigner = ":error_message", |
| 231 | zipalign = ":error_message", |
| 232 | resource_extractor = "error_message", |
| 233 | ) |
| 234 | |
| 235 | genrule( |
| 236 | name = "no_android_sdk_repository_error", |
| 237 | outs = ["error_message", "error_message.jar"], |
| 238 | cmd = """echo \ |
| 239 | This build requires an Android SDK. Please add the android_sdk_repository \ |
| 240 | rule to your WORKSPACE. ; \ |
| 241 | exit 1 """, |
| 242 | ) |
ajmichael | 22d05eb | 2017-05-31 22:34:34 +0200 | [diff] [blame] | 243 | |
| 244 | # //external:has_androidsdk is bound to either |
| 245 | # @bazel_tools//tools/android:always_true or |
| 246 | # @bazel_tools//tools/android:always_false depending on whether |
| 247 | # android_sdk_repository has run. This allows targets to depend on targets from |
| 248 | # @androidsdk if and only if the user has an android_sdk_repository set up. |
| 249 | |
| 250 | config_feature_flag( |
| 251 | name = "true", |
| 252 | default_value = "true", |
| 253 | allowed_values = ["true", "false"], |
| 254 | ) |
| 255 | |
| 256 | config_setting( |
| 257 | name = "always_true", |
| 258 | flag_values = { |
| 259 | ":true": "true" |
| 260 | }, |
| 261 | ) |
| 262 | |
| 263 | config_setting( |
| 264 | name = "always_false", |
| 265 | flag_values = { |
| 266 | ":true": "false", |
| 267 | }, |
| 268 | ) |