summaryrefslogtreecommitdiff
path: root/java/java.go
AgeCommit message (Collapse)Author
2017-10-04Fix bootclasspath for host variants of java_library modulesColin Cross
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
2017-10-03Add support for .proto files in java modulesColin Cross
Test: m -j checkbuild Change-Id: Ia03429948baebff85164a91a34507866c97a08ef
2017-10-02Relax SDK checks for unbundled buildsColin Cross
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
2017-10-02Make java_library_static uninstallable by defaultColin Cross
Static libraries are not dexed and are not installable on a device. Test: m -j checkbuild Change-Id: Iea01df381e6c8cf2439fdb87200895db6aac99e2
2017-10-01Add no_framework_libs propertyColin Cross
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
2017-09-30Allow modules with empty sdk_version in unbundled buildsColin Cross
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
2017-09-29Add java file resources and flag to include sourcesColin Cross
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
2017-09-29Use pre-desugar classes in classpathColin Cross
Follow the make change in I87aee34940937dbde33a977f55d1faf2c8054561 to use classes before desugar in the classpath. Test: java_test.go Change-Id: I1054f4aea1eb349b6f687e1af0adb92a944fd8c5
2017-09-29Only desugar/dx installable librariesColin Cross
Don't waste time running dx on libraries that will never end up on the device. Test: m -j checkbuild Change-Id: Iad1750823d3261cd6ad6eb6aa00c74d45b9737a3
2017-09-29Remove jarSpec structureColin Cross
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
2017-09-29Move errorprone dependency to compiled classes jarColin Cross
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
2017-09-27Rename resource_dirs to java_resource_dirsColin Cross
For consistency with make, rename java resources to java_resource_dirs and android resources to resource_dirs. Test: m -j checkbuild Change-Id: Ie9aac50fef40f6a9093b4b98759e79cd086bb797
2017-09-23Remove duplication of bootclasspath in DefaultLibrariesColin Cross
Don't add bootclasspath libraries as classpath dependencies too. Test: m -j checkbuild Change-Id: Icb45e45536ce3babab73f67d281ca593edd4ab7f
2017-09-20Don't generate dex jars for host modulesColin Cross
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
2017-09-20Remove android_prebuilt_sdk modulesColin Cross
Forcing sdk modules to be declared explicitly is unnecessary, just add the required dependencies on the jar and aidl files. Test: java_test.go Change-Id: Ib28bdc1051c5825e7c0efb6adff1f9282675560e
2017-09-20Fix java sdk testsColin Cross
Fix the java module sdk tests, and expand them to cover testing all classpaths including for the host. Test: java_test.go Change-Id: I71be13cc5545f5c4d5b377c4c8de3dccbb09abf9
2017-09-20Initial device java supportColin Cross
First pass at java support for the device. Adds desugar before dx, and passes javalib.jar to make. Test: m -j checkbuild Change-Id: I3138d943bc4867a52c3fce8fbdb597773793988d
2017-09-20Rearrange manifest file handling in merge_zips and soong_zipColin Cross
Jar always puts default MANIFEST.MF files in if none was specified. Copying that behavior in soong_zip causes problems with merge_zips, because it ends up taking the default manifest from the classes.jar instead of the user's manifest from res.jar. We don't want the user's manifest in the classes.jar, otherwise a change to the manifest will cause all the class files to rebuild. Instead, move the manifest insertion to the final merge_zips stage. Test: m -j checkbuild Change-Id: Id6376961dbaf743c2fb92843f9bdf2e44b963be0
2017-09-14Use dependency tags for genrulesDan Willemsen
So that we don't get confused when using :<module> in srcs to depend on a module that could also be a HostBinTool. Test: m -j Change-Id: Ia3b1c26826e70f84c6dc5ff78c95dd11d76901b6
2017-09-11Strip javac 9 module argumentsColin Cross
Strip module-related javac 9 command line arguments that don't apply to javac 8. Test: m -j checkbuild Change-Id: If44a3d9d7227e923117dc75bbabbddb41026b25d
2017-09-06Add support for java annotation processorsColin Cross
Add annotation_processor and annotation_processor_classes properties. Test: m -j checkbuild Change-Id: I41a6cd42f0c048070a99cb18af150030170498f7
2017-09-05Make javac rules output a jar with soong_zipColin Cross
Make javac rules output a jar file instead of a classes.list. Combine the output jar, static jar dependencies, and resources into the final jar using a separate rule. For now, use a shell command with unzip and soong_zip to create the final jar, eventually it will be done with a zip2zip-style jar combiner. Bug: 64691570 Test: java_test.go Change-Id: Id8e6313e0097b78947d88e86e47b56ad08caca1a
2017-09-05Support non-installable java librariesColin Cross
Some java libraries will never be installed, support an installable: false property and export it back to make as LOCAL_UNINSTALLABLE_MODULE := true. Test: m -j checkbuild, manually inspect out/soong/Android*.mk Change-Id: I825ec897648c82fb7323da7df3539c9aaa6bcfce
2017-08-31Allow java modules to use filegroupsColin Cross
Using filegroups requires calling ExtractSourcesDeps from the deps mutator. Test: m -j checkbuild Change-Id: I7b6c6ce0075e4a703d28085a3965f11d9bb46315
2017-08-31Rename no_standard_libraries to no_standard_libsColin Cross
For consistency with libs and static_libs. And make it a *bool so that it can be overriden when used in java_defaults modules. Test: java_test.go Change-Id: If0eaf5d5571dc6e565056d273b0addd960d6b33f
2017-08-31Add core-oj to bootclasspathColin Cross
Also clear the bootclasspath for device builds so javac doesn't fall back to the default rt.jar bootclasspath. Test: java_test.go Change-Id: Ia21f55c7d45db560e2f44be81b2f46587d9026f2
2017-08-31Pass --min-sdk-version to dxColin Cross
Pass the sdk_version property, the platform sdk version, or 10000 to dx as --min-sdk-version. Test: m -j checkbuild Change-Id: I5fae03f44153dc2d6244c33f4c055e746980aefe
2017-08-31Make binaries executableColin Cross
Split InstallFileName into InstallExecutable that does chmod +x after copying the file. Also remove InstallFile and rename InstallFileName to InstallFile. Test: m -j checkbuild Change-Id: Id41ad4eafe521f6cd5d8cc250b7747ecb3da8dfc
2017-08-28Add error-prone supportColin Cross
Add support for compiling java sources with the error-prone tool. Test: m -j checkbuild Change-Id: Ieb4ee0e05f8f34a52ed7bcf1c7cbacf1c9c4d0b5
2017-08-11Install java_binary wrappers in makeColin Cross
Convert java_binary modules into two make modules, one for the underlying java_library and one for the wrapper prebuilt. Test: m -j checkbuild Change-Id: I5ddf74f24f1e41fc1f39b3e8d254b7e191dbd47a
2017-08-11Bring java support closer to current version of makeColin Cross
Make the javac arguments match what is used by make, and export them back to make. A future change will switch make to use the the exported ones. This makes a dx.jar compiled with soong have identical class files as one compiled with make. Test: manual Change-Id: Ia5196f1f42bc564e99de22e32e72fd2930e9fbae
2017-08-11Rename java_prebuilt_library to java_importColin Cross
And make it work like bazel's java_import, using a "jars" property instead of "srcs", and allowing multiple jars to be listed. Test: soong tests Change-Id: Ida2ace6412bd77b4feb423646000a1401004e0ea
2017-07-31Fix java prebuiltsColin Cross
The java prebuilt tests weren't registering the prebuilts mutators, which hid an issue where prebuilts modules weren't getting renamed to avoid collisions with source modules of the same name, which ended up causing the prebuilt module to try to add a dependency on itself. Test: java_test.go Change-Id: I3327d27533591cb08a4b8b8b5e1668a6f72be8df
2017-07-20Rename names in java package to not have java prefixColin Cross
Prefixing names in the java package with "java" is redundant, inside the java package it is clear that they refer to something java related, and outside the package they will be referred to with a java. prefix. Test: java_test.go Change-Id: I9eb8eecb7ac5f6fbf8e87f5c219b3f50dbd18c87
2017-07-20Add support for java_defaults modulesColin Cross
Test: java_test.go Change-Id: I6dba1671c7eb019183af94bb7b10810296740101
2017-07-19Rename java module and property names for consistencyColin Cross
prebuilt_java_library -> java_prebuilt_library prebuilt_sdk -> android_prebuilt_sdk java_resource_dirs -> resource_dirs exclude_java_resource_dirs -> exclude_resource_dirs java_libs -> libs java_static_libs -> static_libs Test: java_test.go Change-Id: Icb0eefa6663844e20ad0a8729fb2c90ec916c3eb
2017-07-19Use dependency tags for java modulesColin Cross
Test: java_test.go Change-Id: Id265a2acd6e6c4ce7764f77c888e22b1fddc02c4
2017-07-19Use android.Prebuilt for JavaPrebuiltsColin Cross
Test: java_test.go Change-Id: Iabb75edbfee731578b5b9f547594613203cf9b79
2017-07-14Use ExistentPathForSourceColin Cross
Converting java to use Path objects incorrectly used PathForModuleSrc for a path that might not exist, use ExistentPathForSource instead. Test: java_test.go Change-Id: I50e4e315a10ab08c4e72065094ae29844874f5e4
2017-06-30Refactor factoriesColin Cross
Change module factories from returning a blueprint.Module and a list of property structs to returning an android.Module, which holds the list of property structs. Test: build.ninja identical except for Factory: comment lines Change-Id: Ica1d823f009db812c518f271a386fbff39c9766f
2017-06-23Add java config and share it with makeColin Cross
Add a java/config package to hold config information, and share it with make through makevars. Test: builds Change-Id: I46c088bda0fe97a1823bfdd80fa692d0bf61da1b
2017-06-23Split java device properties into separate structColin Cross
Prevent host modules from having fields that only make sense for device modules. Test: builds Change-Id: I20278e029a38fb9a6b75ef3c2cf3c1a97cef2b87
2017-06-23Remove non-idiomatic inheritanceColin Cross
Remove inheritance implemented with the bad "superclass calls subclass through interface" pattern, and replace it with composition. Test: builds Change-Id: If323f89360455b3f98b40777edaaaa265bb3b5fc
2017-06-23Update obsolete referencesColin Cross
Test: builds Change-Id: Ic37628b78704a03200b6326485fb4667e1c5a665
2016-11-30Replace core-junit with legacy-testPaul Duffin
Bug: 30188076 Test: unused code Change-Id: If6c27dc61078afbb04218afac678165f63f41166
2016-10-12Control mutator orderColin Cross
Register mutators inside lambdas that are called in a defined order to correctly order mutators before and after the arch and deps mutators. Test: build.ninja identical Change-Id: Iefe2a3515aee8570e76a6e76925db4cda0e9e822
2016-10-12Move registration into android packageColin Cross
Mutator registration is tightly coupled with the android package, move all registration from the soong package to the android package. Test: build.ninja identical Change-Id: Ie183d0b52cc7431c9e05b231934d189208ef1efe
2016-05-18Rename common to androidColin Cross
Rename the "common" package to "android", because common is too generic. Also removes all android.Android naming stutter. Ran: gomvpkg -from 'android/soong/common' -to 'android/soong/android' gorename -from '"android/soong/android".AndroidModuleContext' -to 'ModuleContext' gorename -from '"android/soong/android".AndroidBaseContext' -to 'BaseContext' gorename -from '"android/soong/android".AndroidModuleBase' -to 'ModuleBase' gorename -from '"android/soong/android".AndroidBottomUpMutatorContext' -to 'BottomUpMutatorContext' gorename -from '"android/soong/android".AndroidTopDownMutatorContext' -to 'TopDownMutatorContext' gorename -from '"android/soong/android".AndroidModule' -to 'Module' Change-Id: I3b23590b8ce7c8a1ea1139411d84a53163288da7
2016-04-12Use blueprint DependencyTagsColin Cross
Blueprint now requres DependencyTags to be passed to AddDependency calls. Use the tags to avoid setting member variables on modules, which will be lost after the mutators have been called. Change-Id: I8c1d9ed1db85a300e14394b911a516d361ba9f75
2015-12-21Refactor install pathsDan Willemsen
Explicitly allow installation into the data partition instead of using "../data" for tests. At the same time, pipe through the information required for vendor modules. Change-Id: I6baf9d828c285e1080e43074beef8aebdbb38875