aboutsummaryrefslogtreecommitdiff
path: root/java/java.go
Commit message (Collapse)AuthorAgeFilesLines
...
| * Link type will be check in android_library alsoJeongik Cha2019-11-011-9/+17
| | | | | | | | | | | | | | | | For now, Soong checks link-type in java_library, so it cannot block hidden api usage from android_library that app links with. So we should add check in 'android_library' Test: m nothing Change-Id: Ic040270ec668bdd693b690ac8a88be1048922c3b
* | Merge "Add exported_plugins to java.Library."Treehugger Robot2019-11-271-4/+46
|\ \
| * | Add exported_plugins to java.Library.Artur Satayev2019-11-261-4/+46
| | | | | | | | | | | | | | | | | | | | | | | | The behaviour is similar to go/be#java_library.exported_plugins. Plugins added to exported_plugins of library X are not applied to the library itself, but rather to libraries that directly depend on the library X. Test: m checkbuild Bug: 139740873 Change-Id: I4042bd482ad9cb12d6fbaac51f039d38b1b7a428
* | | Dedup code for generating java_import in snapshotPaul Duffin2019-11-261-12/+14
|/ / | | | | | | | | | | | | | | | | Removes duplicated code for generating a versioned and non-versioned form of the java_import module in the snapshot. Bug: 143678475 Test: m nothing and check output for dummy sdk Change-Id: Ia8d05c3bf9ef79953a817b168dd9d59f2af2d2ce
* | Refactor sdk update mechanismPaul Duffin2019-11-141-0/+51
| | | | | | | | | | | | | | | | Creates a SnapshotBuilder and GeneratedSnapshotFile interfaces to allow the java library snapshot work to be moved into the java package. Test: m -j60 checkbuild Change-Id: I857167616026149d5e85885621b53876b419ba9b
* | make ApexProperties defaultableJooyung Han2019-11-131-6/+6
| | | | | | | | | | | | | | | | | | | | ApexPropreties are added in InitApexModule() and they are supposed to be defaultable. To be defaultable, InitApexModule() should be called before InitDefaultableModule(). Bug: 144332048 Test: m (soong test added) Change-Id: I6c90ed3b66a086292a4c0ecb37c61f83769e62bd
* | Merge "Enforce hidden apis usage in product(soong)"Treehugger Robot2019-11-111-14/+15
|\ \
| * | Enforce hidden apis usage in product(soong)Jeongik Cha2019-11-061-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only if PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE is set, every app and java library in product cannot use hidden APIs anymore. checkSdkVersion() checks if sdk_version of app and library is narrow enough, checkLinkType() checks every library that app links agianst Bug: 132780927 Test: m Test: set PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE, and check whether build error occurs. Change-Id: Ic630503b875040f730feda4fef826ed6d71da111
* | | Merge "APEX now correctly tracks jni_lib dependencies"Treehugger Robot2019-11-091-0/+5
|\ \ \
| * | | APEX now correctly tracks jni_lib dependenciesJiyong Park2019-11-081-0/+5
| |/ / | | | | | | | | | | | | | | | Bug: 144135069 Test: m (apex_test.go amended) Change-Id: If9dde4e2e62c2642267dbcac68bab76a032682c0
* / / Silence dep-ann warningsColin Cross2019-11-071-0/+1
|/ / | | | | | | | | | | | | | | Silence the dep-ann warnings until there is an effort to do something about them. Test: m framework-minus-apex doesn't print dep-ann warnings. Change-Id: Ic172e840dded4564fecfb91e96cba0c54358e20a
* / stem property of java modules are propagated to MakeJiyong Park2019-10-311-5/+15
|/ | | | | | | | | | | | | | | | | 62c7829595c0df53e96addcd347c11ac01012eee introduced the new stem property to java modules, but it wasn't propagated to Make. Fixing the problem. This change also fixes a problem that (module name) == (file name) is assumed in dexpreopt_config.go, which no longer is the case. A mutator runs to build a map from module name to its stem. The map is then used when filling up the file paths in the bootImageConfig struct. Bug: 139391334 Bug: 143494499 Test: m Test: BootImageProfileTest Change-Id: Idbc894f877692401471130de6cbfe5e0dd129da9
* Use java language 1.9 for sdk_version: "current"Colin Cross2019-10-291-11/+18
| | | | | | | | | | | | | | | | | | | | | | | | Java language was set for 1.8 for anything building against the current SDK because the stubs were not built in Soong, so the system modules could not be built. The stubs have been built in Soong since Iabd32b30954b3f4a6d9a779fde52a032b684807e, but I5e870c34dd0ebc8ae3f888ec627da590c846a76f missed updating this TODO. Use 1.9 when building against the stubs, but continue using 1.8 for unbundled builds until we have prebuilt system modules. Always use the core-current-stubs-system-modules to avoid splitting android.* packages between the system modules and the classpath, which would cause new classes in android.* packages in classpath jars to be ignored. Add a new java9Classpath field to sdkDep that will contain the stubs jar when targeting Java language level 1.9, and plumb it through to javac and turbine. Rename the modules field to bootclasspath. Bug: 142896162 Test: m checkbuild Change-Id: Icfd32d0a863b2303a997c7cf03cb3708aade4724
* Remove special case for sdk_version: "none"Colin Cross2019-10-291-17/+12
| | | | | | | | | | | The dependency handling for sdk_version: "none" (which propagated to !sdkDep.hasStandardLibs()) was very similar to the normal useModule case. Combine the cases by making decodeSdkDep set useModule: true and put the system modules in modules for the sdk_version: "none" case. Test: TestClasspath Change-Id: Icc9ff4d43a38da25cc0e3628be95951d61773ad5
* Make javaVersion an enumColin Cross2019-10-281-21/+47
| | | | | | | | Remove the hardcoded checks against "1.9" by making javaVersion an enum and implementing javaVersion.usesJavaModules(). Test: TestClasspath Change-Id: I559eeb1f45880bb8177269c6d977ee4dfbadce57
* Merge "Remove support for EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9."Pete Gillin2019-10-281-1/+1
|\
| * Remove support for EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9.Pete Gillin2019-10-251-1/+1
| | | | | | | | | | | | | | | | | | Prior to this change, setting that to "false" turned the default Java language level back to 8. This change removes that option. Bug: 115604102 Test: m java droid docs tests cts Change-Id: I97bfd0dc8d941008b4071c6efe1c0c24950c4f1f
* | add stem property to java modulesJiyong Park2019-10-251-4/+15
|/ | | | | | | | | | | java_library, java_import and dex_import now support stem property to set the output file name. Bug: 139391334 Test: m Merged-In: I11146badf558e524a973806114b9cb1344db4a6e (cherry picked from commit 62c7829595c0df53e96addcd347c11ac01012eee) Change-Id: I11146badf558e524a973806114b9cb1344db4a6e
* Merge "Add tradefed_java_library_host"Treehugger Robot2019-10-191-1/+7
|\
| * Add tradefed_java_library_hostColin Cross2019-10-181-1/+7
| | | | | | | | | | | | | | | | | | | | Add a module type for tradefed libraries that causes an additional copy to be installed at out/host/linux-x86/tradefed. Bug: 122332235 Bug: 141877526 Test: m tradefed Change-Id: Ib7160dd060ad83d2dfb81d6a7106cb0dac98553e
* | Merge "Prohibit dependencies outside of uses_sdks"Treehugger Robot2019-10-181-0/+6
|\ \ | |/ |/|
| * Prohibit dependencies outside of uses_sdksJiyong Park2019-10-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | When an APEX is built with uses_sdks, any depedndency from the APEX to the outside of the APEX should be from the SDKs that the APEX is built against. Bug: 138182343 Test: m Change-Id: I1c2ffe8d28ccf648d928ea59652c2d0070bf10eb
* | Merge "Add method to determine variations from a Target"Colin Cross2019-10-171-3/+1
|\ \ | |/ |/|
| * Add method to determine variations from a TargetColin Cross2019-10-161-3/+1
| | | | | | | | | | | | | | | | | | | | The arch variants are hardcoded in every module type. Refactor them out into a Target.Variations() method in preparation for splitting the arch mutator into two, which will require using different variations. Test: m checkbuild Change-Id: I28ef7cd5168095ac888fe77f04e27f9ad81978c0
* | Merge "AIDEGen: Remove the duplicate *.srcjar from srcs"Treehugger Robot2019-10-151-5/+8
|\ \
| * | AIDEGen: Remove the duplicate *.srcjar from srcspatricktu2019-10-141-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AIDEGen collects the complied sources which are generated from build system, the sources includes not only java/kt files but also srcjar files. Since the srcjar files are record in srcjars parameter in json file, we should keep only java or kt files in the srcs parameter. The size diff of module_bp_java_deps.json: Without this patch: 15,298,369 Bytes With this patch: 15,044,804 Bytes The build time diff: Without this patch: 2m31.345 With this patch: 2m32.662 Bug: 141528361 Test: 1. m clean -j 2. aidegen tradefed 3. Open out/soong/module_bp_java_deps.json 4. Find the module CtsSyncManagerCommon and check the sync_manager_cts.srcjar files doesn't exist in srcs but exists in srcjars section. Change-Id: I43fc5c05b657473054e632cae4795220907dc711
* | | Add system_modules to droidstubsPaul Duffin2019-10-111-8/+13
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | This allows droidstubs to use the same system modules to create the stubs that will be used to compile them. It improves consistency and avoids droidstubs having to duplicate the libraries that make up the system modules on its libs property. Adds systemModules() to the sdkContext which allows consistent error checking behavior between droidstubs and java_library. Bug: 142534789 Test: m checkbuild Change-Id: Ib2006906d9528a900f16851f50b62152ffb51a1b
* | Separate InstallPath from OutputPathColin Cross2019-10-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create a new type InstallPath that is similar to OutputPath to differentiate intermediates output paths from installed output paths. RelPathString is a poorly defined, undocumented function that is primarily used to get an install path relative to out/soong to generate an equivalent install path for Make relative to $(OUT_DIR). Move it to InstallPath for now, and fix the one remaining user on OutputPath. Add a method to create an NDK install path so that ndk_sysroot.go doesn't have to do it manually with PathForOutput. Bug: 141877526 Test: m checkbuild Change-Id: I83c5a0bd1fd6c3dba8d3b6d20d039f64f353ddd5
* | Move sharding functions for reuseColin Cross2019-09-291-13/+1
| | | | | | | | | | | | | | | | Move shardPaths and shardTests to android.ShardPaths and android.ShardStrings for reuse in other packages. Test: m checkbuild Change-Id: I868802872c73616b80f56cbf11f959c01a8b793a
* | Allow test to specify whether or not to auto-generate test configDan Shi2019-09-261-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Attribute `auto_gen_config` is added to test modules. Test config will be generated if: the attribute is not set and AndroidTest.xml doesn't exists or the attribute is set to true, whether or not AndroidTest.xml exists. Test config will NOT be auto-generated if: the attribute is not set and AndroidTest.xml exists or the attribute is set to false, whether or not AndroidTest.xml exists. Bug: 141684102 Test: build test module with auto_gen_config set to true Change-Id: I64fb003a83d8c32a967835e5f8d12fe4476043be
* | Merge "Move sysprop gen code to sysprop module"Treehugger Robot2019-09-231-4/+0
|\ \
| * | Move sysprop gen code to sysprop moduleInseob Kim2019-09-231-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sysprop_library now generates srcjar itself, effectively cutting the implicit dependency from java module to sysprop module. Bug: 131637873 Test: m {sysprop_library}-dump-api Test: m (with no arguments) performs API check Change-Id: Ia11a744e74b6f733ff0e30d194fbba22505ed644
* | | Merge "Add custom SystemModules to bootclasspath to reduce duplication"Paul Duffin2019-09-231-0/+8
|\ \ \ | |/ / |/| |
| * | Add custom SystemModules to bootclasspath to reduce duplicationPaul Duffin2019-09-201-0/+8
| |/ | | | | | | | | | | | | | | | | | | Adds a library dependency to each of the dummy system modules created by testing.go so that any changes in the behavior were detected by the existing tests which were then fixed. Bug: 141359858 Test: m checkbuild Change-Id: Id4442f4aa3931ac93049f3367b96a5b49cc075e1
* | Merge "Introduce module type 'sdk'"Treehugger Robot2019-09-231-0/+4
|\ \ | |/ |/|
| * Introduce module type 'sdk'Jiyong Park2019-09-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces a new module type named 'sdk'. It is a logical group of prebuilt modules that together provide a context (e.g. APIs) in which Mainline modules (such as APEXes) are built. A prebuilt module (e.g. java_import) can join an sdk by adding it to the sdk module as shown below: sdk { name: "mysdk#20", java_libs: ["myjavalib_mysdk_20"], } java_import { name: "myjavalib_mysdk_20", srcs: ["myjavalib-v20.jar"], sdk_member_name: "myjavalib", } sdk { name: "mysdk#21", java_libs: ["myjavalib_mysdk_21"], } java_import { name: "myjavalib_mysdk_21", srcs: ["myjavalib-v21.jar"], sdk_member_name: "myjavalib", } java_library { name: "myjavalib", srcs: ["**/*/*.java"], } An APEX can specify the SDK(s) that it wants to build with via the new 'uses_sdks' property. apex { name: "myapex", java_libs: ["libX", "libY"], uses_sdks: ["mysdk#20"], } With this, libX, libY, and their transitive dependencies are all built with the version 20 of myjavalib (the first java_import module) instead of the other one (which is for version 21) and java_library having the same name (which is for ToT). Bug: 138182343 Test: m (sdk_test.go added) Change-Id: I7e14c524a7d6a0d9f575fb20822080f39818c01e
* | Fix robolectric tests with sdk_version and prebuilt dependenciesColin Cross2019-09-181-0/+1
|/ | | | | | | | | | | Add deviceProperties to robolectric tests so they can set sdk_version. Use Dependency.BaseModuleName() instead of ctx.OtherModuleName() to get the dependency name to pass to Make to support prebuilts in libs, which may have a "prebuilt_" prefix in ctx.OtherModuleName(). Test: m RunLauncherRoboTests Change-Id: I59a889bd6107b989f336b147d0eaccabef611894
* Shard kythe invocations when javac is shardedColin Cross2019-09-051-12/+27
| | | | | | | | | | | | The kythe pipeline has trouble injesting all 6000 files of framework.jar at once. Shared invocations of the kythe extractor when javac is sharded to produce multiple smaller kzip files. Bug: 140426870 Test: no change to build.ninja Test: m out/soong/.intermediates/frameworks/base/framework/android_common/framework0.kzip Test: TestSharding in java_test.go Change-Id: I867db4ef5cb1e7f3ce8359a46aac2c00ed8a8912
* Merge changes from topic "drop_circular_dep"Treehugger Robot2019-08-301-26/+1
|\ | | | | | | | | | | | | * changes: Remove srcs_lib and srcs_lib_whitelist_pkgs Remove the automatic dependency to framework-res.apk for R/Manifest Prepare to be able to put framework-res in srcs
| * Remove srcs_lib and srcs_lib_whitelist_pkgsJiyong Park2019-08-291-17/+1
| | | | | | | | | | | | | | | | | | | | | | | | They are no longer used. Sources are provided via filegroup. Also removing the SrcDependency interface as it is no longer used. Bug: 135922046 Test: m Merged-In: I81f9614d20fbdd2f7d18340d6dbdb592e7acde06 (cherry picked from commit fa21cba64a3a14164642a7067c071f861b7ac96e) Change-Id: I81f9614d20fbdd2f7d18340d6dbdb592e7acde06
| * Remove the automatic dependency to framework-res.apk for R/ManifestJiyong Park2019-08-291-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | framework-minus-apex and framework-annotation-proc had automatic dependency to framework-res.apk to get the generated R.java and Manifest.java as their inputs. That is no longer needed as the sources are fed from framework-srcs filegroup. Bug: 70046217 Test: m Merged-In: Ibb03db01c177d6e908cbbdf91f18be8744f02c03 (cherry picked from commit 8cc55bdffe1ebb4cfcfa412d3733fd918c58db60) Change-Id: Ibb03db01c177d6e908cbbdf91f18be8744f02c03
* | Normalize and validate the java_version property.Pete Gillin2019-08-291-1/+20
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two parts to this change. Normalization: If a module specifies 'java_version: "9"', this is now normalized into 'java_version: "1.9"'. Users might reasonably assume that "9" should be valid, since javac treats them as synonyms (and, in fact, the javac documentation lists "9" as a valid value but doesn't mention "1.9"). However, the soong code that triggers JPMS support (i.e. setting -system rather than --boot-class-path) looks for the string "1.9", so prior to this change modules specifying "9" would fail with a confusing error ('javac: option --boot-class-path not allowed with target 1.9'). Normalizing "9" to "1.9" fixes this. (The change normalizes the other supported values, too, for consistency.) Validation: This change also makes the build fail-fast with a clear error message for invalid values. In particular, modules specifying "10" or "11" fail with an explicit message that this is not supported, in anticipation of the switch to OpenJDK 11. Prior to this change, modules setting those values would get the confusing '--boot-class-path not allowed' error described about since JPMS support would not be triggered. (That could be fixed by changing the JPMS logic to trigger on "10" and "11", but that would be dangerous since support in the rest of the system for v54 and v55 class files is unproven: it is better to fail explicitly.) (This change also makes it fail-fast for any unrecognized values.) Test: make java Test: make targets with java_version set to "1.8", "8", "1.9", and "9", all succeed ("9" fails without this change) Test: make targets with java_version set to "10" and "11", fail with the explicit "not supported" message Test: make target with java_version set to "xxx", fails fast with the "unrecognized" message Bug: 131683177 Change-Id: I2f5eb496c29d7736c68c01401c3f0967aeae99fc
* Implement sysprop_library API stability checkInseob Kim2019-08-231-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | sysprop_library now checks the API stability itself, cutting dependency on java_sdk_library. Under the directory {module_dir}/api, {module_name}-current.txt and {module_name}-latest.txt hold API signatures. When sysprop_library is built, or a user run "m {module_name}-check-api" command, API check is performed. First, current.txt must have exactly same signature with built sysprop_library module. Second, current.txt must be compatible with latest.txt. Build system emits a handy error message to generate/update those API files, in case of missing or mismatching. Also, a script file for freezing API files is introduced. Bug: 131637873 Test: 1) m && boot blueline Test: 2) m {sysprop_library} performs API check Test: 3) manual test for check-api, freezing api Change-Id: I9d25f5dc64299e666527ca8e23d7233966901c4e Merged-In: I9d25f5dc64299e666527ca8e23d7233966901c4e Merged-In: Ib7ad4f17e82c90da5ef3f80e2ab88c0b53112c60 (cherry picked from commit 093f0eb1331dffaab23e9252d2a4dbc6a27156f0)
* Elaborate comment on paltform_apisJeongik Cha2019-08-191-2/+3
| | | | | | Bug: 132780927 Test: None Change-Id: If0a4f97ea8f0af0c962fd963daad01adb3e5412f
* Add an output file tag for proguard dictionariesColin Cross2019-08-061-0/+2
| | | | | | | | | Allow modules to depend on the proguard dictionary of another module using module{.proguard_map}. Bug: 122332855 Test: m checkbuild Change-Id: I918b487872c1a8ef8a51c0b994277efb0512d157
* Merge "Add a rule about platform_apis"Jeongik Cha2019-07-311-3/+18
|\
| * Add a rule about platform_apisJeongik Cha2019-07-291-3/+18
| | | | | | | | | | | | | | | | | | | | | | As sdk_check.mk checks, soong starts to check every app. If sdk_version is empty, platform_apis must be true. If sdk_version is not empty, platform_apis must be false. Test: soong test Test: m Bug: 132780927 Change-Id: I7ba702d616404d155f8ac40cd008828663ad1488
* | Merge "Support source code cross-referencing for C++ and Java"Treehugger Robot2019-07-301-0/+42
|\ \ | |/ |/|
| * Support source code cross-referencing for C++ and JavaSasha Smundak2019-07-261-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use Kythe (https://kythe.io) to build cross reference for the Android source code. ~generate the input for it during the build. This is done on demand: if XREF_CORPUS environment variable is set, build emits a Ninja rule to generate Kythe input for each compilation rule. It also emits two consolidation rules (`xref_cxx` and `xref_java`), that depend on all Kythe input generation rules for C++ and Java. The value of the XREF_CORPUS environment variable is recorded in the generated files and thus passed to Kythe. For the AOSP master branch it is `android.googlesource.com/platform/superproject`, so the command to build all input for Kythe on that branch is: ``` XREF_CORPUS=android.googlesource.com/platform/superproject m xref_cxx xref_java ``` Each Kythe input generation rule generates a single file with .kzip extension. Individual .kzip files have a lot of common information, so there will be a post-build consolidation step run to combine them. The consolidated .kzip file is then passed to Kythe backend. The tools to generate .kzip files are provided by Kythe (it calls them 'extractors'). We are going to build them in toolbuilding branches (clang-tools and build-tools) and check them in as binaries into master and other PDK branches: For C++, `prebuilts/clang-tools/linux-x86/bin/cxx_extractor` for Java, `prebuilts/build-tools/common/framework/javac_extractor.jar` Bug: 121267023 Test: 1) When XREF_CORPUS is set, build generates Ninja rules to create .kzip files; 2) When XREF_CORPUS is set, building `xref_cxx`/`xref_java` creates .kzip files; 3) Unless XREF_CORPUS is set, build generates the same Ninja rules as before Change-Id: If957b35d7abc82dbfbb3665980e7c34afe7c789e
* | Revert "Revert "Split Java libraries per apex""Jiyong Park2019-07-261-2/+12
|/ | | | | | | | This reverts commit f0f7ca8335cca669dd524b39d52997c28eb59e48. Bug: 138182343 Test: apex_test added Change-Id: I5c8a0935ac0f456137c8656815e220b0e7848a5d