summaryrefslogtreecommitdiff
path: root/java/java.go
AgeCommit message (Collapse)Author
2018-07-17Add a Generate_get_transaction_name flag.Olivier Gaillard
Add a flag to be able to generate the Binder#getTransactionName method Test: manual Bug: 111200705 Change-Id: I3e8106261df5c63cdc005d07c9d8efcc6732db70
2018-07-16Fix .kotlin_builtins globColin Cross
The files in kotlin jars seem to be called .kotlin_builtins, not .kotlin_builtin. Test: m checkbuild Change-Id: I541aea758bbef6bb23632836cceb8339b82ffdff
2018-07-16Make merge_zips -stripFile use blueprint style globsColin Cross
merge_zips -stripFile was only considering the name of the file and ignoring the path. Make it more useful by supporting blueprint style globs. The previous behavior can be recreated by prefixing with **/. Bug: 111389216 Test: m checkbuild Change-Id: I25760fe3f1f77704dd9da9d107d9a38a415d681f
2018-07-12Add exclude_files and exclude_dirs properties to java_importColin Cross
Prebuilt jars sometime contain files that we don't want. In Make we would delete everything in META-INF when importing jars, but that caused problems when there were necessary files in there, so we added LOCAL_DONT_DELETE_JAR_META_INF. Soong does the opposite, keeping everything by default. Add properties to allow explicitly stripping unwanted files instead. Bug: 111389216 Test: m checkbuild Change-Id: I6d07f519ebc7d0e1bf0af93416bb569e3c2b1500
2018-07-11Don't install java libraries by defaultColin Cross
Very few java libraries need to be installed, most are statically included in other modules. Device modules that are not installed also don't need to be dexed, saving checkbuild time. Change the default for java_library to not be installed, and allow libraries that should be installed to specify installed: true. This makes java_libary and java_library_static identical. It also simplifies some corner cases when converting from Make to Soong if a module is built for the host (which doesn't differentiate between static and non-static/installable) and statically for the device, which couldn't be represented in a single java_library in soong. Bug: 110885583 Test: m checkbuild, compare presubmit target files Change-Id: Idc0841c39a17cebd7bac3559c9408596d167a393
2018-07-09Add support for min_sdk_versionColin Cross
Add min_sdk_version properties and use it for aapt2 --min-sdk-version and --target-sdk-version flags. Add an sdkContext interface that any function that needs an sdk version can take in order to get the values for the current module. Bug: 110848854 Test: m checkbuild Change-Id: Ic69f1f935d8b865ec77689350407df08bfac5925
2018-07-09Add option to compile dex for a Java libraryDavid Brazdil
Currently Soong will only compile a Java library into dex if the library has device support and is installable. For our use case of inspecting the dex at build time this is not sufficient. Add a new "compile_dex" device property which forces the creation of a dex rule. In this case, the class jar remains the output file of the module. Bug: 79409988 Test: on related CL Change-Id: Ia908a47148a03a0bdb0da4315cce6efc86c51865
2018-07-03Use correct variant for annotation processors.Mathew Inwood
Annotation processors should always have a common host variant, rather than a device variant as the build was looking for before. Bug: 110868826 Test: m Change-Id: I2b7d0e7ed1af3f2f9ddb87d2bf36920737a507e9
2018-06-20Run ErrorProne in OpenJDK9Colin Cross
Use the OpenJDK9 javac to run ErrorProne by adding it to -processorpath and using -Xplugin:ErrorProne. Bug: 69485063 Test: m RUN_ERROR_PRONE=true javac-check Change-Id: I0496006b71b70766ef16d57753cbcf037897799c
2018-06-20Use -processorpath for annotation processorsColin Cross
ErrorProne needs to be added to -processorpath, but once anything is passed via -processorpath javac stops looking in the classpath for annotation processors. Move annotation processors to -processorpath in preparation. This reapplies Ife06b3c7432ab971f5605dcc18a558bcbd99a675 with fixes to processorpath in errorprone rules. Test: m java Change-Id: I188136771386a2183fb31f4b70b50c95ac419ff8
2018-06-21Revert "Use -processorpath for annotation processors"Colin Cross
This reverts commit 6dd0bb3b7726cbf3f385da90745ce25deead9790. Reason for revert: broke RUN_ERROR_PRONE=true build Change-Id: I23d066281e392c6e7df29c5cd4558c7cf731c1a5
2018-06-20Use -processorpath for annotation processorsColin Cross
ErrorProne needs to be added to -processorpath, but once anything is passed via -processorpath javac stops looking in the classpath for annotation processors. Move annotation processors to -processorpath in preparation. Test: m java Change-Id: Ife06b3c7432ab971f5605dcc18a558bcbd99a675
2018-06-20Export SDK library namesJiyong Park
java_library, java_import, and android_library export SDK library names that they are using directly or indirectly via its dependencies. When building an apk, the manifest fixer uses the SDK lib names to automatically add <uses-library> tags. The SDK lib names are exported to the make world via LOCAL_EXPORT_SDK_LIBRARIES flag. Bug: 77575606 Test: m -j Change-Id: I4fe606eb7ed23843c58eebe6a324405fe1da34e5
2018-06-19Support Java Lang level 9 for droiddoc in Soong.Nan Zhang
Test: m -j docs / m -j metalava-api-stubs-docs Bug: b/70351683 Change-Id: I7220d04f508f6bb5ffd281cf31bc8c0069c219e5
2018-06-15Changed droiddoc.go to compile Metalava based android.jarNan Zhang
Test: m -j metalava_android_stubs_current Bug: b/78245848 Change-Id: Ibce139a93a40e412d8def1b26660446b0a7a24ff
2018-06-06Add kotlin stdlib to javac classpathColin Cross
Java modules that have .kt sources may also use kotlin stdlib types in their .java sources. Bug: 78245848 Test: m checkbuild Change-Id: I064cb76b8a641ad92d648febaa400bc01549a9c5
2018-05-30Add core-lambda-stubs to classpathColin Cross
Add core-lambda-stubs to the bootclasspath for modules with no sdk_version or with sdk_version: "current", and to the classpath for modules that specify a specific sdk_version number. Use the prebuilt sdk-core-lambda-stubs when using a prebuilt SDK. Fixes compiling modules with lambdas against the SDK. This reapplies I5e700f2dd86f1a6b84b7a55dd9bfe21a448d3fb6 with fixes and tests for unbundled builds. Bug: 80428539 Test: java_test.go Change-Id: Ib7aaeebb93137270d7336a7293a08ed7064a3184
2018-05-30Revert "Add core-lambda-stubs to classpath"Colin Cross
This reverts commit d9d7be0617f37939b1904e6b0b6eca69da63ba5a. Reason for revert: Broke unbundled builds. Bug: 80428539 Change-Id: I2279dbd2b11a2f63e70ad89d0b3bc42bca2b676b
2018-05-29Add core-lambda-stubs to classpathColin Cross
Add core-lambda-stubs to the bootclasspath for modules with no sdk_version or with sdk_version: "current", and to the classpath for modules that specify a specific sdk_version number. Fixes compiling modules with lambdas against the SDK. Bug: 80428539 Test: java_test.go Change-Id: I5e700f2dd86f1a6b84b7a55dd9bfe21a448d3fb6
2018-05-24Add support for android_test modulesColin Cross
android_test module are APKs that can be run as tests, either as standalone unit tests or as instrumentation tests for another APK. Test: m checkbuild Change-Id: I16661701637e4048fd99442029c3e195ebf373a4
2018-05-22Support platform_apis propertyColin Cross
Add a platform_apis property. The logic to verify it isn't hooked up yet, but this will allow translating modules to Soong without losing the annotation. Test: m checkbuild Change-Id: I75ff2d7b94247873f5bb1547a9b347a8e73c3191
2018-04-19Adding java_sdk_libraryJiyong Park
java_sdk_library is to make a Java library that implements optional SDK APIs to apps. It is actually a wrapper for several modules: 1) stubs library that clients are linked against to, 2) droiddoc module that internally generates API stubs source files, 3) the real runtime shared library that implements the API, and 4) XML file for adding the runtime lib to the classpath at runtime if requested via <uses-library>. Note: this is only the initial CL for the feature. Followings are features currently missing and under development. 1) check for API consistency 2) install stubs libs as the dist artifacts 3) ensuring that apps have appropriate <uses-library> tag 4) disallowing linking to the runtime shared lib 5) HTML generation Bug: 77575606 Test: m -j Change-Id: I4a4ccf6e730e041703c63bb275d8860d0de96887
2018-04-18Migrate soong to use new sdk prebuilts.Anton Hansson
Make is moved over in aosp/661963. Bug: 77525052 Test: make Change-Id: I04ea58964df3d4149ef09ab7ca9238336d338a06
2018-04-16Add support for android_library modulesColin Cross
Add support for compiling android_library modules into AARs, and refactor app support on top of it. Bug: 73724997 Test: app_test.go Change-Id: I1dfac5fffe577c6680bc4709147b2061eb7d819c
2018-04-10Consistently use Bool instead of proptools.BoolColin Cross
Use Bool instead of proptools.Bool and String instead of proptools.String. Test: m checkbuild Change-Id: I32d84add9f27128c7a65413e9612fd920613584f
2018-04-10Use proptools.BoolDefaultColin Cross
Replace x == nil || *x with proptools.BoolDefault(x, true) Test: m checkbuild Change-Id: Icc5378cab3ea72d86544b40761c2f00b278cc0a1
2018-04-10Add java_test and java_test_hostColin Cross
java_test is equivalent to a java_library with a default junit dependency and marked as a test in Make for installation and automatic AndroidTest.xml generation. Bug: 70770641 Test: m checkbuild Change-Id: I9ca97521e952d121db46abff6f24f274dd7a3ad7
2018-04-10Use built SDK stubsColin Cross
Now that the SDK stubs are built in Soong, undo the hack that uses the prebuilt stubs. Fix the linktype checks to treat the various stubs libraries as the correct type, since they can't be annotated with sdk_version. Bug: 70351683 Bug: 77285514 Test: m checkbuild Change-Id: I5e870c34dd0ebc8ae3f888ec627da590c846a76f
2018-04-10Remove deviceProperties from BinaryHostFactoryColin Cross
java_binary_host should not include the device-only properties. Test: m checkbuild Change-Id: Ief6b0a0e98310f7a4f3684c4632f618d73f10bdd
2018-03-28Link type check for Android.bp defined Java modulesJiyong Park
Link-type is also checked among Java modules defined in Soong. Until now, the check has been done in between Soong/Make and Make/Make. With this, a Java module can't depend on another Java module built with larger API surface. For example, a java library built with Android SDK (sdk_version: "current") can't link to a library built without SDK. Bug: 73829976 Test: m -j Change-Id: I64277be6e65e8535aad951b4f08f8d10b67abe66 Merged-In: I64277be6e65e8535aad951b4f08f8d10b67abe66 (cherry picked from commit f3586661e8525125f529082fee14edec32d73e04)
2018-03-26Add trace flag for cpp/Java AIDL generation.Martijn Coenen
The AIDL code generator can now include trace code in every generated AIDL call. We don't want to enable this by default for all interfaces for two reasons: 1) Potential performance overhead 2) For Java targets, the code depends on @hide APIs in android.os.Trace, and I haven't found a clean way to determine whether a target is allowed to use @hide stuff in the SDK. LOCAL_PRIVATE_PLATFORM_APIS is almost it, but it's not set for the core framework (which is exactly one of the things we'd like to trace). Bug: 74416314 Test: verify correct code is generated when flag is set Change-Id: Ic6ab8aee3e708207813da3e803911a844ff3e52b Merged-In: Ic6ab8aee3e708207813da3e803911a844ff3e52b
2018-03-24Handle prebuiltDepTag for java modulesJiyong Park
When there is a prebuilt java lib defined and there is a java library with the same name, the reverse dependency from the java lib to the prebuilt lib is added. However, the java library didn't recognize the dependency type and causes error. Fixing the problem by not panicking on such dependency. Test: m -j Test: m -j dist DIST_DIR=out/dist ANDROID_BUILDSPEC=vendor/google/build/app_build_spec.mk Merged-In: I79673b2bb382100e42c5336e8041daa8c86fa857 Change-Id: I79673b2bb382100e42c5336e8041daa8c86fa857 (cherry picked from commit 46dbf9c63e3daa0712aa81b7810c732b38daed3d)
2018-03-20Add support for renamed kotlin stdlib.Przemyslaw Szczepaniak
Added new CompilerProperty flag, rename_kotlin_stdlib, which allow to build kotlin libraries/binaries that use platform internal version of kotlin stdlib (com.android.kotlin.*). This way, app-provided kotlin standard library won't collide with version used internaly. + remove kotlinc-build.xml after compilation so it won't end up in the result jar file + remove *.kotlin_module and *.kotlin_bultin filesfrom result jar file. These files are needed only by kotlin-reflect library and need more work to support kotlin-stdlib renaming. Bug: 73281388 Test: java_test.go Change-Id: Iae7ccb919e2ae9853b3f30f3dd447ebd01a1bed0
2018-03-09Fetch generated srcs from java libs for droiddoc.Nan Zhang
api-stubs, system-api-stubs and etc need generated sources and srcjars from "framework", so add a property that tell module to fetch srcs and srcjars from its dependency libraries. The libraries in that property has to be in the module's classpath. Also add doc_defaults targets. Bug: b/70351683 Test: m -j Change-Id: I05831fbcad488037710950e4f05dc8fb2a12f403
2018-03-08Allow proto properties in cc/java_defaultsDan Willemsen
Test: Add proto.canonical_path_from_root: true in a cc_defaults Test: Add proto.canonical_path_from_root: true in a java_defaults Change-Id: I9ddfc8af0025705a34b6e487225f1f98915054c3
2018-03-06Only add SDK file dependencies on device buildsColin Cross
Dependencies on sdk_vcurrent, etc. should only be added to java modules that are building for the device. Test: aosp-build-tools build Change-Id: I01abba94fed8b470085529092263f4634dec229c
2018-03-05Pass bootclasspath to kotlincPrzemyslaw Szczepaniak
Lack of bootclasspath causes lack of libcore classes when compiling code that would run on a device. Bug: 73281388 Test: make hidl-doc Change-Id: I2172740c4e318a7e24d0a40d967ccc91b7226338
2018-02-22Remove unused intermediates parameter from ExistentPathForSourceColin Cross
Test: m checkbuild Change-Id: Id2c0a5039c2ec3b3795385c135ffec022ccd691e
2018-02-22Droiddoc Support in SoongNan Zhang
Support Droiddoc to Soong based on core/droiddoc.mk. The non-std doclet based droiddoc compilation output is a "real" stubs.jar instead of a directory of java files and a timestamp file. The std doclet based javadoc compilation output is a "empty" stubs.jar instead of a timestamp file. The stubs.jar will be exported to out/target/common/obj/JAVA_LIBRARIES/$(LOCAL_MODULE)_intermediates/classes.jar and out/target/common/docs/$(LOCAL_MODULE)-stubs.jar A $(LOCAL_MODULE).zip file will be generated also, and is exported to out/target/common/docs/$(LOCAL_MODULE)-docs.zip if property: installable is not set to false. Bug: b/70351683 Test: unittest + convert libcore docs Android.mk to Soong manually. Change-Id: I1cffddd138a5d9d445f86a3d4a3fd4de88a2bc0f (cherry picked from commit 78188ec622cb1ee24171455867fc58ffab91562e)
2018-02-21Use android.InList for inListColin Cross
Remove duplicate implementations of inList. Test: m checkbuild Change-Id: I6943b95f6d47e6722b9ff1ab61ab14c429fe33a0
2018-02-15Revert "Revert "Support filegroup in exclude_srcs""Nan Zhang
This reverts commit 606e9de344fae07473dd79e5ac556886a72035de. Reason for revert: <try to fix the broken build yesterday> Change-Id: I2963b9af63c7c7398159e5e9a1e448266e1c81d5 Test: unittest
2018-02-14Add rsp and srcjar support to kotlinc build rulePrzemyslaw Szczepaniak
Rsp files are supported through helper script (gen-kotlin-build-file.sh) that generates the kotlinc module/build xml file. Since rsp files are supported, I've added ExtractSrcJarsCmd step to handle srcjars extraction. Minor reorderings to make sure that TransformKotlinToClasses recives only .java and .kt files when called from Module.compile. Bug: 73281388 Test: make -j hidl-doc Change-Id: I5a40b914569018dc529903a7f2864a5aeae838e5
2018-02-09Revert "Support filegroup in exclude_srcs"Tobias Thierer
This reverts commit f36a3d9b6da654bf8bd7a49315b1625cf0e774ce. Reason for revert: Broke several builds. I'm acting build cop, reverting. Bug: 70351683 Change-Id: I775ada4e9cb6473519d51420b41b818af163da44
2018-02-07Support filegroup in exclude_srcsNan Zhang
Test: add unit-test, m -j32 Bug: b/70351683 Change-Id: Iff83c56d45dd668d9df6131c7df2e23e5c73a21b
2018-02-06Change the naming policy of system_$(VER)Sundong Ahn
The module name of system_$(VER) prebuilt file is system_sdk_v$(VER). But this is inconsistent with sdk_v$(LOCAL_SDK_VERSION) in prebuilts/sdk. So, system_sdk_v$(VER) is changed to sdk_vsystem_$(VER) to use the same naming policy. Bug: 72031391 Test: build Change-Id: I3f18b7969dda208beeefdcaefadcc42db5c1577e
2018-02-07Support sdk_version: "core_current"Jiyong Park
core_current is a pseudo SDK version which is a core Java API subset of the Android API. It is expected to be mainly used for external Java projects which are agnostic to Android; such as junit, guava, etc. A module built with this SDK version can only link to java modules of the same kind. It can't depend on modules built with other sdk (e.g. current) or without sdk. Bug: 72206056 Test: m -j Change-Id: I778e7b4fcb9456a12b418ffd633ea78e29951e84
2018-02-06Add property to enable adding tools.jar to bootclasspath.Nan Zhang
Converting Doclava to Soong need tools.jar as one of its bootclasspaths. Test: m doclava Bug: b/70351683 Change-Id: I0ac65fcbe1eadfc57239cde2e83b80cf441a9b69
2018-01-23Soong: support Errorprone javacflagsAndreas Gampe
Add support for an errorprone block in Java modules that accepts additional javacflags for the errorprone build. Sample: errorprone: { javacflags: ["-Xep:EqualsNaN:WARN"], }, Bug: 72004718 Test: m RUN_ERROR_PRONE=true Test: manual - add block with ERROR to a project Test: androidmk_test Change-Id: I502248fe76c26aa19102f413af72a7324c35b7f4
2018-01-19Add PLATFORM_SYSTEMSDK_VERSIONS and BOARD_SYSTEMSDK_VERSIONSJiyong Park
PLATFORM_SYSTEMSDK_VERSIONS is the list of System SDK versions that the platform is supporting. Contrary to the public SDK where platform essentially supports all previous SDK versions, platform support only a few recent System SDK versions, since some of old System APIs are gradually deprecated, removed from the following SDKs and then finally deleted from the platform. This will be part of the framework manifest. The list can be specified by setting PLATFORM_SYSTEMSDK_MIN_VERSION. If it is set to an old version number, then System SDKs from the version to the current version (PLATFORM_SDK_VERSION) are considered to be supported by the platform. If PLATFORM_SYSTEMSDK_MIN_VERSION is not set, only the latest System SDK version is supported. Next, BOARD_SYSTEMSDK_VERSIONS is the list of System SDK versions that the device is using. This is put to the device compatibility matrix device is using. The device and the platform is considered as compatible only BOARD_SYSTEMSDK_VERSIONS in the device compatibility matrix are in the PLATFORM_SYSTEMSDK_VERSIONS in the framework manifest. When BOARD_SYSTEMSDK_VERSIONS is set, a Java app or library in vendor or odm partitions which didn't specify LOCAL_SDK_VERSION is forced to use System SDK. Also, the build system does the additional integrity check to ensure that LOCAL_SDK_VERSION is within BOARD_SYSTEMSDK_VERSIONS or PLATFORM_SYSTEMSDK_VERSIONS (if BOARD_SYSTEMSDK_VERSIONS isn't set). Bug: 69088799 Test: m -j Test: BOARD_SYSTEMSDK_VERSIONS=P m -j Change-Id: Id38f02b4be86710411be22bc28109e6894f8a483
2018-01-16change vsdk_v$(ver) to system_sdk_v$(ver)Sundong Ahn
The vsdk name is change to system sdk, so vsdk_v$(ver) need to change to system_sdk_v$(ver) Bug: 67724799 Test: build & boot on taimen Change-Id: I9ac508f5ed2602fbf827e0b0e4c205ab01915525