aboutsummaryrefslogtreecommitdiff
path: root/java/java.go
Commit message (Collapse)AuthorAgeFilesLines
...
* Add java_test_helper_libraryPaul Duffin2019-03-251-0/+32
| | | | | | | | Extracts testSuiteComponent() function to reduce duplication. Bug: 128969758 Test: atest CtsJdwpTestCases Change-Id: I23746b18112d22f8670666f429a665b34b1955fd
* Rename jetifier property and add it to androidmkColin Cross2019-03-221-2/+2
| | | | | | | | | | 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
* Add override_android_app module type.Jaewoong Jung2019-03-211-0/+1
| | | | | | | | | | | 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
* Replace ctx.ExpandSources with android.PathsForModuleSrcColin Cross2019-03-201-7/+7
| | | | | | | | | | | 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
* Add dex_import module typeColin Cross2019-03-201-3/+112
| | | | | | | | | | | | | 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
* Support package_splitsColin Cross2019-03-191-2/+3
| | | | | | | | | | 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
* Annotate paths and deprecate ExtractSource(s)DepsColin Cross2019-03-071-31/+14
| | | | | | | | | 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
* Add modules for converting java modules between host and deviceColin Cross2019-03-051-0/+2
| | | | | | | | | | | 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
* Replace *Escape with *EscapeListColin Cross2019-03-041-1/+1
| | | | | | | | | | 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
* Don't add static libs resources to implemenation jarsColin Cross2019-03-031-1/+0
| | | | | | | | | 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
* Add java_* 'services:' fieldAlex Light2019-02-271-0/+23
| | | | | | | | | | | 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
* [SOONG] Not auto-generate test config if test_suite is ctsyangbill2019-02-191-1/+1
| | | | | | | | | | | | 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
* Remove reference to legacy-test and core-junit from commentsPaul Duffin2019-02-141-4/+3
| | | | | | | | | | 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
* Add module type docs to the java packageColin Cross2019-02-131-1/+89
| | | | | | | | | 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
* Revert "Revert "Never strip and store dex files uncompressed when they are ↵Nicolas Geoffray2019-02-131-7/+10
| | | | | | | | | | | 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
* Make java_sdk_library implement DependencyColin Cross2019-02-111-11/+11
| | | | | | | | | | | | 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
* Make privileged java_library modules use uncompressed dexColin Cross2019-02-071-0/+5
| | | | | | | | Check java_library modules against ModulesLoadedByPrivilegedModules to determine whether to uncompress the dex files in them. Test: m checkbuild Change-Id: I77ee456d55bec65c8b4c82e9bd38f344212e6140
* Move hiddenapi singleton rules to SoongColin Cross2019-02-061-12/+12
| | | | | | | | | | 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
* Remove '-b' from AIDLSteven Moreland2019-02-061-1/+1
| | | | | | | | | | An empty file will be emitted for parcel declarations. Now sources may inclue parcel definitions. Bug: 70046217 Test: manual Change-Id: I8087416ae7806399c3514d18faeadb858f07bf88
* Remove empty DepsMutator methodsColin Cross2019-02-011-3/+0
| | | | | | | | 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
* Make boot classpath jars in apexes uncompressed.Nicolas Geoffray2019-01-251-3/+3
| | | | | | | 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
* Remove annotation_processors propertyColin Cross2019-01-241-10/+1
| | | | | | | | | | | | | | 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
* Align jar file after calling merge-zips when dex is uncompressed.Nicolas Geoffray2019-01-241-1/+7
| | | | | | | Noticed this while changing a some dex build rules. Test: m Change-Id: I9838e81e0e98be49d34554041a5a942b64259aaa
* Fix kotlin annotation processing after java_pluginColin Cross2019-01-231-1/+2
| | | | | | | | | | | | 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
* Replace annotation_processors with pluginsColin Cross2019-01-231-4/+24
| | | | | | | | | | | | | | | | | 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
* jarjar_rules: accept file-groupSteven Moreland2019-01-231-9/+15
| | | | | | | | | This allows a jarjar rule to be shared among multiple targets in different directories. Bug: 86259915 Test: use filegroup jarjar_rules Change-Id: I3fa476c4e87e2460ab9fabfb34229f471c80e6b0
* Always do zipalign with uncompressDex.Nicolas Geoffray2019-01-231-6/+0
| | | | | | | Also preserve the alignment with hiddenapi. Test: conscrypt apex has its conscrypt.jar zipaligned. Change-Id: I43cc0eadb9548c3d8055e12c077fb7bbe1935fe6
* Pass annotation processors to kotlincColin Cross2019-01-221-4/+21
| | | | | | | | | | 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
* Move kotlin to it's own fileColin Cross2019-01-221-1/+1
| | | | | | | | | 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
* Don't install java libraries that are already in an apex.Nicolas Geoffray2019-01-211-1/+1
| | | | | | | | | 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
* Maintain uncompressed dex through hiddenapi encodeColin Cross2019-01-191-1/+1
| | | | | | | | | | | 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
* Restore UNSAFE_DISABLE_HIDDENAPI_FLAGS functionality.David Brazdil2019-01-181-9/+11
| | | | | | | It got broken with the move to hiddenapi to Soong. Test: UNSAFE_DISABLE_HIDDENAPI_FLAGS=true m -j32 Change-Id: Id369bfae8e118907b1f12faa7e4207494904edda
* Move hiddenapi to SoongColin Cross2019-01-171-0/+14
| | | | | | | | | | | | | 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
* Relax restriction on sharded annotation processorsAshley Rose2019-01-171-6/+5
| | | | | | Bug: 77284273 Test: m framework Change-Id: If617bcf65b5d04ecb81227a9a8b76bbd78ea8598
* Support core librarySundong Ahn2019-01-161-4/+5
| | | | | | | | | | | | | | | 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)
* Preopt: Do not strip non-image boot class path jars.Vladimir Marko2019-01-111-0/+6
| | | | | | Test: Pixel 2 XL boots. Bug: 119868597 Change-Id: I7bd3b7655aecf1a8c26dd8d4d18d3eec685ece88
* Use latest SDK version for current in PDK buildsColin Cross2019-01-101-1/+12
| | | | | | | | | PDK builds need to use the latest SDK version instead of "current" to match the behavior of Make. Bug: 118634643 Test: sdk_test.go Change-Id: Ice10d0ccb4066f27ce5839fc96a4026510057121
* Split out sdk.go from java.goColin Cross2019-01-101-148/+0
| | | | | | | | Split out SDK handling functions from java.go to sdk.go and tests from java_test.go to sdk.go. Test: sdk_test.go Change-Id: I83ef48cbe5230572c1d4ecc0e89021d2f7c71b76
* Remove duplicated shouldUncompressDex logicColin Cross2019-01-091-0/+6
| | | | | | | | | | | shouldUncompressDex has already been computed and stored in deviceProperties.UncompressDex, pass it to dexpreopter instead of recomputing it. Also add a stub for java libraries to set UncompressDex. Test: no change to build.ninja Change-Id: I663d9fbbe768a8dc9a97c7d456dd7a010f43162d
* Don't dexpreopt when compile_dex but not installableColin Cross2019-01-061-0/+1
| | | | | | | | | | Modules shouldn't be dexpreopted and possibly stripped when compile_dex is set but installable is not set. This matches the previous behavior when the dexpreopt rules were in Make. Bug: 121317615 Test: dexpreopt_test.go Change-Id: I6f80b7b37a990c475b91aa5d98a19a3baa85eb1b
* Don't dexpreopt or strip java_test modulesColin Cross2019-01-061-0/+1
| | | | | | | | I6bb2c971cee65d2338839753aa0d84939f335b1b accidentally caused java_test modules to be dexpreopted and possibly stripped. Test: dexpreopt_test.go Change-Id: Ida8f046c509c97e38bd3bce66944d32f01530db4
* Add buildDir to java patch-module paths.Jaewoong Jung2019-01-041-2/+9
| | | | | | | | | This solves a problem where javac fails to find patch-module targets when a build diretory is not under the project root. Bug: 117770838 Test: java_test.go + manual build Change-Id: If70d0d388a3f6c87b3f78a927df2063616d50c8a
* In java.go, add implement check for both Dependency and IDE relevant interfacesalbaltai2018-12-251-1/+19
| | | | | | | | | | | | | | | | | 1. Add var _ to declare the struct Import implement IDEInfo and IDECustomizedModuleName interfaces 2. Modify var _, a typo case for struct Module implement Dependency interface 3. Add nil checking for Dependency interface implementation 4. Add more comment for developer Bug: 121985695 Test: 1. m aidegen 2. $ANDROID_HOST_OUT/bin/aidegen framework 3. check import static android.Manifest.permission.BIND_VOICE_INTERACTION; denpendency should be resolved in frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java Change-Id: Ia2d2d65b83a52d35ccb3927a36bcf686d5223e20
* In java/java.go, enhance the checking logic for Dependency interface ↵shinwang2018-12-251-0/+6
| | | | | | | | | | | | | | | implementation Add nil checking for Dependency interface implementation Bug: 121985695 Test: 1. m aidegen 2. $ANDROID_HOST_OUT/bin/aidegen framework 3. check import static android.Manifest.permission.BIND_VOICE_INTERACTION; denpendency should be resolved in frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java Change-Id: Ibac280ce3de2537f453c4ca7e8f79f55667f1fa0
* Add a flag to allow unbundled builds to build SDKs from sourceColin Cross2018-12-181-1/+1
| | | | | | | | | | | | | | | | Mainline modules are tightly coupled to the platform, and should build against the current SDK from source and not prebuilts. Add a flag UNBUNDLED_BUILD_SDKS_FROM_SOURCE to specify that a TARGET_BUILD_APPS build should build the current SDK instead of using the prebuilts. Bug: 121194841 Bug: 121231426 Test: no change to out/build-aosp_sailfish.ninja Test: forrest unbundled build Test: forrest master apps build Test: forrest mainline modules build Change-Id: I45a40a335483dae2fe192721df9b31bdbab97ee5
* Dexpreopt soong modules inside soongColin Cross2018-12-151-19/+26
| | | | | | | | | | | | | | | | | | | | | | | Port the dexpreopt logic from Make to the dexpreopt package in Soong, and use it to dexpreopt Soong modules. The same package is also compiled into the dexpreopt_gen binary to generate dexpreopt scripts for Make modules. This relands Ib67e2febf9ed921f06e8a86b9ec945c80dff35eb and I462182638bd57b1367b5bfb0718e975c11ae66f7, along with multiple fixes to depsfile generation in dexpreopt_gen that caused .odex files for modules in defined make to be missing dependencies on boot.art, and a fix to not dexpreopt and strip tests. Bug: 119412419 Bug: 120273280 Test: no differences to dexpreopt outputs on aosp_sailfish system/, only expected changes to dexpreopt outputs on system_other (.vdex files for privileged Soong modules no longer incorrectly contain .dex contents). Test: OUT_DIR=$PWD/out m Test: NINJA_ARGS="-t deps out/target/product/sailfish/obj/APPS/Contacts_intermediates/dexpreopt.zip" m Change-Id: I6bb2c971cee65d2338839753aa0d84939f335b1b
* Revert "Dexpreopt soong modules inside soong"Colin Cross2018-12-141-26/+19
| | | | | | | This reverts commit 29ff88741e710b05743dcf347484c31311e81cda. Test: none Bug: 119412419
* Dexpreopt soong modules inside soongColin Cross2018-12-131-19/+26
| | | | | | | | | | | | | | | Port the dexpreopt logic from Make to the dexpreopt package in Soong, and use it to dexpreopt Soong modules. The same package is also compiled into the dexpreopt_gen binary to generate dexpreopt scripts for Make modules. Bug: 119412419 Bug: 120273280 Test: no differences to dexpreopt outputs on aosp_sailfish system/, only expected changes to dexpreopt outputs on system_other (.vdex files for privileged Soong modules no longer incorrectly contain .dex contents). Change-Id: Ib67e2febf9ed921f06e8a86b9ec945c80dff35eb
* Enable kotlinc flags in blueprint filesZoran Jovanovic2018-11-141-3/+39
| | | | | | | | | | | | | | | Add support for adding kotlinc files in the module. Some flags are unnecessary as they are added by default (-no-jdk and -no-stdlib), or are not needed on an Android build (-include-runtime), or may conflict with the build (-kotlin-home and -Xintellij-plugin-root), so the error stops the build if they are added. Test: part of java/java_test.go Change-Id: If3b2777062daaa490a20c014e9b1bb4b1cb0a8df Signed-off-by: Zoran Jovanovic <zoran.jovanovic@sony.com>
* APEX can be flattenedJiyong Park2018-11-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | When TARGET_FLATTEN_APEX is set to true, APEXes are flattened, which means files in an APEX is not packaged into the mini file system image, but instead directly copied to the system partition. This option is for devices where kernel does not support loopback devices or the maximum number of loopback devices is too small (though the threshold is TBD as of now). This CL also fixes a bug that jars having bytecode are installed instead of those having dex. Bug: 118485880 Test: TARGET_FLATTEN_APEX=true m apex.test; tree out/target/product/.../system/apex/apex.test shows list of files in it. Test; m apex.test, then a file out/target/product/.../system/apex/apex .test.apex exists. Change-Id: I5a3d62d392d05f2779c4925388afe4f6e460059b