Commit graph

3556 commits

Author SHA1 Message Date
Treehugger Robot
8974f1706e Merge "Don't depend on nonexistent manifest when manifest_check is disabled." 2021-03-16 20:02:42 +00:00
Ulya Trafimovich
a76d6606ce Don't depend on nonexistent manifest when manifest_check is disabled.
This is a follow-up for https://android-review.googlesource.com/1614807.

Bug: 132357300
Test: lunch aosp_cf_x86_64_phone-userdebug && m
Test: lunch qemu_trusty_arm64-userdebug && \
  m out/soong/.intermediates/packages/apps/DocumentsUI/DocumentsUI/android_common/DocumentsUI-unsigned.apk
Change-Id: I84c5d171bd976f35f342abd94b592506c71e4b1d
2021-03-16 15:34:50 +00:00
Paul Duffin
dc92abb705 Fix hiddenapi tests to work without javaMockFS()
Bug: 182638834
Test: m nothing
Change-Id: I32e0173f3c2e97b6d6d831c6cfa51cc500f8d2b1
2021-03-16 14:25:21 +00:00
Paul Duffin
175947f654 Convert hiddenapi tests to use test fixtures
These tests rely on files provided by javaMockFS() so have been
converted to test fixtures to allow them to remove that dependency
which will allow javaMockFS() to be removed.

Bug: 182638834
Test: m nothing
Change-Id: Ifd4069a74fcf67e555f998ddbc4de3fde26b2aae
2021-03-16 14:25:21 +00:00
Paul Duffin
163043d615 Fix TestJavaSdkLibrary... tests to work without javaMockFS()
Bug: 182638834
Test: m nothing
Change-Id: I140b88b3fdf2c532d266a196fee84675c518d859
2021-03-16 14:25:21 +00:00
Paul Duffin
22b77cd538 Convert JavaSdkLibrary... tests in java package to test fixtures
These tests rely on files provided by javaMockFS() so need to are being
converted to test fixtures to allow them to remove that dependency
which will allow javaMockFS() to be removed.

Bug: 182638834
Test: m nothing
Change-Id: If736b95d134fe73c0a0ccd438ec31e93568fb929
2021-03-16 14:25:21 +00:00
Ulyana Trafimovich
2002bfa817 Merge "Reimplement verify_uses_libraries.sh in manifest_check.py." 2021-03-16 13:37:03 +00:00
Paul Duffin
4defbf4d39 Switch platform_compat_config to use common arch
Bug: 182816033
Test: m nothing
Change-Id: If8886edd9278d67fe2b6288a6bd8b152f2314401
2021-03-15 23:19:39 +00:00
Paul Duffin
4eb4b41cef Provide preparer for using platform_compat_config modules
Bug: 181070625
Test: m nothing
Change-Id: I92ec022fae0951a21c2e885d3ded7c98daacfcfc
2021-03-15 19:56:38 +00:00
Paul Duffin
05f72de083 Convert TestJavaSdkLibraryEnforce to test fixtures
Bug: 182638834
Test: m nothing
Change-Id: I99efe76008f9ca0996177f47923274ca594a6858
2021-03-15 17:17:43 +00:00
Paul Duffin
aa6caa7fa8 Create sub tests for each test in TestJavaSdkLibraryEnforce
Bug: 182638834
Test: m nothing
Change-Id: I509b071ee4e470da45159b2174aae7acf1b0eb1a
2021-03-15 17:17:43 +00:00
Paul Duffin
2ff6d1b6d2 Provide support for preparing tests with prebuilt_apis
Adds general support for generating a set of prebuilt apis for a set of
releases and modules. Plus some wrappers for common use cases.

This temporarily will delete any existing conflicting files and replace
them so that it can be used in tests without first removing
javaMockFS(). The future update that removes javaMockFS() will also
remove that workaround.

Bug: 182638834
Test: m nothing
Change-Id: If4e2118f2384b9866cf3f85a5afec1e2e4f9ac95
2021-03-15 17:17:40 +00:00
Paul Duffin
ba2afa93d2 Merge "Extract PrepareForTestWithJavaSdkLibraryFiles from javaMockFS()" 2021-03-15 17:14:03 +00:00
Paul Duffin
56372081ed Merge "Convert testJavaError to test fixtures" 2021-03-15 17:13:55 +00:00
Paul Duffin
6f6f1eb83c Merge "Clean up testApp and testAppConfig" 2021-03-15 17:13:45 +00:00
Ulya Trafimovich
0aba252e15 Reimplement verify_uses_libraries.sh in manifest_check.py.
Previously there were two different scripts that did similar things:
1) build/soong/scripts/manifest_check.py
2) build/make/core/verify_uses_libraries.sh

Both scripts extracted <uses-library> tags and `targetSdkVersion` from
the manifests of Java modules, but 1) worked for XML manifests, and 2)
worked for APKs. This CL reimplements the functionality from 2) in 1),
so that one script can handle both XML manifests and APKs.

Bug: 132357300

Test: lunch 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: Id1b66e4f3f30f307dba70cb111c7571762cb546a
2021-03-15 13:50:49 +00:00
satayev
2338d6f6e4 Merge "Don't track modules that are only available to APEXes." 2021-03-15 12:47:00 +00:00
Nicolas Geoffray
fb856f6add Merge "Treat core_platform as stable unless module uses legacy" 2021-03-15 08:42:43 +00:00
Remi NGUYEN VAN
aa52d66cd5 Merge "Add service-connectivity-pre-jarjar to legacy core platform list" 2021-03-15 01:32:47 +00:00
Paul Duffin
bf028b533d Extract PrepareForTestWithJavaSdkLibraryFiles from javaMockFS()
Needed for tests in both java and sdk packages.

Bug: 182638834
Test: m nothing
Change-Id: Ia8c5e7db47d8b63bf8dcf2965b3af60a4d35a9e5
2021-03-14 01:08:26 +00:00
Paul Duffin
6bac49c560 Convert testJavaError to test fixtures
Bug: 182638834
Test: m nothing
Change-Id: If6de91cd60fea36c945f2b0d51a04e26c838e4af
2021-03-14 01:08:26 +00:00
Paul Duffin
0ed42d3c9d Clean up testApp and testAppConfig
Previously, testAppConfig added some extra files to the mock filesystem
before passing them to testConfig. However, those files are only needed
for TestApp so this converts TestApp to use test fixtures and populates
the mock filesystem with the extra files.

Without those extra files testApp and testAppConfig are equivalent to
testJava and testConfig respectively.

Bug: 181070625
Test: m nothing
Change-Id: I1d8a51223adde5b656948725bc4bc91040533625
2021-03-13 16:06:36 +00:00
Paul Duffin
012b6679d3 Switch to Assert... functions in dexpreopt_bootjars_test.go
Bug: 181070625
Test: m nothing
Change-Id: I74a0be8fab257966aecffa914fcc7c1e6f750eb2
2021-03-13 16:02:30 +00:00
Paul Duffin
e84b1338c5 Migrate from result methods to function Asserts
Bug: 181070625
Test: m nothing
Change-Id: Iadb85270290acb52c55f2ad70c9f145f1c34b611
2021-03-12 22:24:51 +00:00
Jaewoong Jung
b37b009b16 Merge "Delete defaultsFactory in java.go." 2021-03-12 18:37:38 +00:00
Julien Desprez
c001dc6d2f Merge "Remove the robolectric heuristic out of java_test" 2021-03-12 15:40:19 +00:00
Paul Duffin
451aeef583 Convert testDexpreoptBoot to use test fixtures
Bug: 181070625
Test: m nothing
Change-Id: Iaca15c87c68383630aed015e0e17adad3c37c4b1
2021-03-12 09:02:13 +00:00
Paul Duffin
32a8aadfaa Merge "Add prebuilt_boot_image and add boot_images to sdk" 2021-03-12 08:06:45 +00:00
Paul Duffin
c7cdd1513c Merge "Improve name of getModuleHeaderJarsAsNormalizedPaths" 2021-03-12 07:59:39 +00:00
Julien Desprez
3f4e7a10a6 Remove the robolectric heuristic out of java_test
Test: presubmit
Bug: 180736967
Change-Id: I65193d1639088149d8c2f1d5b7d4311e9f69a609
2021-03-12 03:41:21 +00:00
Treehugger Robot
d13e31a8cc Merge changes I0ad54aa7,I1d6d20ec
* changes:
  Propagate LANG environment variable to lint in RBE
  Default lint RBE to local exec strategy
2021-03-12 01:11:49 +00:00
Artur Satayev
533b98cde3 Don't track modules that are only available to APEXes.
Modules that are not available for platform are developed with
updatability in mind, and do not require manual approvals.

Bug: 181223240
Test: checkbuild
Change-Id: I10b91053b3ef5a9ff5400d9d7a68fae3144a671c
2021-03-11 18:13:18 +00:00
Paul Duffin
4e99ef761a Improve name of getModuleHeaderJarsAsNormalizedPaths
Bug: 182402568
Test: m nothing
Change-Id: I93bfe10f0ac62bf018cfee6738fa080d9404b1cb
2021-03-11 15:53:25 +00:00
Paul Duffin
fc9c218e83 Merge "Ensure java_system_modules_import uses prebuilts" 2021-03-11 15:50:58 +00:00
Paul Duffin
a2fcd19aef Merge "Improve system modules tests" 2021-03-11 15:50:34 +00:00
Paul Duffin
6f688d03c8 Merge "Convert system modules tests to use fixtures" 2021-03-11 15:11:20 +00:00
Paul Duffin
8075291a94 Merge "Separate system modules tests into their own file" 2021-03-11 15:10:54 +00:00
Paul Duffin
f18ff339a9 Merge "prebuilt_apis should create a java_system_modules_import" 2021-03-11 15:09:47 +00:00
Jaewoong Jung
48b8df14be Merge "Populate baseline_file values." 2021-03-11 15:04:52 +00:00
Paul Duffin
4f0a75abde Ensure java_system_modules_import uses prebuilts
Make sure that java_system_modules_import always depends on the
prebuilt by adding dependencies in the ComponentDepsMutator() method
which is called before prebuilts without a corresponding source are
renamed from prebuilt_<x> to <x>. That requires the prebuilt_ prefix
to be provided but it ensures that the dependencies are safe.

Similar logic also makes sure java_system_modules always depends on
the source module and not on a renamed prebuilt module.

Bug: 182402568
Test: m nothing
Change-Id: I30db95978f5d9b205951011edf40585ee36c0c4c
2021-03-11 09:40:02 +00:00
Paul Duffin
c52bea9555 Improve system modules tests
The previous approach of looking for substrings in the command that
matched the base name of the jar could not differentiate between
whether the jar was a prebuilt or a source as they both have the same
base name.

The tests also did not cover the case when there was both prebuilts
and source modules.

This change:
1. Checks that the inputs to the command come from the appropriate
   module.
2. Adds a mixed test.
3. Deduped the source and prebuilt module definitions.

The new test reveals the buggy behavior which will be fixed in a follow
up change.

Bug: 182402568
Test: m nothing
Change-Id: I384ecca097cbe3560e7589c23fb99c176a42fd9b
2021-03-11 09:39:18 +00:00
Paul Duffin
f23e346f6c Convert system modules tests to use fixtures
Bug: 182402568
Test: m nothing
Change-Id: I0535e60a692925b141e465d8e1ec92be21d54c88
2021-03-11 08:32:01 +00:00
Paul Duffin
db284be913 Separate system modules tests into their own file
java_test.go is getting too big.

Bug: 182402568
Test: m nothing
Change-Id: I9c3818f1d747a230fcb66687319a3a14d557a57c
2021-03-11 08:21:49 +00:00
Paul Duffin
d6c2a65211 prebuilt_apis should create a java_system_modules_import
Previously it was creating a java_system_modules which worked fine
because apart from the prebuilt nature the two are functionally
identical. However a follow up change will differentiate between them
which would break this code.

Bug: 182402568
Test: m nothing
Change-Id: Ifc13ce31235494e338d730c61a99d8887c5a2c5b
2021-03-11 08:01:19 +00:00
Paul Duffin
f7f65dafb4 Add prebuilt_boot_image and add boot_images to sdk
Bug: 177892522
Test: m nothing
Change-Id: I640359acd6840507f32d7034c97d4d1c7ff591e9
2021-03-11 07:24:26 +00:00
Colin Cross
9c78cb83d0 Propagate LANG environment variable to lint in RBE
Without LANG, lint's text output is ASCII instead of UTF-8, causing
differences between local and remote execution.

Bug: 181681346
Bug: 182415460
Test: m USE_RBE=true RBE_LINT=true
Change-Id: I0ad54aa731582c9b54abb80f50ba508c75992b91
2021-03-10 18:03:05 -08:00
Colin Cross
9b93af488b Default lint RBE to local exec strategy
Match other tools by defaulting to local exec strategy.

Also use the local absolute path when using the local exec strategy.

Bug: 181681346
Test: m USE_RBE=true RBE_LINT=true
Test: m USE_RBE=true RBE_LINT=true RBE_LINT_EXEC_STRATEGY=remote
Change-Id: I1d6d20ec69663b99d6d9af1d8e5e67b48a5cd050
2021-03-10 18:03:05 -08:00
Jaewoong Jung
6df5e0307d Merge "Lineage properties support module references." 2021-03-11 00:59:32 +00:00
Colin Cross
42e49979f2 Merge "Add comment to lintPaths" 2021-03-10 22:55:03 +00:00
Paul Duffin
29e98e5ede Merge "Support test fixtures in java package" 2021-03-10 22:27:00 +00:00