aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/android/java/com
Commit message (Collapse)AuthorAge
* Final tweaks and fixes to enable aapt2 for Blaze.Gravatar corysmith2017-08-24
| | | | | | | Implemented processing databinding for compile passes RELNOTES: None PiperOrigin-RevId: 166215052
* Adds compile action for aapt2: Aapt2ResourcePackagingActionGravatar corysmith2017-08-23
| | | | | | | | Adds a ManifestContainer interface to centralize the types that provide manifests. Adds PackagedResources to represent a linked dexless resource apk RELNOTES: None PiperOrigin-RevId: 166193049
* Remove workaround. The ASM bug is fixed. And we use ClassRemapper now.Gravatar cnsun2017-08-22
| | | | | RELNOTES: None PiperOrigin-RevId: 165949162
* Switch android tools' use of options parser to a more concise form for the ↵Gravatar ccalvarin2017-08-21
| | | | | | | | | | | single options-base case. This is to prepare the options parser from making options parser creation exceptions a caught exception. Since all of these classes already have a single options class and used parseAndExitUponError, this allows us to keep behavior consistent between the malformed options-base errors and the incorrect user-input errors. All the other uses of the options parser in //src/tools already throw sufficiently broad exceptions to not need this. RELNOTES: None PiperOrigin-RevId: 165702786
* Partially revert ↵Gravatar cnsun2017-08-18
| | | | | | | https://github.com/bazelbuild/bazel/commit/bcb0354b2d7c7a8f824e9dab76cb21526a81a045. The try-with-resources library need to be compiled with java7, as we directly copy the classes into the desugared jar. RELNOTES: None PiperOrigin-RevId: 165637473
* Bazel source code is no longer java7.Gravatar ajmichael2017-08-17
| | | | | RELNOTES: None PiperOrigin-RevId: 165471665
* android_library can be used in the resources attributeGravatar Googler2017-08-16
| | | | | | | | | | | | | | | | | | | | | | This allows us to perform a more gradual migration away from the android_resources rule. Specifically, rather than move all android_resources targets and simultaneously move all resources attributes, we can now first transform all android_resources rules into android_library rules, and then afterwards migrate dependencies on those rules from resources into deps. This allows a two-part migration. The resources attribute, once allowed to take android_library targets, should continue to work exactly as before. There is one change in behavior - for this to work, android_library targets now need to build an output APK during resource processing. This APK will be removed once the resources attribute is removed. Once the migration is complete, the resources attribute will be removed completely. RELNOTES: none PiperOrigin-RevId: 165313447
* Validate and Link libraries action for aapt2Gravatar corysmith2017-08-14
| | | | | RELNOTES: None PiperOrigin-RevId: 165012084
* Use all resource types in PlaceholderIdFieldInitializerBuilderGravatar Googler2017-08-14
| | | | | | | | | | | | | | All resource types should be supported by PlaceholderIdFieldInitializerBuilder. Will keeping the ordering from the previous scheme, ensure that all of the contents of ResourceType.values() are considered. This means that, when adding new resource types, only updating the ResourceType enum is needed. A previous attempt at this change tried eliminating the special ordering of resource types entirely, on the grounds that it shouldn't be needed. However, strange build failures mean we're keeping it there for now. RELNOTES: none PiperOrigin-RevId: 164983075
* multi-thread DexFileMergerGravatar kmb2017-08-11
| | | | | | RELNOTES: speedup of incremental dexing tools PiperOrigin-RevId: 164926895
* Adds aapt2.ResourceCompiler and CompileLibraryResourcesAction.Gravatar corysmith2017-08-11
| | | | | | | | | | Refactorings: * Change data binding to have configurable archive generation * Extract a ZipBuilder class from the ZipBuilderVisitor to provide a general purpose archiving class. * Small changes to visibility AaptCommandLineBuilder for reuse in the aapt2 code. RELNOTES: None PiperOrigin-RevId: 164880571
* Remove invalid check. It is possible that an interface initializer can setGravatar cnsun2017-08-09
| | | | | | | | fields in other classes. The original check assumes that this is not possible. This CL just deletes that check. RELNOTES: None PiperOrigin-RevId: 164622080
* write dex archives uncompressedGravatar kmb2017-08-09
| | | | | | RELNOTES: none PiperOrigin-RevId: 164620306
* Automated rollback of commit 963db879575132933d9254406b4c76a8f10b0ad1.Gravatar ajmichael2017-08-09
| | | | | | | *** Reason for rollback *** RELNOTES: None PiperOrigin-RevId: 164590392
* Remove special ordering of resources from PlaceholderIdFieldInitializerBuilderGravatar Googler2017-08-08
| | | | | | | | | | | | | | | | | | | | | | Before this change, PlaceholderIdFieldInitializerBuilder attempted to exactly mimic the behavior of Aapt and Gradle in assigning resource IDs. However, nothing should be relying on that specific behavior. Even if code for some reason is relying on that behavior (by, for example, doing math on a resource ID to get another resource ID), this code is currently only used to compile library resource files, which are not actually used in finished android_binary targets. This change removes the part that relies on a specific ordering of ResourceTypes; it instead just relies on the names and ordering within ResourceType. This makes things a bit simpler and also ensures new resource types added to the ResourceType enum will be picked up automatically. In particular, this change will allow us to use the new Font resource type as soon as it is released in android_ide_common. RELNOTES: none PiperOrigin-RevId: 164497262
* improve efficiency of no-op desugaringsGravatar kmb2017-08-08
| | | | | | | | | - skip lambda desugaring when it won't do anything - skip ASM class writing when no desugarings apply to an input class also minor improvements to prefix remapping RELNOTES: none PiperOrigin-RevId: 164492293
* don't use methods and classes removed in upstream dxGravatar kmb2017-08-07
| | | | | | RELNOTES: update dexing tools to Android SDK 26.0.1 PiperOrigin-RevId: 164278101
* Android BusyBox: deprecate --libraries flagGravatar laszlocsomor2017-08-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deprecate the --libraries flag of the GENERATE_BINARY_R tool in favour of --library. The new flag is multi-value and uses "," as the pair-separator instead of ":". The value converter still supports ":"-separated pairs as well, but looks for "," first. Old format: --libraries=key1:value1,key2:value2,... New format: --library=key1,value1 --library=key2,value2 Motivation: - the ":"-separator prevents using absolute paths on Windows The old flag is still supported, but will be removed after 2018-02-28 (about 6 months from now). Also in this commit: - add a new method to CustomCommandLine.Builder to lazily construct the command line for the --library flag See https://github.com/bazelbuild/bazel/issues/3264 RELNOTES: none PiperOrigin-RevId: 164246506
* Tolerate missing interface markers in method calls from interface methods to ↵Gravatar kmb2017-08-03
| | | | | | | | methods in that interface. RELNOTES: none PiperOrigin-RevId: 164041648
* Alter the order of class visitors, to make sure that Objects.requireNonNUllGravatar cnsun2017-08-03
| | | | | | | and Long.compare are correctly handled. RELNOTES: None PiperOrigin-RevId: 164018569
* Bazel, Android: fix Bazel CI breakageGravatar laszlocsomor2017-08-01
| | | | | | | | Add a `select` so Bazel won't try to build windows_jni.dll on Linux/MacOS. RELNOTES: none PiperOrigin-RevId: 163832982
* Android BusyBox: remove dead codeGravatar laszlocsomor2017-08-01
| | | | | | | | Remove Converters.ExistingPathListConverter, it wasn't used anywhere. RELNOTES: none PiperOrigin-RevId: 163810436
* Windows: Android BusyBox can access the JNI libGravatar Laszlo Csomor2017-07-31
| | | | | | | | | | | | | | | Add a data-dependency on the windows_jni.dll from the BusyBox in BUILD.tools, so the BusyBox in @build_tools// can actually find it at runtime. Also update the script that builds the .dll so that it works if the source files have an "external/bazel_tools/" prefix. Related to https://github.com/bazelbuild/bazel/issues/3264 Change-Id: I005e9d2c00253a59d2cd5cc9f3a93528dc4d2e9e PiperOrigin-RevId: 163691320
* Using cc_binary to build windows_jni.dllGravatar Yun Peng2017-07-31
| | | | | | | Get rid of build_windows_jni.sh and the corresponding genrule. Change-Id: I89a199b61109f5687f8b500b60d284cae97f6457 PiperOrigin-RevId: 163679307
* Remove old intellij aspect code bundled with BazelGravatar Googler2017-07-31
| | | | PiperOrigin-RevId: 163538636
* Disable desugaring try-with-resources when --min_sdk_version is above 18.Gravatar cnsun2017-07-28
| | | | | RELNOTES: None PiperOrigin-RevId: 163376758
* Fix NPE when passing null Location to XMLStreamException.Gravatar Googler2017-07-27
| | | | PiperOrigin-RevId: 163291269
* Resource filtering should preserve all matching artifacts, despite shared namesGravatar Googler2017-07-27
| | | | | | | | | | | | | | | | | | Before this change, density-based resource filtering tracked resources by qualifiers and name. Resources with density qualifiers specified would go into this code, but only one resource would be chosen from each each (qualifier, name) pair. Instead, track the resource using its entire path, this tracking resources with the same name seperately. Also, in case multiple resource are passed to the resource processing action, resource filtering only ignores a file if its name was in the list of resources to ignore *and* it does not exist. Otherwise, legitimate resources with the same name as a filtered resource might be ignored. RELNOTES: none PiperOrigin-RevId: 163235681
* Fix ScopedTemporaryDirectory causes crash when filesystem doesn't support xattr.Gravatar philwo2017-07-25
| | | | PiperOrigin-RevId: 163053841
* In UseBridge.class, check whether the owner of the method call instruction andGravatar cnsun2017-07-24
| | | | | | | | | | the owner of the method reference have assignable relation. If yes, use the bridge method. This CL addresses the integration problem between Desugar and the lambda factory of JDK 9. The change in JDK 9 is here,http://hg.openjdk.java.net/jdk9/dev/jdk/rev/a3b3c7b6464d. RELNOTES: None PiperOrigin-RevId: 162965244
* Stop reporting manifest merge errors as exceptions with stack traces as well ↵Gravatar apell2017-07-24
| | | | | | | as printing the merge error report. The stack traces duplicated the error report and gave the impression that the error may be an internal error instead of a build error. RELNOTES: None. PiperOrigin-RevId: 162755827
* Automated rollback of commit 01ddfb7bf418b371859de62f4eab2f41ea9a4a4a.Gravatar laszlocsomor2017-07-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a partial rollback. I restored the old flags (with PathListConverter), added the new ones, added deprecation warnings and annotations, and added code to concat the values of new and old. Existing released versions of Bazel should keep working with the new code until 2018-01-31, i.e. for the next ~6 months. After that I'll remove the old flags and the PathListConverter. *** Reason for rollback *** Fixed broken integration with release Blaze. *** Original change description *** Automated rollback of commit 5752463ece84ebb4fb074888cba57412ab8d86b3. *** Reason for rollback *** Broke too many targets. *** RELNOTES: none PiperOrigin-RevId: 162587548
* Make the @Option annotation depend on the java version of the tagging enums.Gravatar ccalvarin2017-07-18
| | | | | | | The option filters proto dependency can be removed from the OptionsParser. This is in response to option parser users that want to avoid the bazel-internal proto file in their dependencies. RELNOTES: None. PiperOrigin-RevId: 162249778
* Internal changeGravatar Googler2017-07-17
| | | | PiperOrigin-RevId: 162194755
* AndroidBusyBox: deprecate path-list-type flagsGravatar laszlocsomor2017-07-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit: - deprecates PathListConverter - removes ExistingPathListConverter because it was not used in production, only tests - deprecated List<Path> type flags that use PathListConverter - introduces new List<Path> type flags next to the deprecated ones that use @Options.allowMultiple and convert with PathConverter; the new and old lists are concatenated, yielding the flag value PathListConverter and all of its occurrences should be removed after 2018-01-31 (about 6 months from now, which is a safe enough timeframe for everyone to upgrade Bazel so it uses the new-style flags). Reason for deprecation is that colon-separated path lists don't work on Windows because paths have colons in them. Since the Android BusyBox is not intended to be executed by users but by Bazel only, there's no release notes necessary. See https://github.com/bazelbuild/bazel/issues/3264 RELNOTES: none PiperOrigin-RevId: 162193998
* Add flag to turn Android resource merge conflicts from warnings into errorsGravatar Googler2017-07-14
| | | | | RELNOTES: none PiperOrigin-RevId: 161831232
* Fix bug where merge conflicts for resources defined in XML with equal values ↵Gravatar Googler2017-07-13
| | | | | | | were being falsely logged during build as warnings RELNOTES: none PiperOrigin-RevId: 161723206
* Fold OptionUsageRestrictions into OptionDocumentationCategory and ↵Gravatar ccalvarin2017-07-11
| | | | | | | | | | OptionMetadataTags. These are similar, no need to have both fields. Removing the "DOCUMENTED" default, the absence of UNDOCUMENTED will be used instead. Since requiring a documentation category for undocumented options doesn't make sense, list that as one of the OptionDocumentationCategories, but list HIDDEN and INTERNAL as part of OptionMetadata. These options should list UNDOCUMENTED as their category. PiperOrigin-RevId: 161515674
* AndroidResourceOutputs: fix ZipEntry pathsGravatar Laszlo Csomor2017-07-11
| | | | | | | | | | Make sure that ZipEntry paths always use forward slashes, even on Windows. Also add a test. See https://github.com/bazelbuild/bazel/issues/3264 Change-Id: I4508e46dde49cd44c8e3792017d0d280a51dc565 PiperOrigin-RevId: 161500049
* Android BusyBox: use the JunctionCreatorGravatar Laszlo Csomor2017-07-11
| | | | | | | | | | | | | | | | | | | Use the recently added JunctionCreator class in the Android BusyBox. Query the current OS's name, where the BusyBox process runs (using System.getProperty("os.name")) and instantiate the corresponding JunctionCreator implementation. This allows the BusyBox to work around path length limitations on Windows; see WindowsJunctionCreator. See https://github.com/bazelbuild/bazel/issues/3264 Change-Id: Ifc1a3c86971e64c2f42bcec2988b7e9239a1d29a PiperOrigin-RevId: 161494557
* Windows, Android BusyBox: create JunctionCreatorGravatar Laszlo Csomor2017-07-10
| | | | | | | | | | | Introduce the JunctionCreator classes that the Android BusyBox can use to work around path length limitations on Windows. See https://github.com/bazelbuild/bazel/issues/3264 Change-Id: Ia5ee39f0635dcc2690ffb1755dc56d21e7bc7536 PiperOrigin-RevId: 161378422
* Android: fix path bugs and enable tests on WindowsGravatar Laszlo Csomor2017-07-10
| | | | | | | | | | | | | | Now all tests under //src/test/j/c/g/devtools/build/android/...:* pass on Windows, yay! Also adjust test sizes as advised by Bazel (using --test_verbose_timeout_warnings). See https://github.com/bazelbuild/bazel/issues/3264 Change-Id: I3f1f4978306bdedaf805149295daa413d2248fbb PiperOrigin-RevId: 161373699
* Remove an unused constructorGravatar cushon2017-07-07
| | | | PiperOrigin-RevId: 161125326
* Identify which methods are used in invokedynamic, and only desugar theseGravatar cnsun2017-07-03
| | | | | | | methods. RELNOTES: None PiperOrigin-RevId: 160663025
* Windows, Android: ScopedTemporaryDirectory bugfixGravatar Laszlo Csomor2017-07-03
| | | | | | | | | | | | ScopedTemporaryDirectory now makes all files writable before attempting to delete them. This is important on Windows where readonly files cannot be deleted, the attempt resulting in an exception. See https://github.com/bazelbuild/bazel/issues/3264 Change-Id: If79478a4b419c05d77ce89cc30cb701d42df1b75 PiperOrigin-RevId: 160644599
* Add the rest of the categories transition values to android options.Gravatar ccalvarin2017-06-30
| | | | | | Automated formatting fixes standardize the @Option annotation. PiperOrigin-RevId: 160582653
* Flip the flag --rewrite_calls_to_long_compare to false by default. NowGravatar cnsun2017-06-30
| | | | | | | | desugaring Long.compare(long, long) is only enabled if either --min_sdk_version < 19 or --rewrite_calls_to_long_compare is specified. RELNOTES: set --rewrite_calls_to_long_compare to false by default. PiperOrigin-RevId: 160578028
* Add categories transition values to android options.Gravatar ccalvarin2017-06-30
| | | | | | Automated formatting fixes standardize the @Option annotation. PiperOrigin-RevId: 160567787
* Open source dexer tests.Gravatar ajmichael2017-06-29
| | | | | RELNOTES: None PiperOrigin-RevId: 160461708
* When we access a field of an interface, if the field is of type long or double,Gravatar cnsun2017-06-29
| | | | | | | then we use pop2 to pop the value out of the stack. RELNOTES: None PiperOrigin-RevId: 160453904