aboutsummaryrefslogtreecommitdiff
path: root/java/java_test.go
Commit message (Collapse)AuthorAgeFilesLines
...
* | Link type checking for java_libraryJeongik Cha2019-12-071-0/+88
|/ | | | | | | | | | | | | Link type checking for java_library has not been working unintentionally. So turn on link type checking for these types. And also add tests for link type checking. Bug: 145799020 Test: cherry-pick aosp/1182522 and check if build fails Test: m nothing and there is no error(soong unittest) Change-Id: Ifc347f657885de1028ac0076ddd103c0387b597a
* Add exported_plugins to java.Library.Artur Satayev2019-11-261-0/+83
| | | | | | | | 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
* Make TestContext.RegisterModuleType take an android.ModuleFactoryColin Cross2019-11-251-37/+37
| | | | | | | | Avoid having to pass ModuleFactoryAdaptor to every call to RegisterModuleType in a test by wrapping RegisterModuleType. Test: all soong tests Change-Id: If8847d16487de0479cc3020b728256922b3cadba
* Adds droidstubs support to sdk modulePaul Duffin2019-11-221-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | Adds stubs_sources property to sdk and unzips the droidstubs srcjar into the snapshot directory. Adds an UnzipToSnapshot method to the SnapshotBuilder which creates a rule that uses zip2zip to repackage the supplied zip content into a temporary zip file that matches what the required snapshot structure. e.g. if the supplied zip contains foo/Foo.java and that needs to be in the snapshot directory java/foo/stubs then it will create a zip that contains java/foo/stubs/foo/Foo.java. The temporary zip that is the output of that rule is added to the zipsToMerge field for merging later. If the zipsToMerge is empty then the snapshot zip is created as before. Otherwise, a temporary zip file is created. That is then merged with the other zip files in zipsToMerge to create the final snapshot zip. Adds prebuilt_stubs_sources for use by the generated .bp module. Bug: 143678475 Test: added conscrypt sdk module and attempted to build it Change-Id: Ie274263af3a08e36a73c61c0dbf0c341fd6967e2
* Add override_android_test.Jaewoong Jung2019-11-151-0/+1
| | | | | | | | | | This change also adds instrumentation_target_package to android_test, so that the target package name in a test manifest can be easily overridden. Fixes: 134624457 Test: app_test.go Change-Id: Ib8dd703da0038ac76210c92d79e133e37c718122
* Rearrange import orderJeongik Cha2019-11-111-2/+2
| | | | | | Bug: 132780927 Test: m Change-Id: I4b2c40bb0fb3dd5ff31f65811a6fef28e946f028
* Enforce hidden apis usage in product(soong)Jeongik Cha2019-11-061-15/+36
| | | | | | | | | | | | | | 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
* Move TestConfig sdk versions forwardColin Cross2019-10-281-3/+3
| | | | | | | | | The SDK version in TestConfig is very old, move it forward to trigger the newer javaVersion code paths. Bug: 142896162 Test: all Soong tests Change-Id: Iaf2a6f6dfef43b006b0a09f193fbc2d2e103d90d
* Refactor and strengthen sdk_test.go.Pete Gillin2019-10-211-24/+44
| | | | | | | | | | | | | | | | | | | This change: - Removes usage of the EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9=false option from tests, since it is going to be removed. The java_version property is used instead. - Commons up some of the assertions between the tests for language levels 8 and 9 in sdk_test.go. - In commoning the code up, some additional assertions are made in the language level 9 cases, strengthening the tests. Test: m nothing Bug: 115604102 Change-Id: I693c5d299b5592b851c44dde4434d92a931f15cd
* Enable Java language level 9 by default.Pete Gillin2019-10-161-6/+6
| | | | | | | | | | | | | | | | | | | | This changes the default Java language level from 8 to 9, i.e. javac invocations now use -source 1.9 -target 1.9. The environment variable EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9=false is added to switch back to the language level 8 behaviour. (Previously, setting that variable to true was required to opt in to language level 9.) Test: make droid java tests cts docs Test: javap -v <some class file in output> | grep 'major version' (reports 53, for classes from 'benchmarks' which is in Android.bp and 'ahat' which is in Android.mk) Test: make RunBluetoothRoboTests RunCarSettingsLibRoboTests (two main flavours of robolectric) Test: make cts && cts-tradefed help Test: atest CtsLibcoreTestCases (reasonably low-level device tests) Test: atest CtsHostTzDataTests (arbitrary host test) Bug: 115604102 Change-Id: I9de888e1df021244d5e61c40934178676f09ecc7 Merged-In: I52be1817fa7121fca3bce3d8857cb9ed0825570c
* Shard aidl compiles into srcjarsColin Cross2019-10-041-8/+12
| | | | | | | | | Group aidl files into groups of 50 and compile them together into a srcjar. Bug: 124333557 Test: m checkbuild Change-Id: I18e0858eab434071d3ff0039bb21e07c7311b601
* Merge changes Ife12ba69,Ibf910262Jaewoong Jung2019-08-281-0/+3
|\ | | | | | | | | | | am: 7ca5576905 Change-Id: I4e486be727b3be79afac66644cc3e9967e43bd45
| * Implement android_test_importJaewoong Jung2019-08-281-0/+3
| | | | | | | | | | | | Test: app_test.go, prebuilt CTS tests Fixes: 132371143 Change-Id: Ife12ba691dfa597dde90faf0957224a6f444e139
* | Merge "Add arch variant support to android_app_import."Jaewoong Jung2019-08-161-0/+2
|\| | | | | | | | | | | am: a701d9071e Change-Id: I7e20e0a6f4f0adaec0897fee3a371adcf78106d3
| * Add arch variant support to android_app_import.Jaewoong Jung2019-08-151-0/+2
| | | | | | | | | | | | | | Bug: 128610294 Fixes: 138792623 Test: app_test.go Change-Id: I47c80ec283ce58a0ce9b7d0af40844bd73e9d3f1
* | Merge "Add a rule about platform_apis"Jeongik Cha2019-07-301-0/+23
|\| | | | | | | | | | | am: 8a64f8c907 Change-Id: Ifdd8bd693fee625f63db403ce7a4dbc9209eb398
| * Add a rule about platform_apisJeongik Cha2019-07-291-0/+23
| | | | | | | | | | | | | | | | | | | | | | 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 changes Ic2a585ea,I11ccabc4,Icc932c4a,I020556c7,I08713e91Colin Cross2019-07-221-5/+0
|\| | | | | | | | | | | am: ed9a92c311 Change-Id: I0367335939181566063b777184e864a7afb02308
| * Merge changes Ic2a585ea,I11ccabc4,Icc932c4a,I020556c7,I08713e91Treehugger Robot2019-07-221-5/+0
| |\ | | | | | | | | | | | | | | | | | | | | | | | | * changes: Fix date on mac builds Convert javadoc modules to android.RuleBuilder Convert droiddoc modules to android.RuleBuilder Add a systemModules utility type Convert droidstubs to android.RuleBuilder
| | * Convert droiddoc modules to android.RuleBuilderColin Cross2019-07-181-5/+0
| | | | | | | | | | | | | | | | | | | | | Test: m docs Test: m checkapi Test: m updateapi Change-Id: Icc932c4a9a3fc642c96ab9cbd8df3229b5ab86d3
* | | filegroup.path is used to specify the include path for aidl filesJiyong Park2019-07-191-2/+15
|\| | | | | | | | | | | | | | | | | am: 2907459e43 Change-Id: Ibf604d664111401d4bcca20db20c754c6845f05a
| * | filegroup.path is used to specify the include path for aidl filesJiyong Park2019-07-191-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | filegroup { name: "foo", srcs: ["srcs/aidl/com/android/**/*.aidl"], path: "srcs/aidl", } cc_library { // or java_library, etc. name: "bar", srcs: [":foo"], } automatically adds "-Ipath/to/foo/srcs/aidl" when compiling the aidl files from foo for bar. This allows us to omit aidl include path when using sources in other places via file group. Bug: 135922046 Test: m (unit tests added) Change-Id: I9b42f316f2858fb6da72c2f58a314f391416e809
* | | Merge "Java test code clean-up"Jaewoong Jung2019-07-181-23/+22
|\| | | | | | | | | | | | | | | | | am: 66bb414fb7 Change-Id: I69304bb2b589b5c415a5eb57cadc0833fd1be02e
| * | Java test code clean-upJaewoong Jung2019-07-171-23/+22
| |/ | | | | | | | | | | | | Remove unused parameters and make testJava return the config. Test: Ran all java tests. Change-Id: Iaa123f3fd93188e2f55452b887e1d340429cc710
* | Merge "Enforce hidden api usage in vendor (soong)" am: e65d84c84cJeongik Cha2019-06-301-0/+26
|\| | | | | | | | | | | am: 7a22534a47 Change-Id: Iffbacc0f98fb208e6f71919bcefa19cb0e57efca
| * Merge "Enforce hidden api usage in vendor (soong)"Treehugger Robot2019-07-011-0/+26
| |\
| | * Enforce hidden api usage in vendor (soong)Jeongik Cha2019-06-281-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From aosp/588578, if vendor app doesn't fill sdk_version, build scirpt overwrites system_current to sdk_version. But there is no similar enforcement in soong. So, as make does, sdkVersion() returns "system_current" if it is device-specific or soc-specific module. and sdk_version is not filled. Test: pass soong test Bug: 132780927 Change-Id: I69bb3d7bfcf7c27c2db4d0efbe046f9c7879b4bc
* | | Optionally embed NOTICE files in apks. am: 5b425e2e20Jaewoong Jung2019-06-251-0/+4
|\| | | | | | | | | | | | | | | | | am: 5d48965fed Change-Id: I533808f0eafb496c34ece9d100784ebb9b5257e6
| * | Optionally embed NOTICE files in apks.Jaewoong Jung2019-06-241-0/+4
| |/ | | | | | | | | | | | | | | | | | | | | If embed_notices or ALWAYS_EMBED_NOTICES is set, collect NOTICE files from all dependencies of the android_app, merge them with the app's own one (if exists), transform it to HTML, gzip it, and put it as an asset in the final APK output. Bug: 135460391 Test: app_test.go Change-Id: I52d92e2fd19b3f5f396100424665c5cc344190d8
* | Merge changes I42cb181f,I6413c9b1 am: 33ee25466fPaul Duffin2019-06-171-1/+1
|\| | | | | | | | | | | am: 00c2bbb0e7 Change-Id: Icca90608b256e726a9a1bd79e9cedca1a6b53f84
| * Remove the no_standard_libs propertyPaul Duffin2019-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Corrects an error message that refers to no_standard_libs. Removes any tests that use no_standard_libs:true where possible as there are duplicate tests for sdk_version:"none". Otherwise, switches them over to use sdk_version:"none". The androidmk mapping from LOCAL_NO_STANDARD_LIBRARIES to no_standard_libs has also been removed. There was little point in updating the tool to map it through to sdk_version:"none" as there are only a couple of places where it is used, in art's test running mk targets and in some unbundled packages to work around some limitation in .mk based build. Bug: 134566750 Test: m droid Change-Id: I6413c9b1fe3e63b93753a6a017d2981e32b7e013
* | Merge "Add sdk_version:"none" to replace no_standard_libs:true" am: b11c72b0b8Paul Duffin2019-06-141-0/+13
|\| | | | | | | | | | | am: e34bbae1ca Change-Id: I9465a810dad7f3ea95b6c883844358d817f8cc8e
| * Add sdk_version:"none" to replace no_standard_libs:truePaul Duffin2019-06-131-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Where possible this duplicates any tests that use no_standard_libs:true with ones that use sdk_version:"none". If not possible (e.g. in the default targets included in java/testing.go) it switches some to use sdk_version:"none" to ensure that there is no regression in the behavior of no_standard_libs:true. Follow up changes will switch all usages of no_standard_libs:true over to use sdk_version:"none" at which point no_standard_libs will be removed. Bug: 134566750 Test: m droid Change-Id: I5f0fd3daa980f6b223abe454cba7f25a97a39d7a
* | Merge "Allow java_test.go tests to use any Android.bp file" am: 45656aacabPaul Duffin2019-06-131-1/+1
|\| | | | | | | | | | | am: e6cb60da57 Change-Id: I0fedcef906e6e59e004115d421df1a152348a02c
| * Allow java_test.go tests to use any Android.bp filePaul Duffin2019-06-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Previously, the tests had to use the Android.bp file in the root directory of the mock file system. That prevented adding tests that are dependent on the location of the Android.bp file, e.g. ones that use no_standard_libs. This change will process any Android.bp in the mock filesystem. Bug: 134566750 Test: m Change-Id: I6fb057a473a18e87bd1a89507e78ceb3fd171eb5
* | Merge "android_app stl property bug fix" am: 4f67c42d76Jaewoong Jung2019-06-051-0/+3
|\| | | | | | | | | | | am: 58d0f0cf69 Change-Id: Ic14f463f27b8413e0d4960658c41407763d79ba6
| * android_app stl property bug fixJaewoong Jung2019-06-041-0/+3
| | | | | | | | | | | | | | | | | | When it is set to c++_shared, the added dependency should be libc++_shared, not libc++. Fixes: 130891985 Test: app_test.go, atest 'CtsNdkBinderTestCases' w/ conversion CL Change-Id: I0e50e0d5bf511aa6e52d16cd715a185721011255
* | Merge "Port uses-shared library verification and dexpreopting to Soong" am: ↵Colin Cross2019-05-301-0/+2
|\| | | | | | | | | | | | | | | 7a1fefc2de am: 38ec6cfbf4 Change-Id: Ib9bbb720605f418d242aba98df9d9904671c29e4
| * Port uses-shared library verification and dexpreopting to SoongColin Cross2019-05-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ports 09f3b97f4b488cd3a7b7d72038b173575b02c162 (Add support for preopt with uses-libraries) from Make to Soong to support verifying and preopting shared libraries. This reapplies Id25f55f07a55120bebe2a9b32c094209efc85c8b with fixes for unbundled builds and builds with ALLOW_MISSING_DEPENDENCIES=true set. Bug: 132357300 Test: app_test.go Test: m checkbuild Change-Id: I964309a68ec4ed081f3f3154879c71048ecb5455
* | Merge "Revert "Port uses-shared library verification and dexpreopting to ↵Colin Cross2019-05-291-2/+0
|\| | | | | | | | | | | | | | | Soong"" am: 7d06395f0c am: cc50c0c4de Change-Id: I4e12ee0f7d2dbb293e492c55f2eae66dc9638266
| * Revert "Port uses-shared library verification and dexpreopting to Soong"Colin Cross2019-05-291-2/+0
| | | | | | | | | | | | | | | | This reverts commit b66d7b1c20f7e54a5920780ba6643e971d216d31. Reason for revert: broke unbundled builds Change-Id: I96ae287885107079de4a26e6b100ad8ed66961c0
* | Merge changes from topic "verify_uses_libraries" am: 2f4c55e9f7Colin Cross2019-05-291-0/+2
|\| | | | | | | | | | | am: 3c8e809052 Change-Id: I9bd1e0d745c605b3617576f9a6044527421fbfe4
| * Port uses-shared library verification and dexpreopting to SoongColin Cross2019-05-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | Ports 09f3b97f4b488cd3a7b7d72038b173575b02c162 (Add support for preopt with uses-libraries) from Make to Soong to support verifying and preopting shared libraries. Bug: 132357300 Test: app_test.go Test: m checkbuild Change-Id: Id25f55f07a55120bebe2a9b32c094209efc85c8b
* | Merge "Fix override_android_app dependency issues." am: 105920a792Jaewoong Jung2019-05-161-1/+1
|\| | | | | | | | | | | am: ac5ee3559f Change-Id: Ie6447241cc069f507d053e10d78ba540d9cc84f9
| * Fix override_android_app dependency issues.Jaewoong Jung2019-05-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | This change fixes an issue where an android_test could not depened on an override_android_app or an android_app overridden by one by moving all override processing to post-deps and forwarding incoming dependencies on override_android_apps to base android_app modules Fixes: 132447700 Test: app_test.go Change-Id: I4ac593be661f541f5ea9823ef97373bee4b186f9
* | Merge "Rename EXPERIMENTAL_USE_OPENJDK9 to ↵Pete Gillin2019-05-101-5/+5
|\| | | | | | | | | | | | | | | EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9." am: 42e862c56d am: 350f0987bf Change-Id: Ibfc75aa4c4356d86cf7ce80becff0cf92cf98e14
| * Merge "Rename EXPERIMENTAL_USE_OPENJDK9 to EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9."Pete Gillin2019-05-101-5/+5
| |\
| | * Rename EXPERIMENTAL_USE_OPENJDK9 to EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9.Pete Gillin2019-05-091-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current EXPERIMENTAL_USE_OPENJDK9 environment variable is a legacy from when the 8 -> 9 toolchain upgrade was happening. That migration is done and the variable only affects the language level, so it should have a name that reflects that. (The current situation would be especially confusing if we started a 9 -> 11 toolchain upgrade, presumably controlled by a variable like EXPERIMENTAL_USE_OPENJDK11, since the two settings look incompatible but are actually orthogonal.) The current variable historically allowed a value or "1.8" which meant "use the OpenJDK 9 toolchain but target language level 8". That value no longer has any meaning and the new variable doesn't allow it. Bug: 131678633 Test: `make` with `EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9=true` Test: `javap -v $OUT_DIR/soong/.intermediates/libcore/core-oj/android_common/javac/classes/java/util/List.class | grep 'major version'` shows 53 Test: Audit all mentions of the old string here and downstream Change-Id: Idad808c7f07913baba1a777627322d5452dabcef
* | | Merge "Implement DPI variants in android_app_import." am: 53ad63c127Jaewoong Jung2019-05-081-1/+3
|\| | | | | | | | | | | | | | | | | am: a64eb7eada Change-Id: Idcfca3ed5cbeb4955958d007ef701939cd3f26ae
| * | Merge "Implement DPI variants in android_app_import."Jaewoong Jung2019-05-081-1/+3
| |\ \