aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/android
Commit message (Collapse)AuthorAge
* Refactor PrinterGravatar vladmos2017-07-03
| | | | | | | It's now easier to customize Printer if in different situations objects should be printed differently. Also its API is cleaner now. Names of methods of SkylarkValue objects now reflect names of Skylark functions: SkylarkValue#repr and SkylarkPrintableValue#str. PiperOrigin-RevId: 160635154
* Automated conversion to Java 8Gravatar laurentlb2017-06-30
| | | | | | | With a few manual fixes for readability. RELNOTES: None. PiperOrigin-RevId: 160582556
* Add categories transition values to android options.Gravatar ccalvarin2017-06-30
| | | | | | Automated formatting fixes standardize the @Option annotation. PiperOrigin-RevId: 160567787
* Add a #getBytes() method to DeterministicWriter that returns a ByteString. ↵Gravatar janakr2017-06-30
| | | | | | | | By default it just delegates to the existing #writeOutputFile, but implementations may choose to override if they have easy access to a ByteString. Also change some DeterministicWriter implementations that do have easy access to the ByteString. PiperOrigin-RevId: 160550028
* 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
* Introduce new android_instrumentation_test rule.Gravatar ajmichael2017-06-29
| | | | | | | | | | | This rule works with the android_instrumentation, android_device_script_fixture and android_host_service_fixture rules to support testing Android applications. None of these rules are installed yet, because the forthcoming Android test runner is not yet open sourced. https://github.com/bazelbuild/bazel/issues/903. RELNOTES: None PiperOrigin-RevId: 160465920
* Enable aapt2 support in library actions.Gravatar corysmith2017-06-29
| | | | | RELNOTES: None PiperOrigin-RevId: 160445869
* 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
* Add the default category and tag to all options.Gravatar ccalvarin2017-06-28
| | | | | | | | Move the default from the annotation to every mention. This makes the incompleteness explicit. Will add the defaults to test targets in a separate change. Once all dependencies are cleaned up, the Option annotation will no longer allow options without the documentationCategory or effectTag, to prevent new options being added without categories while we migrate to the new option categorization. PiperOrigin-RevId: 160281252
* Add idl_preprocessed field to android_library.Gravatar Googler2017-06-27
| | | | | RELNOTES: Add idl_preprocessed attribute to android_library, so that preprocessed aidl files can be passed to android_library for compiling PiperOrigin-RevId: 160185474
* Add JavaSkylarkApiProvider to aar_import rule.Gravatar Googler2017-06-26
| | | | | | | Without this, aar_import targets will not have java attribute in skylark, therefore not able to generate any ide info by intellij_info_aspect in intellij_info.bzl. RELNOTES: None. PiperOrigin-RevId: 160146803
* Enabling Aapt2 processing:Gravatar corysmith2017-06-26
| | | | | | | | | | | | * Add a new aapt_version attribute to android_binary * Add a new android_aapt_version flag to control the version of aapt used. * Add a new implicit output for aapt2 produced static libraries. * Add a new implicit output for aapt2 produced .flat files zip. RELNOTES: New property on android_sdk: aapt2 Choose the version of aapt on android_binary PiperOrigin-RevId: 160145530
* ResourceFilter properly handles special language qualifiersGravatar Googler2017-06-26
| | | | | | | | | | | | | | | | | | | | Two special types of language qualifiers are commonly used: Serbian can be written in Latin or Cyrillic characters. Serbian in Latin characters is referred to as sr-Latn (or, with a misplaced region prefix, sr-rLatn, or with the permutation common in some code for the old verions of regions supported by Aapt, sr_Latn). Spanish spoken across Latin America and the Caribbean can be represented by es-419 (or, using the permutation for old qualifier formats, es_419). For both of these, transform the resource qualifier into an appropriate BCP-47 representation that can be handled by FolderConfiguration. Also, add attribute warnings when these qualifiers are used in their specially-handled form (instead of in BCP-47 form). RELNOTES: none PiperOrigin-RevId: 160143247
* Fix NullPointerException when enable_data_binding is omitted.Gravatar gregce2017-06-26
| | | | | | | | | DataBinding.isEnabled has outdated logic that enabled data binding for a rule even if only its deps use data binding. It's now required for all rules up the dependency chain to explictily enable data binding. RELNOTES: None. PiperOrigin-RevId: 159998478
* Make Metadata fields privateGravatar ulfjack2017-06-22
| | | | | | | | | | | | | Adjust the interface of Metadata to match the interface of FileArtifactValue. These classes are almost the same, but not quite, so we currently have to create and return new objects whenever the MetadataHandler is called; by making the interfaces identical, we can just return a FileArtifactValue instead (in a future change). This is in preparation for merging the ActionInputFileCache and MetadataHandler interfaces. PiperOrigin-RevId: 159802834
* Fix Android data binding for rules with no direct resources.Gravatar gregce2017-06-21
| | | | | | | | | | | | | | This essentially works by activating the annotation processor over such rules, even though technically that's unnecessary (since there are no new resources to process). But running the annotation processor guarantees we still process deps' resources, which guarantees the Java compiler references any Java classes mentioned in those resources. This prevents JavaBuilder's ---reduce_classpath from pruning these files out of the compilation classpath because "they were never used". PiperOrigin-RevId: 159597671
* Move WrappingProviderHelper into static class in WrappingProvider.Gravatar Googler2017-06-20
| | | | | | Cuts down on file count and makes it easier to find these methods. PiperOrigin-RevId: 159560422
* Create a general WrappingProvider concept and use for java_proto_library and ↵Gravatar Googler2017-06-20
| | | | | | | | | | | | friends. The wrapping provider contains its own provider map containing any providers that may conflict. This can be used generally for any aspect that wants to override its base providers (during migration), and due to the generality we should be able to cut down on code size and complexity. Once we have this, we can more easily and uniformly bind aspects to Skylark for aspect-on-aspect functionality. The Skylark providers can be instantiated with a wrapping provider if one is present, or fall through to the base target if they aren't. We will also likely save a bit of memory from cutting down on wrapping classes. PiperOrigin-RevId: 159461325
* Pass the unsigned apk and the keystore to ApkProvider.Gravatar Googler2017-06-20
| | | | | RELNOTES: None PiperOrigin-RevId: 159460633
* Extract ActionContext to a top-level classGravatar ulfjack2017-06-19
| | | | PiperOrigin-RevId: 159423459
* Rewrite the Executor/ActionExecutionContext splitGravatar ulfjack2017-06-19
| | | | | | | Move everything to ActionExecutionContext, and drop Executor whereever possible. This clarifies the API, makes it simpler to test, and simplifies the code. PiperOrigin-RevId: 159414816
* Roll forward R generation for Robolectric behind a flag to enable testingGravatar Googler2017-06-19
| | | | | RELNOTES: none PiperOrigin-RevId: 159263527
* ResourceFilter persists ordering of resources when filteringGravatar Googler2017-06-19
| | | | | | | | | | | | Before this change, resource filtering by densities could rearrange the ordering of resources. However, resource merging behavior is dependant on resource ordering, so changing the order could lead to changed merge results. Instead, ensure that the filtered resources appear in the same order as they did in the original list of resources. RELNOTES: none PiperOrigin-RevId: 159219647
* Fix resource filtering bug in interaction between densities and API versionGravatar Googler2017-06-16
| | | | | | | | | | | | | | | | | | | | ResourceFilter, following Aapt's behavior, ignored the 'version' qualifier. However, ResourceFilter also filters by densities, which is not supposed to ignore the version qualifier. Change ResourceFilter to only ignore the version qualifier when filtering by resource_configuration_filters, not densities. Without this change, when filtering by density, ResourceFilter would treat, for example, res-hdpi-v4/foo.png and res-hdpi-v11/foo.png as identical, even though they have different versions, and only use one of them when building the newly filtered list of resources. Instead, they should both be included. Also include a unit test that covers this behavior. Rather than add this in AndroidBinaryTest, create a new ResourceFilterTest class. To support that, move ResourceFilter from using the test-unfriendly RuleContext class to the easy-to-fake RuleErrorConsumer whenever possible. RELNOTES: none PiperOrigin-RevId: 159122507
* Automated g4 rollback of commit 5c2dc673a3ad2aa52f25c6f7d767671ba3e9b02c.Gravatar corysmith2017-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Appears that the generated R classes are not correct, causing test failures. *** Original change description *** Automated g4 rollback of commit 1be84ee92a825694b0c0026ac77134f8a084bd9c. *** Reason for rollback *** Rolling forward with the generated resources directory being created for tests without resources. *** Original change description *** Automated g4 rollback of commit d028d7854d3e95d97143945a1ec32944e5e4594b. *** Reason for rollback *** Breaks 1000+ targets in the depot: [] *** Original change description *** Generate pre-reconciled ids R classes for dependen... *** RELNOTES: None PiperOrigin-RevId: 159032530
* Simplify data binding documentation.Gravatar gregce2017-06-16
| | | | PiperOrigin-RevId: 158999549
* Automated g4 rollback of commit 1be84ee92a825694b0c0026ac77134f8a084bd9c.Gravatar corysmith2017-06-13
| | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Rolling forward with the generated resources directory being created for tests without resources. *** Original change description *** Automated g4 rollback of commit d028d7854d3e95d97143945a1ec32944e5e4594b. *** Reason for rollback *** Breaks 1000+ targets in the depot: [] *** Original change description *** Generate pre-reconciled ids R classes for dependency libraries with resources in the transitive closure of robolectric tests. RELNOTES: None PiperOrigin-RevId: 158756991
* Don't create the same String/ImmutableMap over and over again.Gravatar twerth2017-06-09
| | | | | RELNOTES: None PiperOrigin-RevId: 158498863
* Adds the resource class jar to the implicit outputs of android_libraryGravatar Googler2017-06-07
| | | | | | | | | An in-progress change will remove compiled R.java from runtime dependencies. To make this file available to rules that depend on it it, expose it as an implicit output instead. RELNOTES: none PiperOrigin-RevId: 158182310
* Automated g4 rollback of commit d028d7854d3e95d97143945a1ec32944e5e4594b.Gravatar lpino2017-06-07
| | | | | | | | | | | | | | *** Reason for rollback *** Breaks 1000+ targets in the depot: [] *** Original change description *** Generate pre-reconciled ids R classes for dependency libraries with resources in the transitive closure of robolectric tests. RELNOTES: None PiperOrigin-RevId: 158159550
* 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
* Expose .ap_ artifact as a skylark providerGravatar Googler2017-06-05
| | | | | RELNOTES: none PiperOrigin-RevId: 157837746
* Remove "supports-workers" tag from ApkBuilder execution info.Gravatar philwo2017-06-05
| | | | | | The C++ implementation of SingleJar, which is available in Bazel, but not yet the default, doesn't support persistent worker mode, so this causes issues when you try to use it. PiperOrigin-RevId: 157831362
* Generate pre-reconciled ids R classes for dependency libraries with resourcesGravatar corysmith2017-06-02
| | | | | | | in the transitive closure of robolectric tests. RELNOTES: None PiperOrigin-RevId: 157762190
* 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
* Fix aliases for users of label-keyed string dicts.Gravatar mstaib2017-06-01
| | | | | | | | | | | | | | | | | Aliases mess with the assumption that attributeValue.containsKey(target.getLabel()) for every target in the prerequisites of a LABEL_KEYED_STRING_DICT attribute. The solution is to use AliasProvider.getDependencyLabel(target) instead. This fixes it for all current users, including SkylarkRuleContext. This also adjusts config_setting flag_values and Android feature_flags to do intelligent things with aliases in their respective attributes. RELNOTES: None. PiperOrigin-RevId: 157594095
* When filtering resources in analysis, also filter resource rootsGravatar Googler2017-05-31
| | | | | | | | | | | | | | | | | If all resources from a directory are filtered out, the resource processing action should not receive a reference to that directory. Filtering the entire contents of a directory is uncommon but not impossible. It may be indicative of an error (if the user filters on a language, but only provided resources in other languages - in this case, the build should and will fail during Java compilation when the requested resource does not exist) or of weird but acceptable behavior (placing resources for some default language in one resource directory and resources for all other languages in some other directory, then inheriting both directories and filtering on language) that should be correctly handled. RELNOTES: none PiperOrigin-RevId: 157499745
* Remove no-op use_singlejar_for_proguard_libraryjars flag - it was removed ↵Gravatar Googler2017-05-26
| | | | | | | from global .blazerc in unknown commit RELNOTES: n/a PiperOrigin-RevId: 157133716
* Use nested sets for configured target runfiles instead of flattened lists.Gravatar Googler2017-05-26
| | | | | RELNOTES: None PiperOrigin-RevId: 157124371
* Automated g4 rollback of commit e2edf2e141a09c025a958d580c7cac7b57c70d83.Gravatar Googler2017-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Rollforward with fix. *** Original change description *** Automated g4 rollback of commit c78c947e6a8cbb323304f872a3dcabb989a3d76b. *** Reason for rollback *** Breaks android targets in the nightly - see [] *** Original change description *** Do not retain transitive data in AndroidLocalTestBase... *** ROLLBACK_OF=156745610 RELNOTES: None PiperOrigin-RevId: 157028029
* Add one version enforcement to android_robolectric_testGravatar Googler2017-05-26
| | | | | RELNOTES: add one-version enforcement to android_local_test PiperOrigin-RevId: 157014802
* Fix typos in android_device.system_image attribute documentationGravatar Googler2017-05-23
| | | | | RELNOTES: None PiperOrigin-RevId: 156827893
* Remove outdated comment.Gravatar ajmichael2017-05-23
| | | | | RELNOTES: None PiperOrigin-RevId: 156770067
* Add deprecation warning if the "legacy" manifest merger is used, now that ↵Gravatar apell2017-05-23
| | | | | | | the default has been switched to "android". RELNOTES: The 'legacy' Android manifest merger is deprecated. Please upgrade to the 'android' manifest merger, which is the same merger used by Gradle. https://developer.android.com/studio/build/manifest-merge.html PiperOrigin-RevId: 156765307
* Automated g4 rollback of commit c78c947e6a8cbb323304f872a3dcabb989a3d76b.Gravatar cpeyser2017-05-23
| | | | | | | | | | | | | | *** Reason for rollback *** Breaks android targets in the nightly - see [] *** Original change description *** Do not retain transitive data in AndroidLocalTestBase. The argument strings and artifacts were both transitive and flattened, causing O(N^2) memory consumption. PiperOrigin-RevId: 156745610
* Extract determining which manifest merger to use (legacy v android) to a ↵Gravatar Googler2017-05-22
| | | | | | | separate method. This is so that android_local_test won't need access to the AndroidConfiguration fragment. RELNOTES: None PiperOrigin-RevId: 156740056
* Create new android_host_service_fixture rule.Gravatar ajmichael2017-05-22
| | | | | | | | | | | This rule specifies a host binary that is run as part of an android_instrumentation_test. It merely collects options, support APKs and the runfiles for the host binary and passes them along to the upcoming android_instrumentation_test rule. Note that this CL does _not_ install the rule, so this CL does not make it usable by anyone. Once the other android testing rules are ready, we will install them all. One small step towards https://github.com/bazelbuild/bazel/issues/903. RELNOTES: None PiperOrigin-RevId: 156553198
* Do not retain transitive data in AndroidLocalTestBase.Gravatar Googler2017-05-15
| | | | | | The argument strings and artifacts were both transitive and flattened, causing O(N^2) memory consumption. PiperOrigin-RevId: 156083738
* Convert locale qualifiers from old Aapt format to correct format before parsingGravatar Googler2017-05-15
| | | | | | | | | | | | | | Aapt used to require resource locale qualifiers with regions of the form 'en_US', rather than the correct Android 'en-rUS'. The resource qualifier processing code used by ResourceFilter cannot handle the (incorrect) Aapt format. However, for backwards compatability, we want to continue supporting the Aapt format. Handle it by using a regex to replace the old format with the correct format when parsing. RELNOTES: none PiperOrigin-RevId: 156072395
* Remove methods from CommandLine, making it a simple argument list interface.Gravatar Googler2017-05-15
| | | | | | | * isShellCommand is now passed directly to SpawnAction * Getting the associated params file action was a test-only thing. We can pull this out of the action graph instead. PiperOrigin-RevId: 156060366