aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java
Commit message (Collapse)AuthorAge
* Filter LocalResourceContainer and use it to get a filtered ResourceContainerGravatar Googler2017-07-17
| | | | | | | | | | | | | | | | | | | | | | | Dynamically Configured Resource Filtering change 2/6 We need to filter LocalResourceContainer for dynamically configured resource filtering - it is an input to resource parsing for android_library targets. Filter it appropriately. Once it's being filtered, use it to build a filtered ResourceContainer, rather than building an unfiltered ResourceContainer and then filtering it. This means filtering gets done sooner, saving a bit of time and work, and isn't done twice, which would just be bad. To do this, we pass an unbuilt ResourceContainer.Builder into createApk, rather than a fully built one. Move the setAssetsAndResourcesFrom and setManifest calls to that builder, called every time, into createApk so that we only call them once. Also, initialize the ResourceFilter object when it's needed, rather than pass it down from the binary or library. This makes the code a bit cleaner, plus means library targets will pick up the dynamically configured information once that exists. RELNOTES: none PiperOrigin-RevId: 162007885
* Detect one version violations while building android_binary targetsGravatar Googler2017-07-14
| | | | PiperOrigin-RevId: 161910195
* Making mobile-install v2 compatible with ASwB pluginGravatar Googler2017-07-12
| | | | PiperOrigin-RevId: 161563102
* Remove all non-essential call sites of methods on Jvm.Gravatar lberki2017-07-07
| | | | | | | This is so that we can eventually route the information it now contains through JavaRuntimeProvider. RELNOTES: None. PiperOrigin-RevId: 161196809
* Remove JavaIdeInfoProvider.Gravatar dslomov2017-07-07
| | | | | RELNOTES: None. PiperOrigin-RevId: 161086496
* Automated rollback of commit 480d6038905b3c8de09a362e2759fc6b8abe634c.Gravatar twerth2017-07-05
| | | | | | | | | | | | | | | *** Reason for rollback *** Breaks tests in current Blaze nightlies, see b/63296317 *** Original change description *** Add minSdkVersion optimization to Blaze. This optimization reduces the size of Android apps that use Proguard by ~0.2 - 0.3% depending on the minSdkVersion. RELNOTES: None. PiperOrigin-RevId: 160930942
* Add minSdkVersion optimization to Blaze.Gravatar Googler2017-07-03
| | | | | | | This optimization reduces the size of Android apps that use Proguard by ~0.2 - 0.3% depending on the minSdkVersion. RELNOTES: None. PiperOrigin-RevId: 160673030
* Automated conversion to Java 8Gravatar laurentlb2017-06-30
| | | | | | | With a few manual fixes for readability. RELNOTES: None. PiperOrigin-RevId: 160582556
* Remove resource_extractor from android_sdk rule.Gravatar ajmichael2017-06-29
| | | | | | | | | | resource_extractor has nothing to do with the Android SDK. Once upon a time, it was needed for jack support, so it was colocated with the jack attributes in android_sdk. Nowadays, it is used as a necessary step before singlejar can run to build the APK. RELNOTES: None PiperOrigin-RevId: 160479247
* Refactoring the ApplicationManifest for clarity:Gravatar corysmith2017-06-29
| | | | | | | | * Split the aar, library and binary packWith calls. * Remove unused argument from the new binary and library packWith calls. RELNOTES: None PiperOrigin-RevId: 160414867
* Pass the unsigned apk and the keystore to ApkProvider.Gravatar Googler2017-06-20
| | | | | RELNOTES: None PiperOrigin-RevId: 159460633
* Cleanup the interface of ApkActionsBuilder.Gravatar ajmichael2017-06-05
| | | | | | | | | | | | | | | A few changes: 1. Remove the ApkSigningMethod input. We always read this from AndroidConfiguration, callers shouldn't need to pass it in. 2. Add a signingKey attribute. This will be needed for dex2oat to pass in whatever key was used to sign the input APKs. 3. Unify the resourceApk and nativeLibsZips into a "addInputZip(s)" methods. This can also be used for inputting an existing APK, such as the one from dex2oat. RELNOTES: None PiperOrigin-RevId: 157973679
* Remove NestedSets from ApkProvider.Gravatar ajmichael2017-06-01
| | | | | | | | The only call site passes single artifacts. Some of the read sites assert that the NestedSet contains only one element. RELNOTES: None PiperOrigin-RevId: 157635897
* Remove outdated comment.Gravatar ajmichael2017-05-23
| | | | | RELNOTES: None PiperOrigin-RevId: 156770067
* Flag cleanup (Step 1 of 3): Make use_singlejar_for_proguard_libraryjars a ↵Gravatar Googler2017-05-03
| | | | | | | no-op, and default behavior to on since it has been on in the global blazerc for awhile now. RELNOTES: Deprecate use_singlejar_for_proguard_libraryjars and force behavior to always on. PiperOrigin-RevId: 154890445
* Deprecate --experimental_android_use_singlejar_for_multidex.Gravatar ajmichael2017-04-25
| | | | | | | Also remove the $zip attribute of android_binary and android_test. RELNOTES: --experimental_android_use_singlejar_for_multidex is now a no-op and will eventually be removed. PiperOrigin-RevId: 154111305
* Expose the native libs of the android_binary rule to skylark.Gravatar Googler2017-04-18
| | | | | RELNOTES: none PiperOrigin-RevId: 153223511
* In android_library targets, R.class files should not be runtime dependenciesGravatar Googler2017-04-18
| | | | | | | | | | | | | | | | | | android_binary targets have their own R.java files (built from merging dependencies and any resources that belong directly to the target). As such, they don't need inherited R.java files at runtime. Taking these out makes for smaller APKs and less inheritance from the target's dependencies. Add a flag to control this behavior. Have it default to continue to include R.class files as runtime dependencies so we can control rollout of this behavior. Add tests of android_binary to ensure the JAR is filtered out as appropriate, and of android_robolectrictest to ensure that those tests still have access to the JARs. RELNOTES: none PiperOrigin-RevId: 153177074
* Add feature_flags attribute to Android binary rules.Gravatar mstaib2017-04-13
| | | | | | | | | | | This is the first actual user of the config_feature_flag rule, able to actually set its value (and thus give a point to using it!) This feature is not fully launched yet, but it is usable in any build containing this change. RELNOTES: None. PiperOrigin-RevId: 152948153
* Introduce hidden configuration flag to list dexopts used by DexFileMerger ↵Gravatar kmb2017-04-12
| | | | | | | | tool during incremental dexing RELNOTES: none PiperOrigin-RevId: 152838197
* Pass --keep-main-dex flag to rex when multidex mode is set to legacyGravatar Googler2017-04-10
| | | | | RELNOTES: None PiperOrigin-RevId: 152523635
* Remove getAaptSupportsMainDexCreation from AndroidSdkProvider.Gravatar ajmichael2017-04-07
| | | | | | | All android_sdk rules are required to have the apksigner binary, which was not included in the build tools until version 24.0.3. So this check is no longer necessary. Instead, we check in AndroidSdkRepositoryFunction. RELNOTES: None PiperOrigin-RevId: 152498753
* Remove jack support and make jack/jill attributes of android_sdk optional.Gravatar ajmichael2017-04-04
| | | | | | | | | Closes https://github.com/bazelbuild/bazel/issues/1391. RELNOTES: Removed --experimental_use_jack_for_dexing and libname.jack output of android_library. PiperOrigin-RevId: 152131075
* Modify AndroidSemantics#addMainDexListActionArguments to take proguard map ↵Gravatar Googler2017-03-31
| | | | | | | | | | as argument. This is needed because which proguard map that gets added as an argument to mainDexListAction depends on whether or not Rex is enabled RELNOTES: None PiperOrigin-RevId: 151720305
* Description redacted.Gravatar Adam Michael2017-03-28
| | | | | | -- PiperOrigin-RevId: 151407958 MOS_MIGRATED_REVID=151407958
* introduce hidden flag to configure bytecode optimizersGravatar Kevin Bierhoff2017-03-27
| | | | | | -- PiperOrigin-RevId: 151170448 MOS_MIGRATED_REVID=151170448
* Un-rollback and fix bugs in resource density filteringGravatar Googler2017-03-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | Rollback of commit df366408188f0451bae9b2ed079c795a4beb2e2b. In addition to undoing the rollback of my previous change, fix the bugs it introduced and add tests for those bugs. Always ignore empty filters. Empty filters are always useless or counterproductive. Before the original change, empty filters as a single item within the list of filters (e.g., ["en", ""]) were ignored, but empty filters as a portion of a string in the list (e.g., ["en,"]) were not. I can't imagine any reason people would actually want the empty filter (if it were handled correctly, it would effectively tell Bazel to just ignore every other filter the user passed in). Since it makes more sense with the new code, represent the stringified filters as a list of strings, rather than a single string of comma-seperated values. Manually trim whitespace from each token. Before the original change, the code trimmed whitespace following commas (e.g., ["en, es"] -> ["en,es"]) but not otherwise. If we're allowing whitespace in filter strings anyway, there doesn't seem to be any reason to allow it in some places but not others. -- PiperOrigin-RevId: 151128685 MOS_MIGRATED_REVID=151128685
* Rollback of commit 1e18045ed9d6ab9c945cec69286a7d8bd288a507.Gravatar Tobias Werth2017-03-23
| | | | | | -- PiperOrigin-RevId: 151000602 MOS_MIGRATED_REVID=151000602
* Filter android_binary resources by screen density in the analysis phaseGravatar Googler2017-03-22
| | | | | | | | | | | | | | In addition to filtering android_binary resources by resource_configuration_filters, we also filter by densities. Doing this in analysis rather than execution should also result in a speed-up as there's no need to copy files unwanted for actions to use. This behavior is controlled by the same object and flags that already control resource configuration filtering, simplifying the code. -- PiperOrigin-RevId: 150871620 MOS_MIGRATED_REVID=150871620
* adds feature_of and feature_after attrs to android_binary. these are ↵Gravatar Googler2017-03-21
| | | | | | | | android_binary rules whose .apk artifacts get piped through appt to support split apks -- PiperOrigin-RevId: 150701976 MOS_MIGRATED_REVID=150701976
* Stop Bazel from crashing on data-bound Android libraries with no resources.Gravatar Greg Estren2017-03-16
| | | | | | | | | | These libraries don't produce data binding outputs on resource processing (since there's nothing to process). Their only role is to pass through the outputs of their deps. -- PiperOrigin-RevId: 150251921 MOS_MIGRATED_REVID=150251921
* Make mobile-install work with --use_singlejar_apkbuilder.Gravatar Adam Michael2017-03-14
| | | | | | | | | | | All .dex files to include in the APK must now either be in a zip file or be named "classes.dex". Now with test coverage! -- PiperOrigin-RevId: 150074347 MOS_MIGRATED_REVID=150074347
* Global cleanup change.Gravatar Googler2017-03-09
| | | | | | -- PiperOrigin-RevId: 149652245 MOS_MIGRATED_REVID=149652245
* --Gravatar Googler2017-03-02
| | | | | PiperOrigin-RevId: 148938713 MOS_MIGRATED_REVID=148938713
* Improve memory efficiency of incremental dexing and introduce flag to error ↵Gravatar Googler2017-03-01
| | | | | | | | out if DexArchiveAspect misses .jar files -- PiperOrigin-RevId: 148835665 MOS_MIGRATED_REVID=148835665
* Description redacted.Gravatar Googler2017-02-24
| | | | | | -- PiperOrigin-RevId: 148388306 MOS_MIGRATED_REVID=148388306
* Filter android_binary resources during analysisGravatar Googler2017-02-24
| | | | | | | | | | | | | | | | | | | | | | Before this change, resource_configuration_filters were only used to filter resources out of android_binary targets during resource processing. Instead, we can filter these unwanted resources out during analysis. This means we won't have to copy these resources for use in execution, and that execution itself will have a smaller set of inputs. This should produce a speed-up in android_binary targets with resource_configuration_filters. Also add a flag that controls this behavior. Currently, the flag defaults to not doing this prefiltering. We'll change that after further testing. Also, do some related cleanup: - Replace repeated used of the constant "resource_configuration_filters" with references to the new class - Pass around instances of the new class rather that List<String> objects meant to represent ResourceConfigurationFilters -- PiperOrigin-RevId: 148353501 MOS_MIGRATED_REVID=148353501
* Implicitly generate Proguard obfuscation mapping file for android_binary ↵Gravatar Andrew Pellegrini2017-02-24
| | | | | | | | | | targets when both resource shrinking and Proguard are enabled, as it is required by resource shrinking to work properly. RELNOTES: Automatically generate Proguard mapping when resource shrinking and Proguard are enabled. -- PiperOrigin-RevId: 148349205 MOS_MIGRATED_REVID=148349205
* Move rexed proguard map to top level blaze-bin directory when rex enabledGravatar Googler2017-01-25
| | | | | | -- PiperOrigin-RevId: 145495392 MOS_MIGRATED_REVID=145495392
* Add the Android resource shrinker log as a file to build when shrinking is ↵Gravatar Andrew Pellegrini2017-01-25
| | | | | | | | performed in order to expose it in build summary output. -- PiperOrigin-RevId: 145457357 MOS_MIGRATED_REVID=145457357
* Delete some dead android rules and tools code.Gravatar Adam Michael2017-01-09
| | | | | | -- PiperOrigin-RevId: 143823562 MOS_MIGRATED_REVID=143823562
* Clean up RuleContext's attribute access API.Gravatar Greg Estren2016-12-02
| | | | | | | | | | | | | | | All calls now go through RuleContext.attributes(), which guarantees both native and aspect-supplied attributes are checked. For aspect attributes, only type queries are supported (e.g. "does this attribute exist?", "what is its type?"). Not value queries. This is because the code this is cleaning up accesses aspect attributes through a String->Attribute map, which doesn't include values. If ever needed we could further extend with something more robust. -- MOS_MIGRATED_REVID=140771242
* --experimental_android_use_singlejar_for_multidex compresses classes*.dexGravatar Adam Michael2016-11-30
| | | | | | | Currently, setting this flag on a native multidex build results in classes*.dex being stored in the APK uncompressed which is certainly not good. -- MOS_MIGRATED_REVID=140561305
* Adds internal data binding support to Bazel, although thisGravatar Greg Estren2016-11-21
| | | | | | | | | | | | | | | | | | | | | | is not yet exposed at the user level. (https://developer.android.com/topic/libraries/data-binding/index.html). See comments in DataBinding.java for the high-level overview of how this works. This does not yet work with --experimental_use_parallel_android_resource_processing. Exposing this at the user level additionally requires: 1) making the data binding support libraries available at an expected place in the depot 2) Opting in android_binary / android_library rules through a new "enable_data_binding" attribute. -- MOS_MIGRATED_REVID=139797558
* Adds obfuscated constant string implicit output.Gravatar Googler2016-11-10
| | | | | -- MOS_MIGRATED_REVID=138695951
* Add support for --keep-main-dex flag to RexGravatar Googler2016-11-02
| | | | | -- MOS_MIGRATED_REVID=137886595
* Add support for Rex package mapGravatar Googler2016-11-02
| | | | | -- MOS_MIGRATED_REVID=137877037
* 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
* Multidex uses singlejar instead of zip.Gravatar Adam Michael2016-10-25
| | | | | | | | | To roll this out safely, this is hidden behind a flag: --experimental_android_use_singlejar_for_multidex See https://github.com/bazelbuild/bazel/issues/1936 -- MOS_MIGRATED_REVID=137155214
* Add a flag to android_binary to allow resource shrinking to be controlled on ↵Gravatar Googler2016-10-14
| | | | | | | | | a per-target basis. This flag only affects builds that have --experimental_android_resource_shrinking enabled. This will allow us to enable and disable the feature without needing to update [] or Rapid configs and on a module by module basis inside GmsCore. It will also let us enable/disable for GmsCore modules on a team by team basis. Tested by adding to an android_binary target and building with the resource shrinking flag enabled. -- MOS_MIGRATED_REVID=136189212