aboutsummaryrefslogtreecommitdiffstats
path: root/java
Commit message (Collapse)AuthorAgeFilesLines
* Add core-lambda-stubs to classpathColin Cross2018-05-305-20/+56
| | | | | | | | | | | | | | | | 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
* Merge "Revert "Add core-lambda-stubs to classpath""Treehugger Robot2018-05-303-16/+9
|\
| * Revert "Add core-lambda-stubs to classpath"Colin Cross2018-05-303-16/+9
| | | | | | | | | | | | | | | | | | This reverts commit d9d7be0617f37939b1904e6b0b6eca69da63ba5a. Reason for revert: Broke unbundled builds. Bug: 80428539 Change-Id: I2279dbd2b11a2f63e70ad89d0b3bc42bca2b676b
* | Merge "Add aidl properties"Treehugger Robot2018-05-301-0/+6
|\ \ | |/ |/|
| * Add aidl propertiesSundong Ahn2018-05-291-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | The aidl files are allowed when creating the droiddoc module in java_sdk_library. But The properties of AIDL, local_include_dir and include_dir, are not passed to the droiddoc module. These properties are add because they are needed to generate the java files. Bug: 77575606 Test: build && java_test.go Change-Id: I1006c9ce7a5c7e424416d39fb921c27a3fa86afa
* | Add core-lambda-stubs to classpathColin Cross2018-05-293-9/+16
|/ | | | | | | | | | | | 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
* Merge "droiddoc accepts aidl files as inputs"Treehugger Robot2018-05-252-0/+74
|\
| * droiddoc accepts aidl files as inputsJiyong Park2018-05-232-0/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | droiddoc now accepts aidl files as inputs. This in turn allows us to feed aidl files to java_sdk_library modules. This is required as some java_sdk_library internally uses AIDL files and thus we need to specify *.aidl files in the srcs property. Since the srcs property is internally given to the droiddoc module as well as the runtime library, droiddoc should be able to handle aidl files. Bug: 77575606 Test: java_test.go Change-Id: If7a8559a2a1d8ac1056b061d24e3a5ee5253453f
* | Export manifest to MakeColin Cross2018-05-242-4/+6
| | | | | | | | | | | | | | | | | | | | I5d439353d46ba6659ec8d16967693d2b9e62ab5a will need the manifests from android libraries to merge into modules that reference them with LOCAL_STATIC_ANDROID_LIBRARIES. Bug: 3434784 Test: m checkbuild Change-Id: I47b9def5b9c2ecc423550eb8a988cce96038a81e
* | Add support for android_test modulesColin Cross2018-05-243-12/+65
| | | | | | | | | | | | | | | | | | 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
* | Support platform_apis propertyColin Cross2018-05-221-0/+3
|/ | | | | | | | | 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
* Merge "Run dep_fixer for java too"Treehugger Robot2018-05-171-0/+3
|\
| * Run dep_fixer for java tooDan Willemsen2018-05-171-0/+3
| | | | | | | | | | Test: treehugger Change-Id: I22fd9861f5a93842dc92365af1378235c171bb05
* | Declare proguard_dictionary as implicit output of r8Colin Cross2018-05-171-6/+8
|/ | | | | | | | | | Soong was generating proguard_dictionary, but not marking it as an output, so ninja would fail with: ninja: error: 'out/soong/.intermediates/bootable/recovery/tools/recovery_l10n/RecoveryLocalizer/android_common/proguard_dictionary', needed by 'out/target/common/obj/APPS/RecoveryLocalizer_intermediates/proguard_dictionary', missing and no known rule to make it Fixes: 78770148 Test: mmma bootable/recovery/tools/recovery_l10n Change-Id: I956f92519ea81d4fb1322114214099d46d734906
* java_sdk_library does the apicheck by defaultJiyong Park2018-05-153-31/+229
| | | | | | | | | | | | | | | | droiddoc now supports apicheck. java_sdk_library uses it to automatically perform apichecks against the not-yet-release API and the latest-released API. A module type prebuilt_apis is added. It finds api txt files and creates filegroup modules so that it can be referenced from java_sdk_library across the module boundary. Bug: 77575606 Test: m -j Test: m -j checkapi Test: m -j update-api Change-Id: I0ba859972eac060296e1df2e71c4e047392d4877
* Fix some minor bugs for droiddocJiyong Park2018-05-122-4/+10
| | | | | | | | | | | 1) typo: check-api -> checkapi 2) newlines in the error messages are correctly emitted Bug: 77575606 Bug: 78034256 Test: m -j checkapi Change-Id: Ibeef4d9f4f7f2ca48c29c23b1784efa6aa53a364
* Pass platform version name as --version-name for framework-res.apkColin Cross2018-05-091-2/+2
| | | | | | | | | | | | framework-res.apk should get the platform version name ("9") as --version-name, not the SDK version ("28"). It will get copied to compileSdkVersionCodename in APKs compiled against it. Bug: 78324052 Test: aapt dump badging $OUT/system/framework/framework-res.apk | grep -i version Change-Id: I34a601cb2c14f66199066e7d598862108da0b950 Merged-In: I34a601cb2c14f66199066e7d598862108da0b950 (cherry picked from commit b691e24d899f3a773da88df0eecada5918a96a2c)
* Apicheck Support in SoongNan Zhang2018-05-084-14/+200
| | | | | | | | | | didn't remove the props: api_filename, removed_api_filename yet since these two currently are used by java_sdk_library. Bug: b/78034256 Test: m clean && m checkapi Change-Id: Iebd014ef227487717b5b3819c80d630c34559983
* Merge changes I52f88bfd,I4263b7d5android-build-prod (mdb)2018-05-081-1/+3
|\ | | | | | | | | | | * changes: Fix usage of bytes.NewBuffer in bpfix Add a dependency fixer for proto deps
| * Add a dependency fixer for proto depsDan Willemsen2018-05-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | protoc dependency files, at least for C++ outputs, uses the form of: a/b.c \ a/b.h: <dep1> <dep2>... Ninja will fail the command when it parses a dep file and there's more than one output file (even though it doesn't care what the output file name is). So this tool will parse the original file, and output a version with only a single output file. Bug: 67329638 Test: NINJA_ARGS="-t deps ...pb.c" m Test: NINJA_ARGS="-t deps ...srcjar" m Test: NINJA_ARGS="-t deps ...srcszip" m Test: Run dep_fixer across all of taimen's dep files, no failures. Test: Run dep_fixer against the processed files, no changes. Test: Run androidmk across all of our Android.mk files, inspect the diffs Change-Id: I4263b7d5faea37285afa6b24dedf5964aa7d19dc
* | Merge "Export lists of support libraries modules to Make"android-p-preview-3android-p-preview-2Colin Cross2018-05-071-0/+66
|\ \
| * | Export lists of support libraries modules to MakeColin Cross2018-05-031-0/+66
| |/ | | | | | | | | | | | | | | | | | | | | | | Make will use the list to sort support libraries into LOCAL_STATIC_ANDROID_LIBRARIES and LOCAL_STATIC_JAVA_LIBRARIES as appropriate. Bug: 78300023 Test: m checkbuild Change-Id: I58582b124f2b6a9b124683ddf8f5d77314f2e941 Merged-In: I58582b124f2b6a9b124683ddf8f5d77314f2e941 (cherry picked from commit ff8ab0745f59c9c1ec3268051e24956ba8647849)
* | Prevent index out of rangeJiyong Park2018-05-061-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | I3487634f1ec5bb3b5b60d636b64461d391add35a is causing build breakages in unbundled builds. The stubs libs are disabled for unbundled builds, and thus we shouldn't declare them as dist artifacts. Bug: 605033 Test: make -j dist ANDROID_BUILDSPEC=vendor/google/build/app_build_spec.mk Change-Id: I3cd92e2cc6aeb48baf47d37780d8df2aa4756438
* | Merge "Stubs libs are dist artifacts"android-build-prod (mdb)2018-05-051-6/+15
|\ \ | |/ |/|
| * Stubs libs are dist artifactsJiyong Park2018-05-021-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | stubs libs from a java_sdk_library are automatically registered as dist artifacts for sdk and win_sdk targets. They are installed under $(DIST_DIR)/apistubs/<apiscope>/<name>.jar where <apiscope> can be public, system and test. Bug: 605033 Test: m -j Test: choosecombo 1 sdk_phone_armv7 userdebug; m -j sdk dist the stubs libs are found under out/dist/apistubs Change-Id: I3487634f1ec5bb3b5b60d636b64461d391add35a
* | Regenerate R.java files from LOCAL_STATIC_ANDROID_LIBRARIESColin Cross2018-05-026-26/+66
|/ | | | | | | | | | | | | | | | | | | | | If a static android library lib1 has static_libs: ["lib2"] then the R.class files for packages in lib2 will be merged into the jar for lib1. If an app has lib1 in its static_libs it will get the R.class files from lib2 through lib1, instead of regenerating the R.java files with numbering that matches the resource table of the app. Pass transtive static android library dependencies on the aapt2 command line so that aapt2 will always regenerate the R.java constants for those packages. Also extract the packages that have R.java files after each aapt2 invocation. This is not necessary for Soong, but is passed to make to let it force regenerating the packages using --extra-packages. Bug: 78300023 Test: m checkbuild Change-Id: I0f3444af44d2a9f370d1f156c908972f8cc3a1ee
* Property api_srcs added for api-only source filesJiyong Park2018-05-021-7/+7
| | | | | | | | | | | | | New property api_srcs is added to java_sdk_library. The property is used to specify set of source files that will be part of the API but not part of the runtime library. Currently, this is only for the legacy http library (org.apache.http.legacy) where some framework classes (such as android.net.SslError which are compiled into framework.jar) are registered as its API for historical reason. Bug: 77575606 Test: m -j Change-Id: I36d153f4815f8e4c939d5eeec632a38e7943b4b0
* CompilerDeviceProperties are added to the sdk impl libraryJiyong Park2018-05-021-2/+4
| | | | | | | | | | | java_sdk_library now accepts properties in CompilerDeviceProperties, such as dex_preopt.profile. The properties are passed to the impl library which is the device-specific sub-component of a java_sdk_library. Bug: 77575606 Test: m -j Change-Id: I7303068bb62ca860352db306a5462fa4453ee80f
* Add hidden_api_packages to java_sdk_libraryJiyong Park2018-05-011-0/+4
| | | | | | | | | | hidden_api_packages is used to set packages that must be hidden from the API. org.apache.http.legacy will be using this to exclude references to com.android.okhttp from its API signatures. Bug: 77575606 Test: m -j Change-Id: Ic93c67cab96585638921dc922f175e545a68ead2
* Add some friendly error messages for java_sdk_library.Anton Hansson2018-05-011-0/+7
| | | | | | | | | | The stubs will always fail to build without at least these three arguments. Give a clear error message when this happens instead of failing further into the build. Bug: 77575606 Test: make <x>.stubs for sdk_library "x" without these args Change-Id: If3142ecc73d6428f7e3120788f8de64d56a777ad
* Merge "Use and export proguard flags from static dependencies"android-build-prod (mdb)2018-05-013-3/+36
|\
| * Use and export proguard flags from static dependenciesColin Cross2018-04-303-3/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | Export proguard flags from Android library modules, and use them from static dependencies in Android apps when running proguard. Also export them to Make. Unlike Make, which concatentates all the exported flags from dependencies, Soong dedups exported flags files. Bug: 73724997 Test: m checkbuild Change-Id: I8f86fecb09cbc591832ce67e8ecef551a6600349
* | java_sdk_library supports test as another API scopeJiyong Park2018-04-281-26/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For each java_sdk_library module, three (possibly different) stubs libs are created. *.stubs: public APIs only *.system.stubs: public APIs + @SystemApi *.test.stubs: public APIs + @TestApi Depending on the sdk_version (or LOCAL_SDK_VERSION) of the calling module, stubs lib of the corresponding api scope is linked. Bug: 77575606 Test: m -j Change-Id: I1437c64460914dbfc349dbc31d6f3ef090f541e3
* | Add prebuilt_etc_xmlandroid-n-iot-release-lg-thinq-wk7Jiyong Park2018-04-282-3/+3
|/ | | | | | | | | | | | | | | | | | | | | | | prebuilt_etc_xml installs an xml file to <partition>/etc[/<subdir>] and validates the xml file against the given DTD file before installing it. This change also includes some fixes for prebuilt_etc which is the super module of prebuilt_etc_xml: 1) The module is changed to arch-specific module as the prebuilts are only for devices (installed under the etc dir), but not for hosts. 2) Dependency to android.Prebuilt is removed because android.Prebuilt is intended to be used for the case when a module can exist as prebuilts, source or both. These prebuilt_etc_* modules are prebuilt only. 3) srcs property which accepts a list of source files is changed to src that only accepts single source file, which makes more sense for prebuilts. Bug: 65686190 Test: m -j (xml_test.go) Change-Id: I40484f3f6615b99f6b8d43176db0c40c5bfd838e
* Merge "Add new Doclava flag support to soong"David Brazdil2018-04-262-0/+13
|\
| * Add new Doclava flag support to soongDavid Brazdil2018-04-252-0/+13
| | | | | | | | | | | | | | | | | | | | | | CL I8fe27e8c03334f9c90204db1e69447de65a06a38 adds new "-removedDexApi" flag to Doclava. This patch adds support for that flag into Soong. "droiddoc" targets can generate the new API file with property "removed_dex_api_filename". Bug: 78182899 Test: make Change-Id: I04b8f615aa4655167b824d40c3fafa2648beec01
* | Merge "Don't use AppsDefaultVersionName for framework-res.apk"android-build-prod (mdb)2018-04-251-1/+10
|\ \ | |/ |/|
| * Don't use AppsDefaultVersionName for framework-res.apkColin Cross2018-04-251-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some builds set AppsDefaultVersionName() to include the build number ("P-123456"). aapt2 copies the version name of framework-res into app manifests as compileSdkVersionCodename, which confuses things if it contains the build number. Use the DefaultAppTargetSdk ("P") instead. Bug: 78324052 Test: m TARGET_BUILD_WITH_APPS_VERSION_NAME=true Dialer aapt dump badging $OUT/system/priv-app/Dialer/Dialer.apk | grep compile shows compileSdkVersionCodename=P Change-Id: If67f40aae1066d4ff3bf97da1b2de2e1e250ad9c
* | Fix the undefined CommandDeps for standard JavadocNan Zhang2018-04-241-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When compiling against without customized doclet, Javadoc doesn't need to depend on Doclava and Jsilver jars. Originally, we leave these two jars empty in Args so that CommandDeps won't have these two dependencies. But Ninja doesn't like that with errors: ninja: error: build.ninja: empty path because $Jsilver and $Doclava is undefined when compiling Javadoc. Test: m -j platform_library-docs Bug: b/70351683 Change-Id: I02fee181490f91e87a1feac74f3a69b5b4acb528
* | Additional fixes for java_sdk_libraryJiyong Park2018-04-242-8/+61
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change fixes several problems found while re-defining some libs using java_sdk_library module type. 1) A phony module whose name is the same as the java_sdk_library name is defined. It is used to support installing the runtime library via PRODUCT_PACKAGES (even when there is no dependency from other modules). 2) A bug that package names whose depth is >= 2 is ignored in droiddoc.srcs_lib_whitelist_pkgs is fixed. A package name foo.bar.baz is now converted to a path foo/bar/baz following the Java convention. 3) A make variable JAVA_SDK_LIBRARIES that is the list of java_sdk_library module names is exported to make. This can be used to distinguish SDK libraries from ordinary libs. 4) When running doclava, some framework sources in the 'android' package and the same packages as the SDK library are automatically added to the sources list. This is required for the case when API class is extending from the framework class. In that case, doclava needs to know whether the base class is hidde nor not. Since that visibility info is encoded as @hide string in the comment, we need source files for the classes, not the compiled ones. Also there are rare cases where part of SDK library is implemented in the framework (e.g. org.apache.http.legacy). In that case, we need framework source to make API stubs, though the sources are not required to build the runtime library. 5) The stubs libs are disabled for PDK builds as well. Bug: 77575606 Test: m -j Change-Id: I360cf15fe5339e46644fb16d0dabe2548aa315f9
* Merge "Remove product-specific flags from android_library modules"Colin Cross2018-04-202-18/+22
|\
| * Remove product-specific flags from android_library modulesColin Cross2018-04-192-18/+22
| | | | | | | | | | | | | | | | | | Static android libraries should not get the product-specific flags. Bug: 73724997 Test: m checkbuild Change-Id: I89e8c0a3fb788b18ee6603e9d21c9b9a5275f42f
* | Adding java_sdk_libraryJiyong Park2018-04-194-0/+511
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Fix aapt2 --min-sdk-version after finalized SDK"Colin Cross2018-04-182-1/+96
|\|
| * Fix aapt2 --min-sdk-version after finalized SDKColin Cross2018-04-182-1/+96
| | | | | | | | | | | | | | | | | | | | | | aapt2 --min-sdk-version was using AppsDefaultVersionName(), which is OMR1 for a non-finalized SDK, but 8.1.0 after finalization. Add PlatformSdkCodename() for non-finalized SDKs, use it for DefaultAppTargetSdk(), and pass it for aapt2 --min-sdk-version. Bug: 78224641 Test: TestAppSdkVersion in app_test.go Change-Id: I622eaf92f8a940f79007c2a579536da325700b06
* | Merge "Reverse RRO dir paths when passing to Make"Colin Cross2018-04-181-1/+3
|\|
| * Reverse RRO dir paths when passing to MakeColin Cross2018-04-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | LOCAL_RESOURCE_DIRS puts the highest priority overlay first, but aapt2 expects the highest priority overlay last. Soong stores the list in aapt2 order (low to high priority), but that means when it exports to Make as LOCAL_SOONG_RRO_DIRS, which goes to build_rro_package.mk and then package_internal.mk, it gets reversed again and comes out backwards. Bug: 78032566 Test: m checkbuild Change-Id: If72bf929fbf1d126f9051a2f21ec1eb4e3030e6e
* | Fix few issues with filegroupsPirama Arumuga Nainar2018-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: http://b/64121881 Bug: http://b/78188880 - Allow filegroup's properties to be extended by a LoadHook - Support a filegroup (':module') in a prebuilt's 'Srcs' property to export files from a different path as the prebuilt's sources. This change also includes a refactoring that moves genrule/filegroup.go to android/filegroup.go so that FileGroupFactory is visible in prebuilt_test.go. Test: Test https://android-review.googlesource.com/c/platform/development/+/469159 in clang-tools branch on Linux, Darwin. Test regular build in aosp/master. Change-Id: I3ff6215ab2e62955f039fd1086c31f1bd50ebcf6
* | Migrate soong to use new sdk prebuilts.Anton Hansson2018-04-182-27/+29
|/ | | | | | | | Make is moved over in aosp/661963. Bug: 77525052 Test: make Change-Id: I04ea58964df3d4149ef09ab7ca9238336d338a06
* Merge "Add bool to control if we need generate stubs src files."Treehugger Robot2018-04-171-3/+9
|\