aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/android
Commit message (Collapse)AuthorAge
* Don't bundle android tests into the Bazel binary.Gravatar Adam Michael2017-01-20
| | | | | | | | Saves 12kB! :) -- PiperOrigin-RevId: 144997917 MOS_MIGRATED_REVID=144997917
* Make android_sdk_repository create one android_sdk per api level in the SDK.Gravatar Adam Michael2017-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | api_level is no longer required. It now sets the default android_sdk that is used if the --android_sdk flag is not passed. If it is not set, the highest api_level will be used as the default. The new behavior is demonstrated by the following example: $ ls $ANDROID_HOME/platforms android-21 android-22 android-23 $ cat WORKSPACE android_sdk_repository( name = "foo", ) $ bazel build //java/my/app # uses api level 23 $ bazel build --android_sdk=@foo//:sdk-22 //java/my/app # uses api level 22 $ cat > WORKSPACE <<EOF android_sdk_repository( name = "foo", api_level = 21, ) EOF $ bazel build //java/my/app # uses api level 21 $ bazel build --android_sdk=@foo//:sdk-23 //java/my/app # uses api level 23 See https://github.com/bazelbuild/bazel/issues/2284 for the master plan for android_sdk_repository. RELNOTES: android_sdk_repository no longer requires api_level. If one is not specified, the highest android platform installed will be used. Furthermore, android_sdk's are created for all android platforms installed and can be specified with the --android_sdk flag. -- PiperOrigin-RevId: 144258881 MOS_MIGRATED_REVID=144258881
* Remove filegroups in tools/android/BUILD.tools in favor of aliases.Gravatar Adam Michael2017-01-09
| | | | | | -- PiperOrigin-RevId: 143825037 MOS_MIGRATED_REVID=143825037
* Split tools/android/BUILD into BUILD and BUILD.tools.Gravatar Adam Michael2017-01-05
| | | | | | | | | | | | | | This should help clear up the confusion that caused https://github.com/bazelbuild/bazel/issues/2283. Now all of the following work: bazel build //tools/android/... bazel test //tools/android/... bazel build @bazel_tools//tools/android/... -- PiperOrigin-RevId: 143666995 MOS_MIGRATED_REVID=143666995
* Rollback of commit e81ff0e156647ae680346ac833313319e7ea69d6.Gravatar Alex Humesky2016-12-22
| | | | | | | | | | | | | | | | | *** Reason for rollback *** breaks bazel: https://github.com/bazelbuild/bazel/issues/2283 http://ci.bazel.io/job/bazel-tests/432/BAZEL_VERSION=HEAD,PLATFORM_NAME=linux-x86_64/console *** Original change description *** Remove broken and unused Android tools aliases. -- PiperOrigin-RevId: 142768488 MOS_MIGRATED_REVID=142768488
* Remove broken and unused Android tools aliases.Gravatar Adam Michael2016-12-22
| | | | | | -- PiperOrigin-RevId: 142702623 MOS_MIGRATED_REVID=142702623
* Rollback of commit 27cd7f6bb4a02f56f9ad73e57e71e69a1c00d5ea.Gravatar Adam Michael2016-12-15
| | | | | | | | | | | | *** Reason for rollback *** Rolling forward, intentionally breaking loading phase (and therefore `bazel fetch`) for android_binary in Bazel if no android_sdk_repository is set up. Will not submit until Tensorflow's use case is cleaned up in https://github.com/tensorflow/tensorflow/pull/6225. -- PiperOrigin-RevId: 142068703 MOS_MIGRATED_REVID=142068703
* Rollback of commit 14e35546302a48d1074bc2456ef4d63c27c9d3a1.Gravatar Adam Michael2016-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Rollforward with fixes to android_integration_test.sh. The test now uses the new syntax for the Support Library AARs. All CIs that have been created since last December should have this library installed due to https://github.com/bazelbuild/continuous-integration/blob/master/mac/mac-android.sh#L36. *** Original change description *** Automated [] rollback of commit f699b502ef6a57dc68570486191ad1c318e8fd1b. *** Reason for rollback *** Breaks android_integration_test.sh which relies on the old targets. I don't have time to update the test to use the new targets at the moment, so rolling the change back for now. https://github.com/bazelbuild/bazel/issues/2159 RELNOTES: -- PiperOrigin-RevId: 141233182 MOS_MIGRATED_REVID=141233182
* Bazel uses apksigner from SDK build-tools instead of embedded jar.Gravatar Adam Michael2016-12-06
| | | | | | | | | | | | A followup change will remove the apksigner jar that is bundled with Bazel. RELNOTES: Bazel Android builds use the apksigner tool from the Android SDK build-tools. Bazel Android builds now require build-tools version 24.0.3 or later. -- PiperOrigin-RevId: 141181612 MOS_MIGRATED_REVID=141181612
* Rollback of commit f699b502ef6a57dc68570486191ad1c318e8fd1b.Gravatar Adam Michael2016-12-01
| | | | | | | | | | | | | | | *** Reason for rollback *** Breaks android_integration_test.sh which relies on the old targets. I don't have time to update the test to use the new targets at the moment, so rolling the change back for now. https://github.com/bazelbuild/bazel/issues/2159 RELNOTES: -- MOS_MIGRATED_REVID=140733556
* Delete old targets from android_sdk_repository_template.bzlGravatar Adam Michael2016-11-30
| | | | | | | | | | | | | | | | In December 2015, these JARs needed for these targets were removed from all subsequent Android SDK releases. They were replaced by a two local maven repositories: <android sdk>/extras/android/m2repository and <android sdk>/extras/google/m2repository. Furthermore, the new dependencies are AARs and the Maven repositories are sem-ver'd so the developer needs to select the version of the library to use. In https://github.com/bazelbuild/bazel/commit/2fcf0e I added support for android_sdk_repository to parse these local maven repositories and generate java_import and aar_import rules along with their dependencies. Since these "extras" do not ship with the SDK by default and are not versioned with the build-tools, you cannot currently download the old JAR versions. As such, anyone who has updated their Android SDK in the last year should not have been able to download the old JARs. See https://github.com/bazelbuild/bazel/issues/1745 for the tracking issue and information on migrating from the old targets to the new ones. RELNOTES: Top level @androidsdk support library targets have been replaced by @androidsdk//<group id>:<artifact id>-<version> for Android SDK Support and Google Play Services libraries. -- MOS_MIGRATED_REVID=140562616
* resource_extractor.py should preserve the timestamps of entries of the input JARGravatar Adam Michael2016-11-17
| | | | | | | RELNOTES: -- MOS_MIGRATED_REVID=139370787
* Open source resource_extractor.py for singlejar apk building.Gravatar Adam Michael2016-11-16
| | | | | | | Now, apks can be built faster in Bazel using the --use_singlejar_apkbuilder flag. -- MOS_MIGRATED_REVID=139285943
* Make aar_embedded_jar_extractor.py not try to recreate the output directory.Gravatar Adam Michael2016-11-09
| | | | | -- MOS_MIGRATED_REVID=138516288
* Make android_integration_test run again!Gravatar Adam Michael2016-10-27
| | | | | | | | Prior to this change, the android SDK for the integration tests was empty so they were not run. -- MOS_MIGRATED_REVID=137307968
* Use TEST_TMPDIR for zip_manifest_extractor_test.sh.Gravatar Adam Michael2016-10-26
| | | | | -- MOS_MIGRATED_REVID=137209855
* Fix zip_manifest_creator dep in bazel_tools repo with an alias.Gravatar Adam Michael2016-10-26
| | | | | | | | | | | In commit 78c19807d2cbb308b830022dcdcc8b03f19f90a9 I accidentally broke aar_import when I moved zip_manifest_creator from tools/android to tools/zip because tools/android does not have separate BUILD and BUILD.tools files. The test did not catch this, because the dependency in tools/android/BUILD is correct in the context of the bazel tree but not in the context of the bazel_tools embedded workspace. -- MOS_MIGRATED_REVID=137209500
* Merge all jars in AAR in aar_import, not just classes.jarGravatar Adam Michael2016-10-26
| | | | | | | See https://github.com/bazelbuild/bazel/issues/1935 -- MOS_MIGRATED_REVID=137202533
* Adds support to aar_import for native libs in /jni.Gravatar Adam Michael2016-10-25
| | | | | | | The libs that are extracted are dependent on the CPU from the Android split transition. This is set either from --fat_apk_cpu or --android_cpu if fat_apk_cpu is empty. -- MOS_MIGRATED_REVID=137188695
* Refactor AarImportRule into a base rule.Gravatar Adam Michael2016-10-14
| | | | | | | Also moves AAR-specific tools from tools/zip into tools/android and renames embedded_jar_extractor to aar_embedded_jars_extractor because in a future change it will extract classes.jar and libs/*.jar. -- MOS_MIGRATED_REVID=136099324
* Explicitly specify the directories in the Android SDK needed for tests.Gravatar Adam Michael2016-10-12
| | | | | | | | | | | | //src/test/shell/bazel/test-setup.sh uses this filegroup to symlink the contents of the Android SDK into the workspace for the test. However, since we add BUILD files into the Android SDK, we don't want to copy those into the workspace because they will be regenerated by the integration test. Fixes https://github.com/bazelbuild/bazel/issues/1927. -- MOS_MIGRATED_REVID=135858750
* Added support for rex to optionally compress dex files.Gravatar Googler2016-10-12
| | | | | -- MOS_MIGRATED_REVID=135805730
* Rollback of commit af8ebca2b88a0ee1129b72b4ce825f6489c31e67.Gravatar Damien Martin-Guillerez2016-10-05
| | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Break `bazel fetch ...` Discovered by bisecting `bazel fetch tensorflow/...`, see attached bug for more information Fixes https://github.com/bazelbuild/bazel/issues/1880 *** Original change description *** Open source dex merging tools for incremental dexing. Tested with bazel build --incremental_dexing_binary_types=monodex,multidex_unsharded,multidex_sharded -- //examples/android/java/bazel:hello_world -- MOS_MIGRATED_REVID=135220785
* Open source dex merging tools for incremental dexing.Gravatar Adam Michael2016-09-30
| | | | | | | | Tested with bazel build --incremental_dexing_binary_types=monodex,multidex_unsharded,multidex_sharded -- //examples/android/java/bazel:hello_world -- MOS_MIGRATED_REVID=134690103
* patch bootclasspath to allow javac to compile lambdas and method references ↵Gravatar Googler2016-09-28
| | | | | | | in android_* targets (behind existing flag). -- MOS_MIGRATED_REVID=134453743
* Change the filegroup for the android sdk to an alias to unbreak android in ↵Gravatar Alex Humesky2016-09-23
| | | | | | | bazel after commit 1092e9d68773adb7444cc85a47af650aeeaf65fc -- MOS_MIGRATED_REVID=134036851
* Java 8 support for Android builds, initially with incremental dexing only.Gravatar Googler2016-09-19
| | | | | -- MOS_MIGRATED_REVID=133436157
* Adds a jar filter to the IntelliJ IDE aspect.Gravatar Googler2016-09-06
| | | | | | | | | | | | | | | | Any java rule that mixes generated and non-generated sources will produce a filtered jar containing only the generated output. For a java rule with only "normal" sources or only generated source files, no filtered jar is produced. This will allow the IDE to resolve those generated sources. RELNOTES:None -- MOS_MIGRATED_REVID=132113568
* Add BUILD target for bazel apksigner and BUILD.tools so that it can be used inGravatar Adam Michael2016-09-02
| | | | | | | | | | the embedded_tools repo. Do not submit until https://bazel-review.googlesource.com/#/c/5630/6 is merged. Also do not submit until unknown commit goes in. -- MOS_MIGRATED_REVID=131950953
* Add a resource validator action for android_libraryGravatar Googler2016-08-30
| | | | | | | | | | | | | | | | | | Part 3 of the 3 new proposed android_library res processing actions. Pulls a zip file from the merging action, unpacks it, and then validates the results with aapt. Get an R.txt and srcjar w/ javadocs from aapt. In order to the get the R.txt, I think you need to ask for the R.java sources anyway. Split the processResources() into a runAapt() function that can be reused. Hookup in bazel coming separately. -- MOS_MIGRATED_REVID=131618410
* Add a lightweight resource merge action.Gravatar Googler2016-08-30
| | | | | | | | | | | | | | | | | | | | | | | | | | Part 2 of the 3 new proposed android_library res processing actions. The primary and deps are all assumed to be parsed+summarized in a protobuf. Represent that with a new class (similar to DependencyAndroidData but w/out R.txt). Avoid having "manifest" artifacts as deps input, and instead use "label", since that is only used in a warning. DepAD still uses the manifest for #asSymbolFileProvider, so we keep it there. Move loading the primary out of the merge function so that we can share the merge function with this style of primary data, and the existing style of of primary data (UnvalidatedAndroidData). This produces an R class.jar and a zip file to pass along to a future validation action. Images are stubbed out since they are irrelevant to the validation action. -- MOS_MIGRATED_REVID=131604421
* Merge xmlns decls in old manifest merger to help transitionGravatar Googler2016-08-26
| | | | | | | | | | | | | | | The old manifest merger doesn't merge xmlns decls. That could be a problem if a library has xmlns:tools but the binary doesn't (and we don't strip tools:). Library manifests may end up with more xmlns:tools annotations while transitioning from the old manifest merger to the new. It would be a problem if the same manifest is used by both the old and new merger. An alternative may be to strip the tools annotations after merging w/ this old merger... other options? -- MOS_MIGRATED_REVID=131332171
* Add external reference for android customtabsGravatar Simon Horlick2016-08-25
| | | | | | | -- Change-Id: If9b46439d0c0df36737030c9d78c201a87f1a4e9 Reviewed-on: https://bazel-review.googlesource.com/c/5590/ MOS_MIGRATED_REVID=131317750
* Delete unused empty file.Gravatar Adam Michael2016-08-18
| | | | | | | The filegroup using this file was deleted in commit c9d4fae25137cf480e83566d992bef813fcad7ee -- MOS_MIGRATED_REVID=130553843
* Replaces sh_binary redirects with aliases in Bazel.Gravatar Adam Michael2016-08-18
| | | | | -- MOS_MIGRATED_REVID=130549870
* Add a resource parsing action.Gravatar Googler2016-07-28
| | | | | | | | | | | | | | | | | | | | | | Part of 3 proposed new actions: - parsing action - merging action - validating action Dependencies (directData and transitiveData) expect the symbol files. If the merge action produces the symbol files, then each merge action depends on each other. Instead, produce it in an action with just source resources as prereqs to allow more parallelism. Technically, we don't need a manifest as part of the parameters. I debated about whether to introduce a basic version of UnvalidatedAndroidData or not. -- MOS_MIGRATED_REVID=128599714
* More pieces of RClassGeneratorActionGravatar Googler2016-07-08
| | | | | | | | | | | | Add the rclass_generator.sh, and fill in the boiler-plate for mock tools, etc. Mostly cargo- culting references to resources_processor.sh. Rename earlier pieces to use RClassGenerator prefix instead of AndroidResourceCompilation. -- MOS_MIGRATED_REVID=126831848
* Adds the Android manifest merger as an option for android_binary rules. The ↵Gravatar Andrew Pellegrini2016-06-23
| | | | | | | | | merger that is used (legacy or android) is controlled by the manifest_merger attribute on android_binary and the default is controlled by the --android_manifest_merger flag. RELNOTES: The Android manifest merger is now available as an option for android_binary rules. The merger will honor tools annotations in AndroidManifest.xml and will perform placeholder substitutions using the values specified in android_binary.manifest_values. The merger may be selected by setting the manifest_merger attribute on android_binary. -- MOS_MIGRATED_REVID=125603954
* Roll forward of commit 2ba818ca7d2c77f517f1c0e6540c9af0501b7fb2: Ensure ↵Gravatar Andrew Pellegrini2016-06-22
| | | | | | | | | | | manifest merger places the application element as the last child of the manifest element. This is required for Android N. NEW: fixed index out of range exception RELNOTES: Merged manifests are guaranteed to have the application element as the last child of the manifest element as required by Android N. -- MOS_MIGRATED_REVID=125493743
* Replace #!/bin/bash -eu with #!/bin/bash and "set -eu". Otherwise, the "-eu" ↵Gravatar Philipp Wollermann2016-06-21
| | | | | | | | | is not picked up when you run the scripts manually using "bash script.sh". This is also in our shell style guide: "Executables must start with #!/bin/bash and a minimum number of flags. Use set to set shell options so that calling your script as bash <script_name> does not break its functionality." -- MOS_MIGRATED_REVID=125450962
* Rollback of commit df39a8a06e32aa864d2504df1ea2c7ed162c8c1d.Gravatar Googler2016-06-16
| | | | | | | | | | | | | | | *** Reason for rollback *** Broke a few projects, including many targets in AGSA: [] *** Original change description *** Ensure manifest merger places the application element as the last child of the manifest element. This is required for Android N. RELNOTES: Merged manifests are guaranteed to have the application element as the last child of the manifest element as required by Android N. -- MOS_MIGRATED_REVID=124960831
* Ensure manifest merger places the application element as the last child of ↵Gravatar Andrew Pellegrini2016-06-16
| | | | | | | | | the manifest element. This is required for Android N. RELNOTES: Merged manifests are guaranteed to have the application element as the last child of the manifest element as required by Android N. -- MOS_MIGRATED_REVID=124954782
* Adds a step before creating the resource apk (ap_) to swap out the applicationGravatar Alex Humesky2016-06-13
| | | | | | | tag's name attribute to the Instant Run application class. -- MOS_MIGRATED_REVID=124606107
* Rollback of commit bda8ae9212621da50d6b18f185f99450fb6d6da9.Gravatar Lukacs Berki2016-06-06
| | | | | | | | | | | | | | | *** Reason for rollback *** Cannot be built with currently released Bazel. *** Original change description *** Remove redirect chasing from AndroidConfiguration.Loader. With aliases, it's not necessary anymore. -- MOS_MIGRATED_REVID=124123904
* Migrate to alias-based redirection for android_sdk.Gravatar Lukacs Berki2016-06-06
| | | | | -- MOS_MIGRATED_REVID=123971774
* Make Android rules/tests refer to the correct runfiles pathsGravatar Kristina Chodorow2016-05-31
| | | | | | | Fixes the android part of #1316. -- MOS_MIGRATED_REVID=123644129
* Global cleanup change.Gravatar Michael Staib2016-05-11
| | | | | -- MOS_MIGRATED_REVID=121953905
* Distinguish between the build tools version and the build tools directory in ↵Gravatar Alex Humesky2016-05-09
| | | | | | | | | android_sdk_repository so that preview sdks can be correctly handled. For example, the name in the build-tools directory might be "24.0.0-preview", but its version is actually "24 rc3" from build-tools/24.0.0-preview/source.properties. Fixes https://github.com/bazelbuild/bazel/issues/1240 -- MOS_MIGRATED_REVID=121719519
* Fix paths in Android scripts to always look under bazel_toolsGravatar Kristina Chodorow2016-05-03
| | | | | | | Fixes #1214. -- MOS_MIGRATED_REVID=121416417
* Set --android_sdk=@bazel_tools//tools/android:sdk by default and delete ↵Gravatar Luis Fernando Pino Duque2016-04-27
| | | | | | | | | Constants.ANDROID_DEFAULT_SDK. This CL also updates the test infrastructure to include a mock of @bazel_tools//tools/android:sdk. -- MOS_MIGRATED_REVID=120815577