aboutsummaryrefslogtreecommitdiff
path: root/java/java.go
Commit message (Collapse)AuthorAgeFilesLines
...
| * Adding experimental option to target Java 11Sorin Basca2021-12-071-0/+6
| | | | | | | | | | | | | | Bug: 195387073 Test: m Test: EXPERIMENTAL_TARGET_JAVA_VERSION_11=true m Change-Id: Ifd7ce6218a2761a8eaf79af7d91210da2fa581aa
* | Merge changes Ieb9aef29,I6985ebb6Artur Satayev2021-12-021-0/+1
|\ \ | |/ |/| | | | | | | * changes: Propagate min and max sdk versions to classpaths.proto configs. Introduce max_sdk_version device property.
| * Introduce max_sdk_version device property.satayev2021-12-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | Artifacts that go into apexes should only be active on certain SDK versions. There is now a need to upper bound the range to support expressiong statements like "this jar should only run on platforms 30-31". Bug: 190818041 Test: presubmit Change-Id: I6985ebb671841cdd9f0f37f916267ac5ed76e4f4
* | Adding configuration support for Java 11Sorin Basca2021-11-261-2/+7
|/ | | | | | Bug: 195387073 Test: m Change-Id: Ibf26f35b83b300acacae800f9962a00916869412
* Add dependency from hostdex installed module to Make intermediatesColin Cross2021-11-101-1/+2
| | | | | | | | | | | The art tests rely on a dependency existing from out/host/linux-x86/framework/core-oj-hostdex.jar to out/host/common/obj/JAVA_LIBRARIES/core-oj-hostdex_intermediates/classes.jar, override LOCAL_SOONG_INSTALLED_MODULE for the hostdex modules so that soong_java_prebuilt.mk adds the dependency. Test: art/tools/buildbot-build.sh --host && art/tools/run-libcore-tests.sh '--mode=host' '--variant=X64' --debug Change-Id: I9412147fc66d5e5f0dae52d522868a37251f781e
* Move java module installation into SoongColin Cross2021-11-051-0/+16
| | | | | | | | | | | Move java module installation rules into Soong by overriding InstallBypassMake. Update the locations that find host java tools to look in the Make installation directory instead of the Soong installation directory, which will no longer be used. Bug: 204136549 Test: m checkbuild Change-Id: I5af6d764c97e7ddb5ee121fc9830166c25d831b1
* Fix ctx.InstallFile calls for java modulesColin Cross2021-11-051-4/+27
| | | | | | | | | | | | | | | Call ctx.InstallFile on the primary install file last so that the primary install file can depend on the extra install files, and so that the primary install file can be inferred from the last installed file. Add missing ctx.InstallFile calls for the dexpreopt and hostdex outputs. Fix the install subdirectory for modules installing to the testcases directory. Bug: 204136549 Test: m checkbuild Change-Id: I7edd7647be27439d3ca0ecc589ca5e89d4ba8474
* Dedup use of "prebuilt_"Paul Duffin2021-10-261-3/+0
| | | | | | Bug: 177893770 Test: m nothing Change-Id: I664ee4d9c3aafda3de0a3f8985ee23f25db38680
* Merge "Extract the logic of setting Uncompress_dex to a common place."Jiakai Zhang2021-10-151-15/+14
|\
| * Extract the logic of setting Uncompress_dex to a common place.Jiakai Zhang2021-10-111-15/+14
| | | | | | | | | | | | Bug: 194150908 Test: m nothing Change-Id: Ia33965067586cfd48183e6d17f5d17626eef3c5a
* | Add android_sdk_repo_host to build platform-tools&build-toolsDan Willemsen2021-10-131-8/+0
|/ | | | | | | | | | | | | | The Android SDK has been built with Make up until now, monolithically, then split up into several sdk-repo zip files for different purposes. The Mac and Windows SDKs really only need to contain the platform-tools and build-tools pieces, but due to this monolithic sdk zip, we had to build the whole SDK first. This adds an `android_sdk_repo_host` module that can build these platform-tools and build-tools zips. Bug: 187222815 Change-Id: I55809e1d7447dd65e22461f921b2b8abb6d5f822
* Merge "Preopt APEX system server jars for java_import."Treehugger Robot2021-10-021-1/+10
|\
| * Preopt APEX system server jars for java_import.Jiakai Zhang2021-09-301-1/+10
| | | | | | | | | | | | | | | | Similar to aosp/1821985, but for java_import. Bug: 194150908 Test: See the next CL. Change-Id: Ied1cfb1a7e1c2eea502b74b0d6e2344bcd02155e
* | Merge changes from topics "bp-bionic-cts-tests", "cts-per-testcase-directory"Colin Cross2021-10-011-0/+6
|\ \ | | | | | | | | | | | | | | | | | | * changes: Add data_bins property Support per-testcase directories in all test suites Add environment variables to cc_genrule commands
| * | Support per-testcase directories in all test suitesColin Cross2021-09-271-0/+6
| |/ | | | | | | | | | | | | | | | | | | | | There are cases where two modules try to install the same test data into CTS, which results in collisions when CTS puts the data for all tests in the same directory. Add a flag that allows enabling a per-testcase directory for an individual test for all test suites. Bug: 193168159 Test: cts-tradefed run commandAndExit CtsBionicTestCases Change-Id: If034723e8fe937ca71d3e2d39b7d46702e41bc8c
* / Add a new SDK member type java_systemserver_libs.Jiakai Zhang2021-09-301-0/+32
|/ | | | | | | | | | | | Similar to java_boot_libs, java_systemserver_libs only provide access to their dex implementation jar for use by dexpreopting and do not provide an actual implementation jar. This is used in the subsequent CL. Bug: 194150908 Test: m nothing Change-Id: Ib2e7d5e6c002314a0231f46934a766f4a27e610a
* Merge "Remove updatable-bcp-packages.txt."Jiakai Zhang2021-09-261-1/+0
|\
| * Remove updatable-bcp-packages.txt.Jiakai Zhang2021-09-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Historically, this file was used by the `--updatable-bcp-packages-file` flag for dex2oat. The flag is no longer needed and is being deprecated. Unfortunately, we cannot remove `permitted_packages` and all the code related to it because we still need it for checking the module compatibility with Q and R. Bug: 200241946 Test: m nothing Change-Id: Ie3be54fd47a847ba0caf627d12da76b415d99466
* | Consolidate the code to resolve a deapexer module dependency.Martin Stjernholm2021-09-231-16/+5
| | | | | | | | | | | | | | | | | | | | | | It will get more logic in upcoming CLs. Add a property to DeapexerInfo for the APEX name, for use in error messages. Test: m nothing Bug: 192006406 Change-Id: I957f3df8b34543a38cde38768dac93e78132d672
* | Propagate the dex jar path as an OptionalPath which is either valid orMartin Stjernholm2021-09-231-11/+12
|/ | | | | | | | | | | | | | | | | | | | | | invalid with a message. This will allow propagating any error from the deapexer module for prebuilt APEXes to the location where the dex jars get used. It's only at those points that we can raise errors about not being able to extract files from the deapexer modules if they are invalid, and this way we avoid encoding knowledge there about why they may be invalid. To keep the refactoring limited it intentionally does not change any of the existing logic for when dexJarFiles are set or not (non-nil vs nil prior to this change), although there may be opportunity to use this for more conditions when dex jars aren't available. The refactoring is also not extended to dexpreopt.ClassLoaderContextMap. Test: m nothing Bug: 192006406 Change-Id: I68986dccd9a9b3fee4d24caa1947ea17a36caedc
* Merge "Add java_binary_host support for Windows"Dan Willemsen2021-09-221-3/+24
|\
| * Add java_binary_host support for WindowsDan Willemsen2021-09-201-3/+24
| | | | | | | | | | | | | | | | | | | | So that the Windows build-tools package doesn't need to manually copy the wrapper. Also fixes enabling java modules for Windows by hiding them from Make, as the Make code does not handle Windows java modules properly. Bug: 187222815 Change-Id: I13534b38b9a9f4b5ff0630e028c3b4f88a6b34f8
* | Merge "Enable compose kotlinc plugin when depending on the compose runtime"Aurimas Liutikas2021-09-201-0/+2
|\ \ | |/ |/|
| * Enable compose kotlinc plugin when depending on the compose runtimeColin Cross2021-09-201-0/+2
| | | | | | | | | | | | | | | | | | When a module depends on the compose runtime add a -Xplugin argument to the kotlinc flags that enables the compose compiler plugin. Bug: 196351110 Test: TestKotlinCompose Change-Id: I423a3c4d12df42804a24b672a40a165bc8dd165f
* | Revert^2 "Preopt APEX system server jars."Jiakai Zhang2021-09-161-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 92346c483249726164f4bd140413d60391121763. Reason for revert: Fixed build error. The build error is fixed by ag/15841934. This CL remains unchanged. This CL will be submitted AFTER ag/15841934 is submitted. Bug: 200024131 Test: 1. Patch this CL and ag/15841934 into internal master. 2. sudo vendor/google/build/build_test.bash Change-Id: I5f2b8357846fc7dda56e25ebe6ffb095e8047ec8
* | Revert "Preopt APEX system server jars."Adrian Roos2021-09-151-8/+5
| | | | | | | | | | | | | | | | | | This reverts commit ca9bc98e0cfe9a519cfdd13450a68f1ed7ad5b02. Reason for revert: breaks build Bug: 200024131 Change-Id: Ide07b4c4d267370ae31107b1598b2f878c701282
* | Preopt APEX system server jars.Jiakai Zhang2021-09-151-5/+8
|/ | | | | | | | | | | | | | | The path to the artifacts will in the form of /system/framework/oat/<arch>/<encoded-jar-path>@classes.{odex,vdex,art}, where <encoded-jar-path> is the path to the jar file with "/" replaced by "@". For example, /system/framework/oat/x86_64/apex@com.android.art@javalib@service-art.jar@classes.odex There will be a follow-up CL to update ART runtime to recognize artifacts in that path. Test: m com.android.art Bug: 194150908 Change-Id: Ic89fd63c4b1cd565684cead83fc91dae3bc97a4c
* Refactor SdkMemberType.AddDependencies()Paul Duffin2021-08-311-4/+4
| | | | | | | | | | | Replaces the BottomUpMutatorContext parameter with a new SdkDependencyContext type that extends BottomUpMutatorContext. This is to allow the sdk to pass additional information to the implementations of that method to allow the behavior to be more finely tuned. Bug: 195754365 Test: m nothing Change-Id: I69c6d2c523934eb67d7a7e6c55c241e9b8a81773
* Don't add `uses_libs`/`optional_uses_libs` to the manifest_fixer.Ulya Trafimovich2021-08-201-11/+17
| | | | | | | | | | | | | | | | These properties specify libraries that cannot be implicitly inferred by Soong. If these properties are added to Android.bp, this can only be for the reason that there is a <uses-library> tag in the manifest which is unknown to the build system. Adding them to the manifest_fixer doesn't make sense: if they are not in the manifest, they should be removed from Android.bp as well. Bug: 132357300 Test: $ lunch aosp_cf_x86_64_phone-userdebug && m && launch_cvd $ adb wait-for-device && adb root && adb logcat \ | grep -E 'ClassLoaderContext [a-z ]+ mismatch' # empty grep output, no errors Change-Id: Ic6eb5268a954ef3be7f06a181ec72af99000c547
* Propagate <uses-library> dependencies from `java_library` to apps.Ulya Trafimovich2021-08-181-1/+2
| | | | | | | | | | | | | | | | | Automatically add `uses_libs`/`optional_uses_libs` properties specified in `java_library` modules to the apps that transitively depend on these libraries. Note that a library may choose to specify its <uses-library> deps as either optional or required. If this is not the right choice for an app, it should be able to override it by specifying its own `uses_libs`/ `optional_uses_libs` properties. Add Soong tests to cover the new cases. Bug: 196377222 Test: lunch aosp_cf_x86_64_phone-userdebug && m Change-Id: I601f3e2830ed9699b78d911966ee70812d32b4f6
* Fix the way manifest fixer detects optional <uses-library> entries.Ulya Trafimovich2021-08-131-8/+13
| | | | | | | | | | | | | | | | | | | Previously manifest_fixer used a naive way to distiniguish optional libs from required ones: it checked if a library is on the list of optional compatibility libraries. This works for compatibility libs, but not for other libs. Now we properly track optionality through all stages of the build, starting with the addition of the library as a dependency (here's where the `uses_libs`/`optional_uses_libs` distinction kicks in), store it in dependency tag and propagate to class loader context, and from there to the manifest_fixer. The tests have been updated accordingly. Bug: 196377222 Test: lunch bertha_x86_64-userdebug && m droid dist cts mts Change-Id: I3631ce59ebe47116ce7a9b3d33a86f636846ef0f
* Rename UpdatableBootJars to ApexBootJars.satayev2021-07-221-1/+1
| | | | | | | | | | | Note that ART apex boot jars and core-icu4j are exceptions here as they are not part of ApexBootJars. ART apex boot jars are defined in their own variable, while core-icu4j is treated as a regular non-updatable boot jar. Bug: 191127295 Test: atest CtsClasspathsTestCases Change-Id: I3cea3d82ef521655a1a5ffa8cae2258ab9d08bfc
* Merge "Revert "Export implementation class jars for java_boot_libs""Treehugger Robot2021-07-191-5/+13
|\
| * Revert "Export implementation class jars for java_boot_libs"Paul Duffin2021-07-161-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 22ff0aaf51bdd9409eafe74151decb58f47308bc. The workaround to support hidden API generation with prebuilts by passing the full implementation jars through to the SDK snapshot is no longer needed as the monolithic hidden API flag generation uses the prebuilt flag files that are already part of the snapshot. This change reverts that previous workaround. Bug: 192868581 Test: - Update the prebuilts DIST_DIR=$PWD/dist TARGET_BUILD_VARIANT=userdebug art/build/build-art-module.sh --skip-apex packages/modules/ArtPrebuilt/update-art-module-prebuilts.py --local-dist=dist --skip-cls --skip-apex - Build hidden API flags to make sure it does not fail Change-Id: Idb3fde6f7dcb171677316d8794a4af91ede1f7e0
* | Merge "Don't attempt to add stub libraries to class loader context."Ulyana Trafimovich2021-07-161-20/+17
|\ \ | |/ |/|
| * Don't attempt to add stub libraries to class loader context.Ulya Trafimovich2021-07-161-20/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A Java module may depend on a stub library. In that case an additional dependency on the implementation library is created, and it is used to add the implementation library to class loader context. We should not attempt to add the stubs library as well (previously the attempt to add it happend after the implemention was added to CLC, to the attempt was unsuccessful). Raise an error if someone tries to add the same library with different build/instal paths. Also, rename local variable `implicitSdkLib` to `sdkLib` to better reflect its meaning. Bug: 193425964 Test: $ lunch aosp_cf_x86_64_phone-userdebug && m && launch_cvd $ adb wait-for-device && \ adb root && \ adb logcat | \ grep -E 'ClassLoaderContext [a-z ]+ mismatch' -C1 # empty output, no errors Change-Id: I01c1bdd23f9d118d891d0b806e7e3b4d78896a34
* | Build updatable-bcp-packages.txt from prebuilts in sdk snapshotPaul Duffin2021-07-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | Previously, the java_import and java_sdk_library_import modules did not make their permitted_packages available to the rule that generates the updatable-bcp-packages.txt file. This change corrects that. Bug: 193763688 Test: m nothing - Added unit tests, which all failed and then fixed the tests. Change-Id: If0706e4551a331b48d383123088e63924dded48b
* | Propagate permitted packages to sdk snapshotPaul Duffin2021-07-151-0/+14
|/ | | | | | | | | | Previously, permitted_packages were not copied to the sdk snapshot. This change corrects that. Bug: 193763688 Test: m nothing - Added unit tests, which all failed and then fixed the tests. Change-Id: I4560987f746f78c0ae706058195b6db4bea438aa
* Merge "Drop `strings.HasPrefix` when guarding `strings.TrimPrefix`."Ulyana Trafimovich2021-07-151-6/+1
|\
| * Drop `strings.HasPrefix` when guarding `strings.TrimPrefix`.Ulya Trafimovich2021-07-151-6/+1
| | | | | | | | | | | | | | | | | | There is no need to check as `TrimPrefix` does nothing if the prefix doesn't match (see https://pkg.go.dev/strings#TrimPrefix). Bug: 193425964 Test: m nothing Change-Id: Ieb82e72a471800e29eb6bb54308041a9ab4173e5
* | SdkLibraryImport's DexJarInstallPath uses installPath from source moduleJeongik Cha2021-07-131-2/+5
|/ | | | | | | | | | | | | | | | | | | | Even though actual installed module path is the same as source module, it uses impl's one. Bug: 188179858 Bug: 193082464 Test: compare dexpreopt_config.zip files from 1. TARGET_BUILD_UNBUNDLED_IMAGE=true m dexpreopt_config_zip 2. m dexpreopt_config_zip (note that m clean should run between steps) Test: build aosp_cf_x86_64_phone, launch_cvd, and then adb wait-for-device \ && adb root \ && adb logcat \ | grep -E 'ClassLoaderContext [a-z ]+ mismatch' -C 1 and then check if there is no message. Change-Id: I34ffd9a2d214a6614c2befc35b2beec003cfcd25
* Merge "fix: comparison between min_sdk_version"Jooyung Han2021-06-231-6/+2
|\
| * fix: comparison between min_sdk_versionJooyung Han2021-06-231-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | Added test demonstrates the error case. The bug was that java modules' ShouldSupportSdkVersion() converts min_sdk_version into effective version before comparison, which discards "preview" version into "future" version. That caused a weird case like rejecting with error "should support "S"" even when it is set to "S". Bug: n/a Test: m nothing Change-Id: Ieb53f0097b2969a8535778b1286dbfa0d4895ad4
* | Add commonSdkLibraryAndImportModule interfacePaul Duffin2021-06-231-2/+2
|/ | | | | | | | | The commonSdkLibraryAndImportModule defines the methods that a module which embeds the commonToSdkLibraryAndImport struct need to provide. Bug: 179354495 Test: m nothing Change-Id: I7a469ae03ea5c19922200284da08a9ae38a46751
* Simplify deapexer supportPaul Duffin2021-06-171-7/+12
| | | | | | | | | | Uses the apex relative path to the file as the identifier that is used to obtain the path to the corresponding file extracted from the apex. That is instead of a special constructed string id. Bug: 177892522 Test: m nothing Change-Id: I5dc77c8fb272bac289b8891d1eac801e541af1f5
* Remove javalib special case in createDeapexerModuleIfNeededPaul Duffin2021-06-171-0/+18
| | | | | | | | | | Removes the special case in createDeapexerModuleIfNeeded for handling java libraries and just get the Import and SdkLibraryImport module types to implement RequiredFilesFromPrebuiltApex instead. Bug: 177892522 Test: m nothing Change-Id: I5cc341b5b4168b8eb196f72273a00d498de6856f
* Don't fail if the target module is disabled in dex2oat toolMartin Stjernholm2021-05-181-0/+4
| | | | | | | | | | | | | | | | | | | dependencies. dexpreopt.RegisterToolDeps runs late after prebuilt dependencies have been resolved, and there's special code in dex2oatPathFromDep to resolve the prebuilt from the source module. However, if the source module is disabled then the dependencies check in validateAndroidModule will complain, so we need to disable that check in this particular situation. Also add a comment to explain why dexpreopt.RegisterToolDeps needs to run so late. Test: m nothing Bug: 145934348 Bug: 172480615 Change-Id: Ibc673303d0336768fa23261a2068e91a08f46a30
* Make uncompressDex available for use through hiddenAPIModulePaul Duffin2021-05-171-3/+3
| | | | | | | | | | | | In order for the bootclasspath_fragment to perform dex encoding on its contents it needs to know whether the dex file is uncompressed or not. This change makes that information available by passing it to initHiddenAPI, storing it in hiddenAPI struct and providing access through the hiddenAPIModule. Bug: 179354495 Test: m droid Change-Id: I913416b4836766de194203fd8ed5124b61dfa3dd
* Merge initHiddenAPI and hiddenAPIUpdatePathsPaul Duffin2021-05-171-9/+5
| | | | | | | | | These two methods did very similar jobs and merging them together simplifies the behavior. Bug: 179354495 Test: m droid Change-Id: Ibe1a23d54105e6a0e5693079cd8743679301fc85
* Remove configurationName from java library and hidden APIPaul Duffin2021-05-171-5/+3
| | | | | | | | | | | | | | | | | | | | | The configurationName was intended to separate the name of the module from the name used in configuration (such as BootJars) so that the child implementation library of a java_sdk_library on the bootclasspath would have hidden API encoding performed on it just as for the main java_library embedded within the java_sdk_library. While that did use to work it no longer does as the test added in the preceding change proves. It is not surprising that this regression does not appear to have caused any issues as the the child implementation library is only a build time artifact and not used at runtime. In future the only modules that will require hidden API encoding are those that are part of a bootclasspath module so there is no point in maintaining this capability. Bug: 179354495 Test: m droid Change-Id: Ief8136fa9e98600cdd8d36108ec22edc2ebd7c69