aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/android/AndroidLibrary.java
Commit message (Collapse)AuthorAge
* Remove analysis code for old resource processing pipelineGravatar asteinb2018-08-07
| | | | | | | | This code should all be unused now. Some code it calls into will be removed in the next changes. RELNOTES: none PiperOrigin-RevId: 207753966
* Add configuration for android data binding v2.Gravatar corysmith2018-08-06
| | | | | RELNOTES: None PiperOrigin-RevId: 207592136
* Cleaning up errant sysouts.Gravatar corysmith2018-08-06
| | | | | RELNOTES: None PiperOrigin-RevId: 207559097
* Move maybeAddProvider to be part of the EnabledDataBindingContext.Gravatar corysmith2018-08-06
| | | | | RELNOTES: None PiperOrigin-RevId: 207553449
* C++: Removes calls to setCcLinkparamsStore of CcLinkingInfo.BuilderGravatar plf2018-08-06
| | | | | | | | This is in preparation for deleting CcLinkParamsStore. Not all calls to setCcLinkparamsStore have been removed in this CL. RELNOTES:none PiperOrigin-RevId: 207516944
* Moved all external calls to isDataEnabled to DataBindingContext and made it ↵Gravatar corysmith2018-08-03
| | | | | | | private. RELNOTES: None PiperOrigin-RevId: 207335684
* Reduce and centralize databinding context instances.Gravatar corysmith2018-08-03
| | | | | | | Due to some of the vagaries of skylark and multiple entry points, the databinding context is currently updated by the parse action. RELNOTES: None PiperOrigin-RevId: 207333111
* Internal changeGravatar ruperts2018-07-30
| | | | PiperOrigin-RevId: 206642715
* Document AndroidLibrary.java for readability.Gravatar jingwen2018-07-27
| | | | | RELNOTES: None. PiperOrigin-RevId: 206393574
* C++: Removes calls to setCcLinkparamsStore of CcLinkingInfo.BuilderGravatar plf2018-07-26
| | | | | | | | | | This is in preparation for deleting CcLinkParamsStore. Not all calls to setCcLinkparamsStore have been removed in this CL. Roll forward with bzl change in separate CL (unknown commit) and giving a proper error in Skylark instead of a crash when CcLinkingInfo is not built correctly. RELNOTES:none PiperOrigin-RevId: 206122870
* Automated rollback of commit 16dde0de06a3a4157a13e7e7264afeb6a50b2dde.Gravatar janakr2018-07-25
| | | | | | | | *** Reason for rollback *** Crash (see linked bug). PiperOrigin-RevId: 206060905
* C++: Removes calls to setCcLinkparamsStore of CcLinkingInfo.BuilderGravatar plf2018-07-25
| | | | | | | | This is in preparation for deleting CcLinkParamsStore. Not all calls to setCcLinkparamsStore have been removed in this CL. RELNOTES:none PiperOrigin-RevId: 205998687
* C++: Refactors every provider wrapping CcLinkParamsStoreGravatar plf2018-07-23
| | | | | | | | Providers that were wrapping CcLinkParamsStore now wrap CcLinkingInfo instead. CcLinkParamsStore will be deleted in a future CL. RELNOTES:none PiperOrigin-RevId: 205629924
* Expose ProguardSpecProvider to skylark.Gravatar Googler2018-07-17
| | | | | RELNOTES: None PiperOrigin-RevId: 204974291
* Expose AndroidLibraryResourceClassJarProvider to skylark.Gravatar Googler2018-07-17
| | | | | RELNOTES: None PiperOrigin-RevId: 204953629
* Expose AndroidCcLinkParamsProvider to Skylark as AndroidCcLinkParamsInfo.Gravatar Googler2018-07-17
| | | | | RELNOTES: None PiperOrigin-RevId: 204927047
* Create a whitelist for android_library rules with deps but not srcsGravatar cushon2018-07-03
| | | | PiperOrigin-RevId: 203230801
* Use independently passed assets in aapt2 packaging as wellGravatar asteinb2018-05-29
| | | | | | | | | | | | | | Much earlier, I made a change that allowed passing assets without resources to aapt packaging. Do the same for aapt2 packaging too. The busybox seems to be expecting compiled symbols, so compile assets and pass the compiled version in. (Compiling assets doesn't save any time, but doesn't cost much either, and means that we'll eventually be able to phase out the parsed form entirely. Adapting the Busybox to take parsed assets would probably work too, but getting the code to handle it would be really messy.) RELNOTES: none PiperOrigin-RevId: 198417111
* Automated rollback of commit 372fbc2f016157b0331f83a20edad10d4b4cf9f7.Gravatar asteinb2018-05-25
| | | | | | | | | | | | | *** Reason for rollback *** Roll forward with fix: I was assuming that R.txt and symbols files are always set, but they can be null in some cases (especially in the old data processing pipeline). Properly handle them here. RELNOTES: none PiperOrigin-RevId: 198075743
* Automated rollback of commit 9d5c323a6e66842cfeb98462cf949dee58710fb8.Gravatar plf2018-05-25
| | | | | | | | *** Reason for rollback *** Crashes lots of targets in nightly blaze-2018.05.24-1: PiperOrigin-RevId: 198049395
* Move resource busybox actions to BusyBoxActionBuilder and AndroidDataContextGravatar asteinb2018-05-23
| | | | | | | | | | | | | | | | | | | | | | | BusyBoxActionBuilder makes much cleaner action builders while making it harder to do Bad Things (like collapsing NestedSets in analysis, or adding an artifact to one of the command line and the inputs but not both). Also: - In merging, simplify the code somewhat by removing unneeded conditionals - for example, the parsed merging action will always be built given the current code. - In the few builders where we aren't doing so already, parameter files should always be shell quoted and always be used when the OS is Windows. The BusyBox should always support the former and require the latter (although sufficiently large inputs may have masked this by triggering parameter files in Windows anyway). - In the builder for linking (within validation), no longer collapse the NestedSet of transitiveCompiledSymbols when adding them to the inputs. Using the new BusyBoxActionBuilder code, trying to do this would throw an IllegalStateException. RELNOTES: none PiperOrigin-RevId: 197728382
* Pass AndroidDataContext through manifest processing methodsGravatar asteinb2018-05-22
| | | | | | | | | | | | | | | Manifest processing methods are particularly messy for this migration, since the old ApplicationManifest class is still around. Anyway, pass around AndroidDataContext instead of RuleContext everywhere we can. Note that the built-in expander does not seem able to be modified to support decoupling attributes and other information, and thus really can't be done once we get rid of RuleContext. Instead, for Skylark rules, document that expansion must happen outside of the Android data Skylark method calls (for example, for manifest_values and nocompress_extensions). RELNOTES: none PiperOrigin-RevId: 197567541
* Pass through AndroidDataContext in more placesGravatar asteinb2018-05-22
| | | | | | | | As before, actual action builders will be changed in a future CL; this just starts moving AndroidDataContext in so it's available. RELNOTES: none PiperOrigin-RevId: 197561737
* Pass AndroidDataContext through new asset and resource pipelinesGravatar asteinb2018-05-22
| | | | | | | | | | | | | | This is the first step towards using AndroidDataContext in all of Android data processing. This change does not actually modify the asset and resource processing action builders themselves - they will be migrated in an upcoming change. Also, add AndroidSemantics to some rules so they can make an AndroidDataContext. RELNOTES: none PiperOrigin-RevId: 197555938
* Expose local_proguard_specs to Skylark.Gravatar Googler2018-05-16
| | | | | RELNOTES: none PiperOrigin-RevId: 196824775
* Create top-level android data providerGravatar asteinb2018-05-10
| | | | | | | | | | | | | This provider wraps the other android data providers, as well as artifacts that should only be made available for top-level Android targets. This provider is required for some output (such as final data APK) to be exposed to Skylark, and also makes it easy to pass information from android_binary data processing to postprocessing actions, most notably resource shrinking (next reviews). RELNOTES: none PiperOrigin-RevId: 196135042
* Expose Skylark method to process android_local_test dataGravatar asteinb2018-05-09
| | | | | RELNOTES: none PiperOrigin-RevId: 196024071
* Expose Library Aar creation and provider to SkylarkGravatar asteinb2018-05-07
| | | | | RELNOTES: none PiperOrigin-RevId: 195719735
* Make Aar provider into NativeInfoGravatar asteinb2018-05-07
| | | | | | | This provider needs to be the new type so we can expose Aar information in Skylark RELNOTES: none PiperOrigin-RevId: 195710606
* Automated rollback of commit f384ab5855ba230e7767b7b5350bd72ef01b9a1b.Gravatar asteinb2018-05-07
| | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Memory regression (b/79331026) *** Original change description *** Some fixup for R.class files Expose R.class file in AndroidResourcesInfo, to allow Java compilation. Include documentation that the R.class should not be used in other targets. Actually generate the R.class file in the case of an android_library with no manifest, resources, or assets, rather than compiling it from the R.java RELNOTES: none PiperOrigin-RevId: 195659672
* Some fixup for R.class filesGravatar asteinb2018-05-04
| | | | | | | | | | | | Expose R.class file in AndroidResourcesInfo, to allow Java compilation. Include documentation that the R.class should not be used in other targets. Actually generate the R.class file in the case of an android_library with no manifest, resources, or assets, rather than compiling it from the R.java RELNOTES: none PiperOrigin-RevId: 195419781
* Move Aar generation code to dedicated Aar classGravatar asteinb2018-05-03
| | | | | | | | | This gets it out of the AndroidLibrary code. Everything ends up cleaner, plus it'll be easier to call into this code from a method exposed to Skylark (next review). RELNOTES: none PiperOrigin-RevId: 195289199
* Fix up newly discovered bugs in decoupled Android data processingGravatar asteinb2018-05-03
| | | | | | | | | | | | | | | | | | | | | | | | - Always generate a symbols file - the new resource processing pipeline likes knowing that this is non-null, and it shouldn't cost much extra to create. - A misleading method signature (which I made) led to me forgetting about Proguard artifacts. Properly propogate them into the ResourceApk object. - Don't get Aapt version directly from AndroidConfiguration - there's some additional logic in AndroidAaptVersion not exposed elsewhere - Split library tests that expect resources and assets to be processed together to have a new version where they're processed seperately. - Tests use ValidatedAndroidData interface rather than ResourceContainer object - Properly move some LocalTest magic around resource JAR out of the old pipeline only, as it should apply to both old and new pipelines. - Processing action defaults to empty resource and asset deps rather than null RELNOTES: none PiperOrigin-RevId: 195253161
* Adding a check to verify the usage of the migration tag for the SkylarkGravatar Googler2018-04-27
| | | | | | | migration, when a flag is enabled. RELNOTES: PiperOrigin-RevId: 194630925
* Normalize parameter name commentsGravatar cushon2018-04-27
| | | | PiperOrigin-RevId: 194512971
* Wire up decoupled data pipeline in android_libraryGravatar asteinb2018-04-18
| | | | | | | | | | | | The decoupled pipeline is safely hidden behind a flag. Since we temporarily have two different pipelines, this temporarily make AndroidLibrary messier, but it will end up much cleaner once the old pipeline is removed. The new pipeline should not be turned on until other Android rules are updated to support it (next few changes). RELNOTES: none PiperOrigin-RevId: 193361608
* Ability to stop using ResourceContainer in various actionsGravatar asteinb2018-04-18
| | | | | | | | | | | | | | | | | | | | | Now that we support decoupled asset and resource processing in the basic pipeline, we can also support it in these actions. ResourceShrinker actions, by design, does not use assets, so the change is trivial. For the AarGenerator, things get a bit more complex: - Simplify needlessly complex code around AAR generation - Move around special resource processing to generate AAR inputs in the case where there are no local resources to go next to normal resource processing - Also, clean up that code - ResourceApk wrapper class has some fields which are non-null even in the case where resources are inherited - Always pass assets and resources seperately to the AarGenerator action RELNOTES: none PiperOrigin-RevId: 193355790
* Create pipeline for monolithic data processing with decoupled classesGravatar asteinb2018-04-18
| | | | | | | | | | | The AndroidResourceProcessingAction does all of asset parsing and merging and all of resource parsing, merging, and validation except for R class generation, all in one action. Add class to wrap the intermediate output of this action. It can trigger R class generation to create a full ValidatedAndroidResources object. RELNOTES: none PiperOrigin-RevId: 193350591
* Clean up R class generationGravatar asteinb2018-04-18
| | | | | | | | | | | Remove R class generation from AndroidCommon and instead invoke it just after resource processing. This is much more intuitive, behaves the same, and will make it easier to call into R class generation on the new pipeline. Also, clean up some dead code (including newly-dead code) from AndroidCommon. RELNOTES: none PiperOrigin-RevId: 193345190
* Add decoupled asset containers to ResourceApk wrapper objectGravatar asteinb2018-04-17
| | | | | | | | | | | The ResourceApk object contains all the processed Android data. When assets are decoupled, pass them in seperately. I'll replace ResourceContainer with the ValidatedAndroidData interface as part of the next review. RELNOTES: none PiperOrigin-RevId: 193223251
* Ability to pass decoupled assets into monolithic resource processing actionGravatar asteinb2018-04-17
| | | | | | | | | - New flags to pass in asset deps - Pass assets into merging in the monolithic action - Field for asset deps in asset builder action RELNOTES: none PiperOrigin-RevId: 193211038
* Create proguard.txt in android_library AAR output.Gravatar ajmichael2018-04-02
| | | | | | | | | The proguard.txt is the concatenation of the proguard_specs on the android_library rule itself. Note that it does not include transitively defined proguard_specs. Fixes https://github.com/bazelbuild/bazel/issues/4467 RELNOTES: android_library AAR output now contains proguard.txt PiperOrigin-RevId: 191302610
* Rename LocalResourceContainer to AndroidResources and remove asset code from itGravatar asteinb2018-03-29
| | | | | | | | | | | | | As part of decoupling Android resources and assets, rename LocalResourceContainer to AndroidResources and remove asset code from it. Some general asset and manfiest code still remains and will be dealt with in future changes. Remove LocalResourceContainer from the ParsingActionBuilder, since it's always used to build the ResourceContainer that is subsequently passed in. RELNOTES: none PiperOrigin-RevId: 190945260
* Allow android_library rule to also accept rules that provide the JavaInfoGravatar Googler2018-03-20
| | | | | | | provider as an input. RELNOTES: PiperOrigin-RevId: 189868401
* Expose an actions provider on RuleConfiguredTarget instances.Gravatar cparsons2018-03-06
| | | | | | | | | Given a target (for example from a skylark aspect), one will be able to access a list of actions that the target generated using "target.actions". This is without additional memory footprint. Actions themselves are not fully exposed to skylark (and thus there isn't much meaning to gather from them in skylark yet). Access methods will follow soon. RELNOTES: None. PiperOrigin-RevId: 188098079
* Rename NativeLibsZipsInfo to AndroidNativeLibsInfo.Gravatar Googler2018-02-16
| | | | | | | | | Expose AndroidNativeLibsInfo constructor to Skylark. Marked as undocumented, since this provider will we replaced with a provider implemented in Skylark once all rules are migrated. RELNOTES: None PiperOrigin-RevId: 186072410
* Expose aar native libs to skylark.Gravatar Googler2018-02-15
| | | | PiperOrigin-RevId: 185927949
* Don't generate the blaze generated extension registry for Android tests that ↵Gravatar Googler2018-02-06
| | | | | | | | | | define a binary_under_test. They are filtered out for deployment anyways so it's unnecessary work and it confuses the one version detector. RELNOTES: n/a PiperOrigin-RevId: 184725205
* Return JavaPluginInfoProvider via JavaInfo in android_library.Gravatar elenairina2018-02-06
| | | | PiperOrigin-RevId: 184689620
* Remove dead android_resources codeGravatar Googler2017-12-22
| | | | | RELNOTES: none PiperOrigin-RevId: 179928735