aboutsummaryrefslogtreecommitdiff
path: root/java/java.go
Commit message (Collapse)AuthorAgeFilesLines
...
* Add more dex_preopt propertiesColin Cross2017-12-061-3/+18
| | | | | | | | | Move dex_preopt to dex_preopt.enabled, and add dex_preopt.app_image, dex_preopt.profile_guided, and dex_preopt.profile. These values will be passed back to Make if provided to control dex preopting. Test: m checkbuild Change-Id: I54a4b1de697a08be20ab65d2a5dc43ce0046692d
* Split java_binary modules into common and binary variantsColin Cross2017-12-061-12/+27
| | | | | | | | | | | | Add a common_first multilib type and use it for java.Binary so that the java part is compiled as a "common" arch type but the wrapper script is installed as a "linux_glibc" arch type. This allows java_binary to be used as a tool dependency for a genrule. Bug: 68397812 Test: TestJavaBinary Change-Id: I809060839ce8878300da3fb76426ceb1ea6b0e8e
* Add java_genrules to use jars as inputs and outputsColin Cross2017-12-061-26/+55
| | | | | | | | | | | Add a java_genrule that has the right multilib flags to be a dependency of a java rule. Make java libraries implement SourceFileProducer so that their classes jar can be used as an input to a java_genrule. Allow libs and static_libs dependencies to be a java_genrule. Test: TestJarGenrules Change-Id: Ib1b31ef9c0b7e72eeed2c9ecc4ce8a1088e0b1c9
* Add system_$(VER)Sundong Ahn2017-12-011-2/+8
| | | | | | | | | | The system_$(VER) is added for vendor, similar to sdk. Bug: 67724799 Test: build Merged-In: I2545c92707591ca278066870c74e9f49e9825855 Change-Id: I2545c92707591ca278066870c74e9f49e9825855 (cherry picked from commit b8baff1fa353a311c3dd918dfa29ec45dd0168be)
* Allow building framework.jar and framework-res.apkColin Cross2017-11-291-1/+11
| | | | | | | | | | Update app support enough to build framework-res.apk, link framework.jar against its generated files, and export it to make. Bug: 69917341 Test: m checkbuild tests docs Change-Id: I7db29cd1f5fabb22e844483ecc7c38abfedbbe0a
* Replace ModuleContext.AConfig() with Config()Colin Cross2017-11-301-16/+16
| | | | | | | | | AConfig() now duplicates Config(). Replace the uses of AConfig() with Config(). Leave AConfig() for now until code in other projects is cleaned up. Test: m checkbuild Change-Id: Ic88be643049d21dba45dbd1a65588ed94bf43bdc
* Replace aapt support with aapt2Colin Cross2017-11-291-7/+3
| | | | | | | | | Use aapt2 instead of aapt to compile Android app resources. Also generate all files into srcjars instead of individual sources. Test: m checkbuild Change-Id: I5a67991a0daf0017e8159b46fcff7d5564a91468
* Add Jacoco supportColin Cross2017-11-221-34/+86
| | | | | | | | | | | | | Add support for instrumenting jars with jacoco. Unlike in Make, Jacoco in Soong is done entirely using jars. Instrumentation is enabled by EMMA_INSTRUMENT=true, and affects all apps. If EMMA_INSTRUMENT_FRAMEWORK=true then it also affects any java libraries listed in InstrumentFrameworkModules. Bug: 69629238 Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true WITH_DEXPREOPT=false Change-Id: If699715b277529cd7322ffca67c23b0746e1cccd
* Add support for .srcjar files from genrules and srcsColin Cross2017-11-171-2/+3
| | | | | | | | | Allow srcs to contain .srcjar files, which will be extracted just before javac. Also allow genrules and generated sources to directly return .srcjar files. Test: m checkbuild Change-Id: Ie4cf60ecb9d2ec63a4c2275221544203b1383597
* Fix java AIDL properties to match C/C++Colin Cross2017-11-171-8/+17
| | | | | | | | | | | | | | | | | | The C/C++ aidl properties use: aidl: { local_include_dirs: [], include_dirs: [], } But the Android.bp file was expecting: aidl_include_dirs: [], export_aidl_include_dirs: [], Update java AIDL support to match the C support, which is also what the androidmk conversion tool is creating. Test: m checkbuild Change-Id: I3df763d0b203b1b6556798a21b0553e7d35ad7d5
* Change bool, and string properties to *bool, and *string for java,Nan Zhang2017-11-081-11/+14
| | | | | | | | python, and genrule. Test: m -j checkbuild Bug: b/68853585 Change-Id: Ic9a8083818e920dc399a4b00841e2aa496f70faa
* Support Javac sharding in Soong.Nan Zhang2017-11-061-6/+48
| | | | | | Test: m clean && m -j java and java_test.go Change-Id: I110a0ff029448d3319aed2788d25d90a6c1a7fa0
* Add default jar wrapper when wrapper property is not specifiedNan Zhang2017-11-031-2/+6
| | | | | | Bug: b/68779881 Test: manually copied the jar-wrapper.sh to out/soong/host/linux-x86/framework Change-Id: Idee1e7e64c6e3c89c89a8cd9c107a38533356b6c
* Propagate PRODUCT_MINIMIZE_JAVA_DEBUG_INFO to soong and use itColin Cross2017-11-011-0/+5
| | | | | | | | Strip debug info in javac when PRODUCT_MINIMIZE_JAVA_DEBUG_INFO is set. Test: m with PRODUCT_MINIMIZE_JAVA_DEBUG_INFO=true Change-Id: I167e742662801291c516bf1ff826486560d22147
* Allow java_host_binary to be used with genrule.Alex Light2017-10-271-0/+4
| | | | | | | | | | | | | | | | | | This is done by implementing the HostToolPath interface for java Binary objects. Currently, in order for a java_binary_host to be used in this way the java_host_binary must include: compile_multilib: "first" Otherwise the genrule is unable to find the correct variant. Test: ./build_test.bash Test: Manual Bug: 68397812 Change-Id: I6849488dc13fa8c383df69d00f62ad815ec17876
* Fix source jarsColin Cross2017-10-261-4/+4
| | | | | | | | | | | Source jars were not working as designed because javac will only compile files from the -sourcepath if there are references to them starting from files on the command line. Switch to extracting the source jars into a directory and passing a list of the files to javac. Test: m checkbuild Change-Id: I9f7d824f8538d081b2f5ad64ae3cbfd0e96213af
* Don't panic in turbine with no classesColin Cross2017-10-241-9/+5
| | | | | | | | | | | | | ALLOW_MISSING_DEPENDENCIES=true can cause missing dependencies to be hidden from GenerateAndroidBuildActions, which is triggering the len(jars) == 0 check in compileJavaHeader. For the ALLOW_MISSING_DEPENDENCIES=true case the check is unnecessary, as the build rules will be replaced with runtime errors. On the off chance the check would have been hit in a real build, allow merge_zips to create an empty zip file if it is asked to. Test: m ALLOW_MISSING_DEPENDENCIES=true Change-Id: I3171f921d51229ddf38a1a647d32566658c673fa
* Convert Visit*Deps from blueprint.Module to android.ModuleColin Cross2017-10-241-16/+1
| | | | | | | | Also adds checks that the dependencies are android.Modules and are not disabled. Test: m checkbuild Change-Id: I05e945f38915d49cd3c0ab72a86576949bc7eff2
* Fail when a module depends on a disabled moduleColin Cross2017-10-231-0/+15
| | | | | | | | | | Copy the logic from cc.go to fail when a module depends on a disabled module. A future change will refactor this to remove the duplication and cover all other module types. Test: m TARGET_BUILD_PDK=true doesn't panic Bug: 67663308 Change-Id: Iab2b142cebdbd74df934e4733f0de83bd3334d86
* Fix finding src directory for aidlColin Cross2017-10-211-1/+1
| | | | | | | | aidlFlags was always looking for a src directory at the top level instead of in the module's source directory. Test: m checkbuild Change-Id: Ie31baa21c8632c2bd9a6ebc42e6291417b1f31cd
* Support installable prebuilt jarsColin Cross2017-10-201-0/+2
| | | | | | | Some host modules need to be installed. Add an installable property. Test: m checkbuild Change-Id: Ifd023213ff66e81aa77ba1741c75837a1dd88d1d
* Use prebuilts/sdk/*current until Soong can generate stubsColin Cross2017-10-201-13/+18
| | | | | | | | The android_*stubs_current modules don't yet exist, so fall back to the prebuilt jars for now. Test: m checkbuild Change-Id: Iabd32b30954b3f4a6d9a779fde52a032b684807e
* Add sdk_version property to imported jarsColin Cross2017-10-201-0/+2
| | | | | Test: m checkbuild Change-Id: I83dd6ad157c7a5918747ce8c9be05c1e1e22d710
* Support Turbine in Soong.Nan Zhang2017-10-201-83/+181
| | | | | | | | | | | If sdk jars(android_stubs_current, etc) are compiled using soong java modules, we have to filter them when running Java build with Turbine. TODO: provide more unit-tests. Test: m clean && m -j32; go test java_test Change-Id: Iad7c241b0e8b0ca760950733f513124b56c84564
* Add property to prevent dex preoptingColin Cross2017-10-191-0/+4
| | | | | | | | Add dex_preopt property and pass it through to make as LOCAL_DEX_PREOPT. Test: m checkbuild Change-Id: I6f19d097d1769068b7e4093f011574c540c137f3
* Move all jar intermediates to subdirsColin Cross2017-10-191-11/+13
| | | | | | | | | Make all the jar intermediates called modulename.jar, and put each in a subdir for the tool that generated it. This will simplify using the jars as inputs to genrules and resources. Test: java_test.go Change-Id: If00e16bd7df5a4ba24ebc4b68c9ccf2cfda49544
* Allow jarjar_rules to be arch-specificColin Cross2017-10-171-1/+1
| | | | | | | | Modules may need to use jarjar on the device to move classes into the android namespace, but not on the host. Test: m checkbuild Change-Id: I910ebbe20e45e98edecca0d7c4fb18e806bc3c6c
* Initial kotlin supportColin Cross2017-10-171-3/+39
| | | | | | | | | Allow java libraries to specify .kt sources, precompile them with kotlin, and then pass them in the classpath to javac. Bug: 65219535 Test: java_test.go Change-Id: Ife22b6ef82ced9ec26a9e5392b2dadacbb16546f
* Use jars containg sources for java generatorsColin Cross2017-10-161-11/+10
| | | | | | | | | | | | | | | | | srcFileLists was an ill-fated attempt to deal with generators that produce a set of java sources that is not known ahead of time. For example, the list of files produced by protoc depends on the package statement in the .proto file. srcFileLists put the list of generated files into a file, which was then passed to javac using the @file syntax. This worked, but it was too easy to cause missing dependencies, and will not work well in a future distributed build environment. Switch to putting generated sources into a jar, and then pass them jar to javac using -sourcepath. Test: m checkbuild Change-Id: Iaab7a588a6c1239f7bf46e4f1b102b3ef517619b
* Pass output file names into java.Transform* functionsColin Cross2017-10-161-8/+28
| | | | | | | | | | | | Pass the output file name into the java.Transform* functions. This consistently puts control of the filename into java.go, which is often necessary to avoid collisions when the same rule is used multiple times in a single module. It also has the side-effect of removing the poorly named "stem" parameters. Test: java_test.go Change-Id: I7bc1d1f3bfae6f9d2c92870e6df381817817aab4
* Initial support for converting jars to java9 system modulesColin Cross2017-10-161-16/+72
| | | | | | | | | | | | | | | Adds a java_system_modules module type that (when EXPERIMENTAL_USE_OPENJDK9 is set to true) converts a list of java library modules and prebuilt jars into system modules, and plumbs the system modules through to the javac command line. Also exports the location of the system modules to make variables, as well as the name of the default system module. Test: TestClasspath in java_test.go, runs automatically as part of the build Bug: 63986449 Change-Id: I27bd5d2010092422a27b69c91568e49010e02f40
* Add hostdex supportColin Cross2017-10-101-10/+3
| | | | | | | | | | If hostdex: true is specified for a java library, create an extra Make module that copies the dex jar to a module with a -hostdex suffix in the host output directory. Bug: 67600882 Test: m -j checkbuild Change-Id: I859dfaabeefdca714b566de94e00f74e03c85939
* Fix doubled generated source filesColin Cross2017-10-091-7/+0
| | | | | | | | | Generated source files were being included twice, once manually and once by ctx.ExpandSources. Remove the manual one. Bug: 67364649 Test: TestGeneratedSources in later patch Change-Id: Ia6760b01a34a96767a914bdcb911a39fa6683300
* Honor resource exclusions in java_resources propertiesColin Cross2017-10-041-1/+1
| | | | | | | | Honor the default resource exclusions in java_resources properties including *.java. Test: m -j checkbuild Change-Id: Ia117a000680161b54c189758926ddb2068a2a2c3
* Get dex jar resources from classpath jarColin Cross2017-10-041-27/+2
| | | | | | | | | | | | | Dex jars were getting their resources from the res.jar files of their transitive static dependencies. This accidentally bypassed jarjar on resources, since the jarjar pass only happened once the resources jar was combined into the classpath jar. Switch to getting the resources out of the classpath jar by merging it with the dex jar while skipping *.class. Test: m -j checkbuild Test: compare ext.jar to one generated by make Change-Id: I5f6f3da738dcb0af56ab9a1bd7174ed5359de2b2
* Allow libraries with no sources to be installedColin Cross2017-10-041-1/+1
| | | | | | | | Libraries with no source files but static lib dependencies should still be installable. Test: m -j checkbuild Change-Id: Ibc91aa3153241092ce86888dbf90e99b66069ff2
* Fix bootclasspath for host variants of java_library modulesColin Cross2017-10-041-3/+1
| | | | | | | | | | | The partial hostdex support was causing the host variant of java_library modules to depend on core-oj and core-libart, which caused the tagsoup jar to use the wrong java.lang.System.arraycopy signature. Remove the hostdex code that was causing the problem, and add a test. Test: java_test.go Change-Id: I4f7b1f29c99aae328ba19b042538d9d35544aa43
* Add support for .proto files in java modulesColin Cross2017-10-031-7/+38
| | | | | Test: m -j checkbuild Change-Id: Ia03429948baebff85164a91a34507866c97a08ef
* Relax SDK checks for unbundled buildsColin Cross2017-10-021-5/+18
| | | | | | | | | Unbundled builds might not have the prebuilt/sdk files, allow the build to continue and then fail if the module is actually built. Test: m -j checkbuild Change-Id: I21163778f1cc50945c7a12e57da0e39ba963aa7c
* Make java_library_static uninstallable by defaultColin Cross2017-10-021-10/+15
| | | | | | | | Static libraries are not dexed and are not installable on a device. Test: m -j checkbuild Change-Id: Iea01df381e6c8cf2439fdb87200895db6aac99e2
* Add no_framework_libs propertyColin Cross2017-10-011-2/+8
| | | | | | | | | | | Add a no_framework_libs property similar to no_standard_libs. The new property will allow modules to continue to link against the standard bootclasspath libraries that contain java.*, but not against the framework libraries. This avoids having to specify the bootclasspath libraries explicitly. Test: m -j checkbuild Change-Id: I0be13a45cadca9b90a0fd1797885cd18c5b462e3
* Allow modules with empty sdk_version in unbundled buildsColin Cross2017-09-301-7/+1
| | | | | | | | The apps build depends modules that have empty sdk_version. Let the behavior match make for now. Test: m -j TARGET_BUILD_APPS=Gallery2 Change-Id: Ie5545d2cd6b1268b0b3392dc0af2e4eb3d38a588
* Add java file resources and flag to include sourcesColin Cross2017-09-291-1/+27
| | | | | | | | | Add a properties to allow including files as resources, including support for filegroups. Also add a flag that causes module sources to be included in the final jar. Test: java_test.go TestResources Change-Id: Ida8ee59b28df9fe66952170f46470d3a09fd5d65
* Use pre-desugar classes in classpathColin Cross2017-09-291-6/+2
| | | | | | | | Follow the make change in I87aee34940937dbde33a977f55d1faf2c8054561 to use classes before desugar in the classpath. Test: java_test.go Change-Id: I1054f4aea1eb349b6f687e1af0adb92a944fd8c5
* Only desugar/dx installable librariesColin Cross2017-09-291-2/+6
| | | | | | | | Don't waste time running dx on libraries that will never end up on the device. Test: m -j checkbuild Change-Id: Iad1750823d3261cd6ad6eb6aa00c74d45b9737a3
* Remove jarSpec structureColin Cross2017-09-291-3/+4
| | | | | | | | It's not doing anything anymore, and the next patch will need more complex jar arguments. Just remove it. Test: m -j checkbuild Change-Id: I96d15995e86263ec04fd5c13ab0fd54d8b85c788
* Move errorprone dependency to compiled classes jarColin Cross2017-09-291-13/+9
| | | | | | | | The resources jar and the combined jar are not always used, so add the errorprone dependency to the compiled jar. Test: m -j checkbuild Change-Id: Iaa10a04347758c676bb704969b86f9442e6c3175
* Rename resource_dirs to java_resource_dirsColin Cross2017-09-271-4/+4
| | | | | | | | For consistency with make, rename java resources to java_resource_dirs and android resources to resource_dirs. Test: m -j checkbuild Change-Id: Ie9aac50fef40f6a9093b4b98759e79cd086bb797
* Remove duplication of bootclasspath in DefaultLibrariesColin Cross2017-09-231-2/+2
| | | | | | | Don't add bootclasspath libraries as classpath dependencies too. Test: m -j checkbuild Change-Id: Icb45e45536ce3babab73f67d281ca593edd4ab7f
* Don't generate dex jars for host modulesColin Cross2017-09-201-1/+2
| | | | | | | | Hostdex support isn't working yet, and we are accidentally producing a dex jar for host modules, which confuses soong_java_prebuilt.mk. Test: m -j checkbuild Change-Id: Ie2c331fa697f49dab23c380a5c6e0490d67c9f74