summaryrefslogtreecommitdiff
path: root/java/java.go
AgeCommit message (Collapse)Author
2019-05-10Make core-generated-annotation-stubs link as core stubs.Pete Gillin
Bug: 123891440 Test: EXPERIMENTAL_USE_OPENJDK9=true make droid (cherry picked from commit 4528becc46d69963a838c5af05e6ad9075b63bbe) Merged-In: I117828f13a604030d1c36bdb60fffec4c4e08d6e Change-Id: I17fa4e0c4106b63bf3cb0e3c3f78498a4072d9f5
2019-05-08Don't hide *.kotlin_module in turbine dependenciesColin Cross
The jars containing the merged header classes from transitive static dependencies were stripping all of META-INF/. Kotlin puts metadata in META-INF that is used to map the package to the static class that contains the package-level functions. This also exposed that the metadata in META-INF is always called "name.kotlin_module", so a library that contains kotlin files with a dependency that also contains kotlin files would shade the metadata file. Use a unique name instead. Fixes: 131709692 Test: m checkbuild Change-Id: I5cd276e563206e37c4c0d90fe9f346e9396f88c0
2019-05-06Track sources for srcjars across modulesColin Cross
Robolectric coverage needs a srcjar that sometimes needs to include sources of dependencies. Track the arguments and dependencies necessary to jar the sources. Test: TestIncludeSrcs Change-Id: I9979d2b8350923a2237e743c232e6e548f54ba3b
2019-05-06Allow module types to generate resourcesColin Cross
Robolectric will need to generate extra resources to be added to the jar. Test: TestResources Change-Id: I028f91ea8fc5d1e59e4e805876d70f57d8899f11
2019-04-29Reverse merge order of resources and implementationColin Cross
Merge the resources first in case one of the static libraries merge into the implementation jars contains a duplicate resource. Also put the manifest into the resource jar so that the default manifest doens't override the custom manifest. Test: m checkbuild Change-Id: I96d117c306bc9f1346720251d3993031992cef66
2019-04-25Merge "Support target.hostdex.required"Colin Cross
2019-04-24Support target.hostdex.requiredColin Cross
Hostdex modules sometimes need extra required modules, add target.hostdex.required. Bug: 131167818 Test: manual Change-Id: I599f3499f0b738556baeb27185371a42b4c2701b
2019-04-24Make java_test_helper_library installableColin Cross
java_test_helper_library should product an installabler, dexed library, the same as java_test just without the auto-generated test config. Test: m checkbuild Change-Id: Ie573c1d24969ba9c4feb8a2e85f8969d5d713064
2019-04-21Merge "Build framework.aidl in Soong"Colin Cross
2019-04-18Build framework.aidl in SoongColin Cross
Move the rules to build framework.aidl into Soong, and use it when compiling aidl files with sdk_version: "current". Also fixes incorrectly using the aidl includes exported by the "framework" module when the proguardRaiseDep dependency was added. Bug: 130798034 Test: sdk_test.go Change-Id: I126adf1d9e7b6acb528875ff62b974ba7ad9a337
2019-04-17Fix handling optimize.enabled from java_defaultsSasha Smundak
Some module types (`android_test`, etc.) set `optimize.enabled` by default. If such module happens to have `defaults` attribute which clears `optimize.enabled`, the latter value is ignored. Fixes: 129858282 Test: unit tests in java_test.go, `atest CtsExtendedMockingTestCases` succeeds with aog/936802 reverted (that is, with cts/test/mocking converted to Android.bp) Change-Id: Ib8e3a0ab0bd489d70ed07f626082aeae31c45e7c
2019-04-17Add support for prebuilt java_sdk_library modulesColin Cross
Add java_sdk_library_import for use when a java_sdk_library may be used by unbundled branches that do not have the project that contains the original java_sdk_library module. Bug: 130287656 Test: m checkbuild Change-Id: I62df4bccc0da95ed6c8b31dab8f2c32cc3215e9e
2019-04-08Check package restrictions for Java libs.Vladimir Marko
Test: m checkbuild; inspect verbose log. Test: Manual - compile with unmet restrictions. Bug: 122937705 Change-Id: I9360ae8b6d9ce016b7827be5e8ffc6eb521809b7
2019-04-02Add support for protoc pluginsColin Cross
Add a proto.plugin property to allow specifying a custom protoc plugin to generate the code. Fixes: 70706119 Test: m am StreamingProtoTest Change-Id: I1ecdd346284b42bbcc8297019d98d2cd564eb94c
2019-03-25Add java_test_helper_libraryPaul Duffin
Extracts testSuiteComponent() function to reduce duplication. Bug: 128969758 Test: atest CtsJdwpTestCases Change-Id: I23746b18112d22f8670666f429a665b34b1955fd
2019-03-22Rename jetifier property and add it to androidmkColin Cross
Rename jetifier_enabled to jetifier since there are no users yet and it is more consistent with the rest of the Soong properties. Also add it to androidmk translation. Fixes: 123524520 Test: androidmk_test.go Change-Id: Ib4c688cf3cb171a822ddf7dd49467522c4c1276c
2019-03-21Add override_android_app module type.Jaewoong Jung
This is a new implementation of overriding module types that makes use of local variants. With this, product owners can use PRODUCT_PACKAGES to decide which override module to include in their products. Bug: 122957760 Bug: 123640028 Test: app_test.go Change-Id: Ie65e97f615d006b6e9475193b6017ea9d97e8e97
2019-03-20Replace ctx.ExpandSources with android.PathsForModuleSrcColin Cross
Move the logic from ctx.ExpandSources into android.PathsForModuleSrc and ctx.ExpandSource into android.PathForModuleSrc, and deprecate them. When combined with the pathDepsMutator this will let all properties that take source paths also take filegroups or genrule outputs, as long as they are tagged with `android:"path"`. Test: All soong tests Change-Id: I01625e76b5da19240e9649bf26a014eeeafcab8f
2019-03-20Add dex_import module typeColin Cross
Add a module type for importing a prebuilt jar that contains classes.dex files. Test: m with a prebuilt jar that contains classes.dex files in PRODUCT_BOOT_JARS Test: java_test.go, dexpreopt_test.go, dexpreopt_bootjars_test.go Bug: 124804356 Bug: 125517186 Change-Id: I496848f9dca11f758d49b1cb68168cec7f8e1718
2019-03-19Support package_splitsColin Cross
Pass the package_splits list from the property to aapt2 as --split arguments, sign the extra outputs, install them, and add them as extra output files for SourceFileProducer. Bug: 127921149 Test: TestAppSplits Change-Id: Id94a53ae6a8a68ec81e98abba2fefc9c23feaa7a
2019-03-07Annotate paths and deprecate ExtractSource(s)DepsColin Cross
Add `android:"path"` to all properties that take paths to source files, and remove the calls to ExtractSource(s)Deps, the pathsDepsMutator will add the necessary SourceDepTag dependency. Test: All soong tests Change-Id: I488ba1a5d680aaa50b04fc38acf693e23c6d4d6d
2019-03-05Add modules for converting java modules between host and deviceColin Cross
java_device_for_host and java_host_for_device allow treating a device module as a host module and vice versa. They will be useful for converting layoutlib and robolectric to Soong, as these modules run device java code on the host. Bug: 117920228 Test: device_host_converter_test.go Change-Id: Ia9a371fb41a97bc16338097f3ce8b40099744167
2019-03-04Replace *Escape with *EscapeListColin Cross
Follow the change to blueprint to make *Escape take and return a string and add *EscapeList that take and return slices of strings. Fix up a few places that were unnecessarily converting a string to a slice and back to a string. Test: m nothing Change-Id: I3fa87de175522205f36544ef76aa2f04aef1b936
2019-03-03Don't add static libs resources to implemenation jarsColin Cross
Static dependency resources will already be in the resources jar and the implementation and resource jar, they shouldn't be in the implementation jar. Test: m checkbuild Change-Id: I4d4dab1d2e55e92ba9a95a66b246c721b9bf6410
2019-02-27Add java_* 'services:' fieldAlex Light
Some libraries rely on the java.util.ServiceLoader system to access classes. Allow java_* targets to specify the services that should be exposed there. Test: m jdi-support Bug: 124507633 Change-Id: I253a87033563e3aebc50250fe2252d80d2883815
2019-02-19[SOONG] Not auto-generate test config if test_suite is ctsyangbill
Current soong use source code's under cts as the rule for judgement. Should change to use test_suites define instead. Bug: 124313692 Test: m hello_world_test, make sure test config be auog-enerated. Modified platform_testing/tests/example/native/Android.bp m hello_world_test, make sure test config not be auto-generatetd. Change-Id: I1bc5216f73329d2a82d9ff29ccbede436dd2976c
2019-02-14Remove reference to legacy-test and core-junit from commentsPaul Duffin
The legacy-test and core-junit are no longer used by the runtime, core-junit was removed a long time ago, legacy-test will be removed soon. Bug: 63127064 Test: TH Change-Id: I094e7263afcba76b40361c3a681c9fd7a4314133
2019-02-13Add module type docs to the java packageColin Cross
Add some overview of the java module types so that we have something to display in the autogenerated docs. Bug: 67909957 Test: m soong_docs Change-Id: I3594dd550f8272f4418f3ea12cded4083674809b
2019-02-13Revert "Revert "Never strip and store dex files uncompressed when they are ↵Nicolas Geoffray
preopted on system."" This reverts commit 67e8ec1973700bbdbc4cd68b3493d56d270ca377. Test: build && atest android.text.cts.EmojiTest#testEmojiGlyphWebView on Cuttlefish Exempt-From-Owner-Approval: Got +2 from Colin, latest PS is a rebase across conflicts. Change-Id: I99faf0f2ec698d70c107516bd43756b9ddcb90d0
2019-02-11Make java_sdk_library implement DependencyColin Cross
dexpreopting boot jars is going to need to visit both java_library and java_sdk_library modules. Since java_sdk_library is already a java_library module, move the SdkLibraryDependency methods out of the way so that it will implement Dependency. Also requries re-ording some of the type switches to check for the more-specific SdkLibraryDependency first. Test: TestJavaSdkLibrary Change-Id: I155c9ffaf31689dd150a4d99e07e432ff770b4a7
2019-02-07Make privileged java_library modules use uncompressed dexColin Cross
Check java_library modules against ModulesLoadedByPrivilegedModules to determine whether to uncompress the dex files in them. Test: m checkbuild Change-Id: I77ee456d55bec65c8b4c82e9bd38f344212e6140
2019-02-06Move hiddenapi singleton rules to SoongColin Cross
Move the rules that build hiddenapi-stubs-flags.txt, hiddenapi-flags.csv and hiddenapi-greylist.csv into Soong. Bug: 123645297 Test: m checkbuild Test: m UNSAFE_DISABLE_HIDDEN_API_FLAGS=true Change-Id: I90bf58710f6153ee8565994f799d3ec5699bc7fa
2019-02-06Remove '-b' from AIDLSteven Moreland
An empty file will be emitted for parcel declarations. Now sources may inclue parcel definitions. Bug: 70046217 Test: manual Change-Id: I8087416ae7806399c3514d18faeadb858f07bf88
2019-02-01Remove empty DepsMutator methodsColin Cross
Add an empty DepsMutator to ModuleBase so it doesn't have to be implemented on every module that doesn't need it. Test: all soong tests Change-Id: I545a832a0dbf27386d3080377a75ea482cd9ce59
2019-01-25Make boot classpath jars in apexes uncompressed.Nicolas Geoffray
Save some space on /system by avoiding a copy in the .vdex files. Test: m && /system/framework/boot-*.vdex files doesn't contain dex code. Change-Id: I10cdcfe46a36a49a75f7640e20d065912812ab9f
2019-01-24Remove annotation_processors propertyColin Cross
Now that there are no uses left of annotation_processors remove the property. If there are no annotation processor classes for javac for a module, due to an empty "plugins" property or using kapt for annotation processors, pass -proc:none to javac to ensure it does not try to run any annotation processors found in the classpath. Bug: 77284273 Test: plugin_test.go, kotlin_test.go Change-Id: I3823d9fec8d3d07d2e49b1d97839f7fcbdd35647
2019-01-24Align jar file after calling merge-zips when dex is uncompressed.Nicolas Geoffray
Noticed this while changing a some dex build rules. Test: m Change-Id: I9838e81e0e98be49d34554041a5a942b64259aaa
2019-01-23Fix kotlin annotation processing after java_pluginColin Cross
I37c1e80eba71ae2d6a06199fb102194a51994989 broke kotlin annotation processing with a typo in the processors flag to kapt and by passing -processor to javac with an empty processorpath. Bug: 77284273 Bug: 122251693 Test: kotlin_test.go Test: m checkbuild Change-Id: I17c45d5b3f9df089231af5d2930646ad0e6bf9be
2019-01-23Replace annotation_processors with pluginsColin Cross
Follow bazel's modules for annotation processors by introducing a java_plugin module type that can contain extra metadata about the annotation processor, the processor class and a flag to specify if the annotation processor is compatible with the turbine optimization. Deprecate the annotation_processors property, which took a list of java_library_host modules, in favor of the plugins property, which takes a list of java_plugin modules. The annotation_processors property will be removed once all uses have been replaced with plugins. Bug: 77284273 Test: plugin_test.go Test: m caliper Change-Id: I37c1e80eba71ae2d6a06199fb102194a51994989
2019-01-23jarjar_rules: accept file-groupSteven Moreland
This allows a jarjar rule to be shared among multiple targets in different directories. Bug: 86259915 Test: use filegroup jarjar_rules Change-Id: I3fa476c4e87e2460ab9fabfb34229f471c80e6b0
2019-01-23Always do zipalign with uncompressDex.Nicolas Geoffray
Also preserve the alignment with hiddenapi. Test: conscrypt apex has its conscrypt.jar zipaligned. Change-Id: I43cc0eadb9548c3d8055e12c077fb7bbe1935fe6
2019-01-22Pass annotation processors to kotlincColin Cross
Enable the kotlin-annotation-processing plugin and pass annotation processors to it. Bug: 122251693 Test: m checkbuild Test: TestKapt in kotlin_test.go Change-Id: I841df454beaaa7edd263eea714ca0d958a03c9de
2019-01-22Move kotlin to it's own fileColin Cross
kapt is going to make kotlin a little more complicated, move the rules and tests to their own files. Bug: 122251693 Test: m checkbuild Change-Id: Ieed78b97995ced210b710bd50c357514cc8e3bc6
2019-01-21Don't install java libraries that are already in an apex.Nicolas Geoffray
This need to have -hostdex rules not look at the installFile. In the near future, all -hostdex files come from jars that are in an apex. bug: 119868597 Test: m Change-Id: I4423626c5ced5d098ddd97c122fbfced54f817fc
2019-01-19Maintain uncompressed dex through hiddenapi encodeColin Cross
hiddenapi encode unzips and rezips the dex jar. Pass uncompressDex into it so that it doesn't make classes.dex compressed in the dex jar when it was previously uncompressed. Bug: 123100239 Test: m checkbuild Test: zipinfo $OUT/system/framework/conscrypt.jar shows uncompressed classes.dex Change-Id: If36cde330eb0bcb1e1db3c582452c5faebc8ff29
2019-01-18Restore UNSAFE_DISABLE_HIDDENAPI_FLAGS functionality.David Brazdil
It got broken with the move to hiddenapi to Soong. Test: UNSAFE_DISABLE_HIDDENAPI_FLAGS=true m -j32 Change-Id: Id369bfae8e118907b1f12faa7e4207494904edda
2019-01-17Move hiddenapi to SoongColin Cross
Perform hiddenapi CSV generation and dex encoding for Soong modules in Soong. This fixes an issue where dexpreopting was happening on a different jar than was being installed. Bug: 122856783 Test: m checkbuild Test: no change out/target/common/obj/PACKAGING/hiddenapi-flags.csv Test: only ordering change to out/target/common/obj/PACKAGING/hiddenapi-greylist.csv Test: cts/tests/signature/runSignatureTests.sh Change-Id: I4fc481efc29e73cb2bdaacf672e86d5f6f0075ae
2019-01-17Relax restriction on sharded annotation processorsAshley Rose
Bug: 77284273 Test: m framework Change-Id: If617bcf65b5d04ecb81227a9a8b76bbd78ea8598
2019-01-16Support core librarySundong Ahn
To support core library, "Openjdk9", "No_standard_libs" and metalava properties are added to java_sdk_library. If core_lib is true, dist paths are changed to apistubs/core/.... impl library name is changed to {module_name}.jar instead of {module_name}.impl.jar Bug: 110404779 Test: m -j Change-Id: Ieb6248ea714b4260333d8bf61573d4f3413f7f24 Merged-In: Ieb6248ea714b4260333d8bf61573d4f3413f7f24 (cherry picked from commit af4907fed798aa736d3d20f5439ba87be7ab0f10)
2019-01-11Preopt: Do not strip non-image boot class path jars.Vladimir Marko
Test: Pixel 2 XL boots. Bug: 119868597 Change-Id: I7bd3b7655aecf1a8c26dd8d4d18d3eec685ece88