aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/android
Commit message (Collapse)AuthorAge
* This and further changes may contain minor modifications to BUILD files that ↵Gravatar tomlu2017-12-05
| | | | | | | don't serve any apparent purpose. The reason for these changes is that we're switching from checked-in BUILD files to generated BUILD files, and there may be small differences between these files. RELNOTES: None PiperOrigin-RevId: 177949511
* Move bazel conditions into src/conditions.Gravatar tomlu2017-11-30
| | | | | | | This will enable an easier transition from checked-in BUILD files to ones generated by copybara. RELNOTES: None PiperOrigin-RevId: 177514519
* Build databinding annotation processor in host configuration.Gravatar ajmichael2017-11-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, add a fake databinding processor target. Bazel users will need to do something like this: # WORKSPACE local_repository( name = "databinding", path = "./databinding", ) bind( name = "databinding_annotation_processor", actual = "@databinding//:annotation_processor", ) # databinding/BUILD java_plugin( name = "annotation_processor", ... ) ... https://github.com/bazelbuild/bazel/issues/2694 RELNOTES: None PiperOrigin-RevId: 175975110
* Open source ZipFilterBuilder for android_instrumentation_testGravatar jingwen2017-11-13
| | | | | | | GITHUB: #903 RELNOTES: None. PiperOrigin-RevId: 175600267
* Fix ImportError on tools.android for junction_libGravatar jingwen2017-11-06
| | | | | RELNOTES: None. PiperOrigin-RevId: 174503874
* Alias recently added tool as //tools/android:dexsharder for use by BazelGravatar kmb2017-11-01
| | | | | | RELNOTES: None. PiperOrigin-RevId: 174124176
* Android,Windows: longpath support in toolGravatar Laszlo Csomor2017-10-24
| | | | | | | | | | Update aar_native_libs_zip_creator.py to support long paths by using junctions. See https://github.com/bazelbuild/bazel/issues/3955 Change-Id: Iafa9ceca9f2a9076f220bd6326c95e5fb8b27f63 PiperOrigin-RevId: 173244903
* Add aapt2 to Bazel-generated android_sdks.Gravatar ajmichael2017-10-18
| | | | | RELNOTES: None PiperOrigin-RevId: 172481590
* Add a whitelist for packages that can contain android_devices rules. ↵Gravatar ajmichael2017-10-06
| | | | | | | Currently, this whitelist includes every package. RELNOTES: None PiperOrigin-RevId: 171192613
* Use bundled proguard 5.3.3 instead of 4.7 from the SDKGravatar ajmichael2017-10-06
| | | | | | | | | Fixes https://github.com/bazelbuild/bazel/issues/3777 Also adds a proguard integration test so that hopefully we notice next time it breaks. RELNOTES: Updated Android proguard to 5.3.3. It now works with android-24+. PiperOrigin-RevId: 171162295
* deps -> exports in bazel mobile-install stub app.Gravatar ajmichael2017-09-28
| | | | | RELNOTES: None PiperOrigin-RevId: 170198788
* Windows,Android: support long paths in toolGravatar Laszlo Csomor2017-09-28
| | | | | | | | | | | | //tools/android/aar_embedded_jars_extractor.py now supports long paths using the same junction-creating trick as aar_resources_extractor does. Fixes https://github.com/bazelbuild/bazel/issues/3808 Change-Id: I2db25b0536ac3a97f4a04191bc398eb236923a7c PiperOrigin-RevId: 170193093
* Windows, aar_resources_extractor: longpath bugfixGravatar Laszlo Csomor2017-09-27
| | | | | | | | | | | | | | | | | | Fix a bug in the Android tool aar_resources_extractor: open the compressed data and the target file as file descriptores, rather than using aar.extract. This way we can shorten the directories in the relative path of the extracted file, because we can open the target file via a junction and thus work around long path limitations. //tools/android:aar_resources_extractor_test now passes on Windows. Change-Id: I9f5c7de2279ad8769e53e015b8334a58a76cd989 PiperOrigin-RevId: 170181143
* Android, Python tools: bugfix in junction.pyGravatar Laszlo Csomor2017-09-27
| | | | | | | | | junction.TempJunction now can create all parent directories of the junction target if they don't exist. Change-Id: I3e9cf34e78a3eb1ef9415036b791843a3b37f7c1 PiperOrigin-RevId: 170176180
* Limit //external:android_sdk_for_testing to only the minimum files needed.Gravatar ajmichael2017-09-27
| | | | | | | | | | Note that the support libraries are excluded on Windows, because Windows runfiles are zipped and the support libraries are very big. First step towards https://github.com/bazelbuild/bazel/issues/3663 RELNOTES: None PiperOrigin-RevId: 170057391
* Update Bazel's android_device support to use new emulator paths.Gravatar ajmichael2017-09-26
| | | | | | | | | | | Also, bundle snapshots.img in Bazel since it was removed from the SDK. Part of the fix for https://github.com/bazelbuild/bazel/issues/3504 Note that this will require an update to unified launcher at https://github.com/google/android-testing-support-library RELNOTES: None PiperOrigin-RevId: 169937694
* Make android_sdk_repository resilient to prerelease and malformed system imagesGravatar ajmichael2017-09-06
| | | | | | | Fixes https://github.com/bazelbuild/bazel/issues/3672 RELNOTES: None PiperOrigin-RevId: 167581302
* Android,Windows: support long paths in toolingGravatar Laszlo Csomor2017-09-05
| | | | | | | | | | | | | | | | | | | aar_resources_extractor now supports long paths on Windows. If the script needs to extract a file from the AAR where the destination path is too long, the script will: 1. create a temporary junction under a short path, pointing to the destination directory (which has a long path) 2. extract the file under the junction 3. delete the junction and the temp directory See https://github.com/bazelbuild/bazel/issues/3659 Change-Id: Ie85665b360a6514afaac546aaec8869224fe9d06 PiperOrigin-RevId: 167545085
* Android,Windows: wrap SingleJar in a java_binaryGravatar Laszlo Csomor2017-09-01
| | | | | | | | | | | | | | | | | | | | | | On Unix-like platforms, we can execute deploy jars just like normal binaries, but on Windows we cannot because ".jar" is not an executable extension. Therefore we cannot run SingleJar_deploy.jar in a genrule.cmd. In this change I do the following changes to: //tools/android/BUILD.tools: - add a java_import rule that wraps the SingleJar deploy jar - add a java_binary that runtime-depends on the jar - fix the ":gen_java_lang_extras_jar" genrule to run the java_binary instead of the deploy jar See https://github.com/bazelbuild/bazel/issues/3659 Change-Id: Ie035e721deb696bbd4130b3612695a10dd9c2b4d PiperOrigin-RevId: 167281195
* Remove unused android_library.resource_extractor attributes in the depot.Gravatar jingwen2017-08-31
| | | | | RELNOTES: None. PiperOrigin-RevId: 167142666
* Remove resource_extractor from Bazel's android_sdk rules.Gravatar ajmichael2017-08-31
| | | | | RELNOTES: None PiperOrigin-RevId: 167027537
* aar_import creates res/values/empty.xml if it contains no resources.Gravatar ajmichael2017-08-29
| | | | | | | | | To do this, add a new tool that is used instead of zipper to get the resources out of the AAR. This tool creates res/values/empty.xml if there are no resources in the AAR. Also, some general cleaning of the code. RELNOTES: None PiperOrigin-RevId: 166768607
* Busybox all the Bazel Android tools.Gravatar ajmichael2017-08-25
| | | | | | | | | This change reduces the size taken up in the bazel binary by Android tools deploy jars from 38.2 mb to 9.8 mb, which is 15% of the bazel binary size. Also, some minor cleanups of our BUILD files. https://github.com/bazelbuild/bazel/issues/2385 RELNOTES: None PiperOrigin-RevId: 166373241
* Android,tools: don't open zip file in binary modeGravatar laszlocsomor2017-08-10
| | | | | | | | Zip files are always opened in binary mode and the ctor doesn't accept "b" in the mode string. RELNOTES: none PiperOrigin-RevId: 164832193
* Android,tools: open all files in binary modeGravatar Laszlo Csomor2017-08-10
| | | | | | | | | | | | | | | Always open files in binary mode to avoid automatic conversion between LF and CRLF on Windows, which is particularly problematic when a file is written on Windows but consumed on Android or when a binary file is opened for reading in text mode and if it happens to have an LF byte it would be converted to CRLF. See https://github.com/bazelbuild/bazel/issues/3264 Change-Id: I4d9d885a488b9693eeb3f6d929e3396ef8406d62 PiperOrigin-RevId: 164826587
* Windows,Android: mobile-install fully worksGravatar Laszlo Csomor2017-08-10
| | | | | | | | | | | | | | | | One of the output files in the incremental apk (stub_application_data.txt) was using CRLF on Windows, so the mobile-install'ed app was crashing on startup. Fix is to open the output file in binary mode so line endings are not converted to the host-platform-native one. See https://github.com/bazelbuild/bazel/issues/3264 Change-Id: Id7d4b5aa4362a21e699517b97dd24858c396eaa7 PiperOrigin-RevId: 164722314
* Windows, Android: fix mobile-installGravatar Laszlo Csomor2017-08-08
| | | | | | | | | | | The Adb command needs the SYSTEMROOT environment variable (as does Bazel), otherwise it produces weird errors. So add that to Adb's environment. See https://github.com/bazelbuild/bazel/issues/3264 Change-Id: Ia393f32ef00e21c90e4fc6d4a3188b7987aa89b0 PiperOrigin-RevId: 164454924
* Remove old intellij aspect code bundled with BazelGravatar Googler2017-07-31
| | | | PiperOrigin-RevId: 163538636
* Make $jarjar_bin point to //tools/android:jarjar_bin.Gravatar ajmichael2017-07-24
| | | | | | | Fixes TODO in AndroidRuleClasses.java. RELNOTES: None PiperOrigin-RevId: 162955052
* zip_manifest_creator: fix rlocation on WindowsGravatar Laszlo Csomor2017-07-14
| | | | | | | | | | | | Apparently `rlocation` is not defined in the environment of regular sh_binary rules, only in tests. So this commit adds an implementation for it. See https://github.com/bazelbuild/bazel/issues/3264 Change-Id: I70ecb91cef5e1b66679e6ba04823831183da5cd9 PiperOrigin-RevId: 161775438
* Fix #3326 by making sure only one zipper is selected.Gravatar John Cater2017-07-10
| | | | | Change-Id: Ib061c85900e577f3548d47e8fa86086dfec9654a PiperOrigin-RevId: 161360338
* zip_manifest_creator: more info if $ZIPPER missingGravatar Laszlo Csomor2017-07-07
| | | | | | | | | | | | Add extra debugging info to zip_manifest_creator.sh in case ZIPPER is not found. This'll help diagnosing https://github.com/bazelbuild/bazel/issues/3326 RELNOTES: none Change-Id: I60884b43c1aa10a9f67843628f1fadc74959059d PiperOrigin-RevId: 161208218
* Android: zip_manifest_creator now runs on WindowsGravatar Laszlo Csomor2017-07-05
| | | | | | | | | And so does its test. See https://github.com/bazelbuild/bazel/issues/3264 Change-Id: I32dd906b94747d601254ab55e7962bf6cda058f4 PiperOrigin-RevId: 160953063
* Android tooling: host/target path distinctionGravatar Laszlo Csomor2017-06-30
| | | | | | | | | | | | | Introduce host and target path separation in the Android incremental_install.py. This will allow running this script (and use bazel mobile-install) on platforms with non-POSIX path semantics (e.g. Windows). See https://github.com/bazelbuild/bazel/issues/3264 Change-Id: If6ec09f100dd2e0be3389dce25cb1a13305226e9 PiperOrigin-RevId: 160531950
* Windows, Android: update android_sdk_repositoryGravatar Laszlo Csomor2017-06-28
| | | | | | | | | | | | | | | | | | | | | The android_sdk_repository now uses the native Android build tools (e.g. aapt.exe, aidl.exe) when --host_cpu is one of x64_windows{,_msys,_msvc}. On Linux/MacOS we create a wrapper script for these tools and data-depend on SDK/build-tools/VERSION/lib/*, but on Windows we have no runfiles support and Bazel just creates a junction to SDK/build-tools, so all the actual tools are there where the binaries expect them. Also change the ":fail" target to select srcs on the host platform and use a .cmd file on Windows. See https://github.com/bazelbuild/bazel/issues/3264 Change-Id: Ica586fa1fd4914f4795b4387b449f1c5562164e0 PiperOrigin-RevId: 160383278
* Automated g4 rollback of commit dba22f337a20d3e8f3ac8dfd23bc6fa69e4528da.Gravatar xingao2017-06-02
| | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Use Java implementation of singlejar on FreeBSD, and roll forward change 157473007. *** Original change description *** Automated g4 rollback of commit d894345ed88f8adce600b66a310b5210d0bcb59c. *** Reason for rollback *** Breaks Bazel on FreeBSD: http://ci.bazel.io/view/Dashboard/job/Bazel/JAVA_VERSION=1.8,PLATFORM_NAME=freebsd-11/1542/console *** Original change description *** Use cc implementation of singlejar except on Windows. Change-Id: Ie4a2db2a6fa1ea86f4bdd42cd806f6804a0c56d4 PiperOrigin-RevId: 157729503
* Add //external:has_androidsdk config_setting.Gravatar ajmichael2017-06-01
| | | | | | | | | | | | | | | | | | This will be used to add some tests and targets to the Bazel codebase that build and run successfully when android_sdk_repository is in the WORKSPACE and silently skip if it is not. Example deps of a library that links against dx.jar: ``` deps = select({ "//external:has_androidsdk": ["//external:android/dx_jar_import"], "//conditions:default": [], }), ``` Also adds tests that config_setting works as expected when propagated through an alias or bind rule. RELNOTES: None PiperOrigin-RevId: 157627472
* Automated g4 rollback of commit d894345ed88f8adce600b66a310b5210d0bcb59c.Gravatar laszlocsomor2017-05-31
| | | | | | | | | | | | | *** Reason for rollback *** Breaks Bazel on FreeBSD: http://ci.bazel.io/view/Dashboard/job/Bazel/JAVA_VERSION=1.8,PLATFORM_NAME=freebsd-11/1542/console *** Original change description *** Use cc implementation of singlejar except on Windows. Change-Id: Ie4a2db2a6fa1ea86f4bdd42cd806f6804a0c56d4 PiperOrigin-RevId: 157567871
* Use cc implementation of singlejar except on Windows.Gravatar Xin Gao2017-05-31
| | | | | Change-Id: Ie4a2db2a6fa1ea86f4bdd42cd806f6804a0c56d4 PiperOrigin-RevId: 157473007
* Set the correct main class on the desugar java_binary target in Bazel.Gravatar ajmichael2017-05-10
| | | | | | | | | | | | | | | | | | This will make it easier to build the desugarer tool from the Bazel source tree as an executable (deploy) jar and then use it for something else. For example, with this CL, you can do the following steps to get a standalone desugarer binary: 1. git clone https://github.com/bazelbuild/bazel 2. bazel build //src/tools/android/java/com/google/devtools/build/android/desugar:desugar_bin_deploy.jar 3. cp bazel-bin/src/tools/android/java/com/google/devtools/build/android/desugar/desugar_bin_deploy.jar ~/bin/desugar.jar And then you can invoke desugar without bazel with `java -jar ~/bin/desugar.jar`. https://github.com/bazelbuild/bazel/issues/2975 RELNOTES: None PiperOrigin-RevId: 155629711
* Allow android compilations to use type annotationsGravatar cushon2017-05-08
| | | | PiperOrigin-RevId: 155287620
* Add compile_jars for Skylark to JavaProviderGravatar Stephen Twigg2017-05-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add compile_jars Skylark accessor to JavaProvider. This outputs the non-recursive set of jars needed to build with this target. Allows Skylark tools to get the same set of compile_jars that JavaLibrary is getting. Added test that verifies Skylark was getting lists from both compile_jars and transitive_runtime_jars of the expected length. Then, verified (via test code) those nested sets were identical to the ones provided by the java_library. To reviewers: First, would like to add documentation flags to these fields in JavaProvider. Is it possible, instead of adding them to this map to follow use the @SkylarkCallable annotation to expose methods on JavaProvider instead? It would then also be nice to mark these as experimental since won't really know the final API until java_skylark_library sandwich is done. I also tested this locally via bazel build //src:bazel and then doing ~/bazelsandbox/bazel/bazel-bin/src/bazel test SomeTarget in a different repo that had a .bzl file trying to use compile_jars. Change-Id: I1779c1b6303f36e50076c3479bfcb15a25aa95d8 PiperOrigin-RevId: 155191816
* Improve error message when building Android rules without an SDK.Gravatar ajmichael2017-05-05
| | | | | | | | | | | | | | | | | | | | Fixes https://github.com/bazelbuild/bazel/issues/509. Example output: ``` $ bazel build //:all INFO: Found 1 target... ERROR: /usr/local/google/home/ajmichael/.cache/bazel/_bazel_ajmichael/7fcc7480abc634522e5c0cfe6b85b583/external/bazel_tools/tools/android/BUILD:236:1: Executing genrule @bazel_tools//tools/android:no_android_sdk_repository_error failed: Process exited with status 1 [sandboxed]. This build requires an Android SDK. Please add the android_sdk_repository rule to your WORKSPACE. Use --strategy=Genrule=standalone to disable sandboxing for the failing actions. Target //:lib failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 0.327s, Critical Path: 0.10s ``` RELNOTES: Attempting to build an Android target without setting up android_sdk_repository will now produce a helpful error message. PiperOrigin-RevId: 155158667
* Stop using zip and unzip in android shell tests.Gravatar ajmichael2017-05-04
| | | | | | | Also, open source two more tests. RELNOTES: None PiperOrigin-RevId: 155129416
* Expose Bazel's Android data binding support to users.Gravatar gregce2017-04-18
| | | | | | | | | | | | The logic is already in Bazel but wasn't available to build rules. This change makes it available, but still requires data binding's {build|run}time libraries to be checked into appropriate depot spots for everything to work. Followup changes will make those libraries easily available. Issue: #2694 PiperOrigin-RevId: 153359861
* Make android_sdk_repository generate filegroups containing system image ↵Gravatar ajmichael2017-04-12
| | | | | | | | | | | | | | | | | | files for all android system images installed in the SDK. For system images that are not installed, create genrule "poison pills" that print a helpful error message if you attempt to build them. These filegroups are intended to be used as the system_image attribute of the android_device rule. Example: $ bazel build @android_test_support//tools/android/emulated_devices/pixel:android_25_x86 Extracting Bazel installation... . INFO: Found 1 target... ERROR: /usr/local/google/home/ajmichael/.cache/bazel/_bazel_ajmichael/efa32264346ef1fc4fec492202b88b31/external/androidsdk/BUILD.bazel:56:1: Executing genrule @androidsdk//:emulator_images_android_25_x86 failed: Process exited with status 1 [sandboxed]. This rule requires that the Android SDK used by Bazel has the following system image installed: emulator_images_android_25_x86. Please install this system image through the Android SDK Manager and try again. RELNOTES: None PiperOrigin-RevId: 152889824
* Remove apkbuilder from Bazel's android_sdk.Gravatar ajmichael2017-04-06
| | | | | | RELNOTES: None PiperOrigin-RevId: 152292294
* Remove jack tools from Bazel.Gravatar ajmichael2017-04-05
| | | | | | | | #1391 RELNOTES: None PiperOrigin-RevId: 152179305
* Make mobile-install wait for debuggerGravatar Googler2017-03-17
| | | | | | -- PiperOrigin-RevId: 150372383 MOS_MIGRATED_REVID=150372383
* Rollback of commit adf051ead3b747081639600fb4a9e043a798b2df.Gravatar Googler2017-03-16
| | | | | | | | | | | | | | | *** Reason for rollback *** this flag isn't needed with unknown commit *** Original change description *** Add --activity_name_file flag and modify --start flag in incremental_install. This is a first step to add the ability for mobile-install to wait for the debugger before starting the app. -- PiperOrigin-RevId: 150340712 MOS_MIGRATED_REVID=150340712