Commit Graph

3582 Commits

Author SHA1 Message Date
Paul Duffin c3f89bece1 Merge "Clean up java package use of python build components" 2021-03-18 17:02:44 +00:00
Paul Duffin d5065cfc66 Merge "Add prebuilt_platform_compat_config" 2021-03-18 12:28:00 +00:00
Paul Duffin 533cf74318 Merge "Separate metadata provider from apex contents provider" 2021-03-18 08:46:49 +00:00
Paul Duffin 93b61b49dd Merge "Add emptyFixtureFactory in java package" 2021-03-18 08:40:03 +00:00
Paul Duffin 177cba31cf Merge "Reorganize the platform_compat_config.go file" 2021-03-18 08:39:39 +00:00
Paul Duffin e26e597fc8 Merge "Fix app tests to work without javaMockFS()" 2021-03-18 08:00:29 +00:00
Paul Duffin 9e993c6162 Merge "Convert app tests that depend on javaMockFS() to test fixtures" 2021-03-18 07:59:54 +00:00
Paul Duffin 8a6fef4db3 Merge "Convert TestUsesLibraries to test fixtures" 2021-03-18 07:59:04 +00:00
Paul Duffin 220ddd7a6b Clean up java package use of python build components
Bug: 182885307
Test: m nothing
Change-Id: I206ebc075c568a09008ec8b63122922dd87ba318
2021-03-17 23:56:58 +00:00
Paul Duffin 1b29e003f3 Add prebuilt_platform_compat_config
It just provides the metadata needed by the global singleton as the
rest is in the apex.

Bug: 182402754
Test: m nothing
Change-Id: I511df7a3a06dab13ddb9ad63392ae5310dfee9c4
2021-03-17 18:16:31 +00:00
Paul Duffin 29072a9c1e Separate metadata provider from apex contents provider
The platform_compat_config_singleton only needs access to the metadata
so this separates that method into its own interface, distinct from the
one needed by the apex. This also adds a test to ensure that the merging
still works.

Bug: 182402754
Test: m nothing
Change-Id: I5212239786810e5fc5eb99831b1122db93d1329f
2021-03-17 18:16:28 +00:00
Paul Duffin afeee22c17 Add emptyFixtureFactory in java package
Bug: 182402754
Test: m nothing
Change-Id: I6a01b846a8aee5a0ace9e6ac056ee439bf6f12f7
2021-03-17 17:50:22 +00:00
Paul Duffin 961543309f Reorganize the platform_compat_config.go file
The types and methods are separated and interleaved with each other
so this moves them so that they are together.

Bug: 182402754
Test: m nothing
Change-Id: I275f6af30491d2440499b9ee3f201eea227d23f8
2021-03-17 17:50:22 +00:00
Colin Cross 45a4971808 Merge changes from topic "rule_builder_rsp"
* changes:
  Remove unescaped spans support from RuleBuilder
  Add explicit rspfile argument to RuleBuilderCommand.FlagWithRspFileInputList
  Ninja escape RuleBuilder rule params
2021-03-17 15:14:19 +00:00
Paul Duffin 2645a2912f Fix app tests to work without javaMockFS()
Bug: 182638834
Test: m nothing
Change-Id: Ia1815557e6d9dba1cb24f824a988c7599263bf85
2021-03-17 14:01:02 +00:00
Paul Duffin cdb88a996a Convert app tests that depend on javaMockFS() to test fixtures
Bug: 182638834
Test: m nothing
Change-Id: Ice668cf58695839d4929a0744822c0ded441d9c4
2021-03-17 14:01:02 +00:00
Paul Duffin d234b418a5 Convert TestUsesLibraries to test fixtures
This test relies on files provided by javaMockFS() so has been
converted to test fixtures to allow it to remove that dependency which
will allow javaMockFS() to be removed.

Bug: 182638834
Test: m nothing
Change-Id: I77b0205c91ff94b1c3c9ca00d4711451e3671571
2021-03-17 14:01:02 +00:00
Treehugger Robot 797b03eec9 Merge "Run InitAndroidArchModule last in factory functions." 2021-03-17 11:07:13 +00:00
Yuexi Ma b96a04ba49 Merge "Export a few utility methods" 2021-03-17 01:40:51 +00:00
Martin Stjernholm b79c7f1101 Run InitAndroidArchModule last in factory functions.
It calls InitAndroidModule which retrieves the properties, so all
AddProperties must go before it.

Test: `m nothing` with new ART prebuilt drop that has a
  prebuilt_boot_image module.
Bug: 177892522
Change-Id: Ia09db9ef17148d36d8d4f25df3f1bf4f528a2fc8
2021-03-17 00:31:15 +00:00
Colin Cross 70c4741215 Add explicit rspfile argument to RuleBuilderCommand.FlagWithRspFileInputList
Using $out.rsp as the rsp file adds extra complexity around keeping
the $ unescaped.  Make callers to FlagWithRspFileInputList provide
an explicit path for the rsp file instead.

Bug: 182612695
Test: rule_builder_test.go
Change-Id: I3f531d80c1efa8a9d09aac0a63790c5b11a9f0c6
2021-03-16 16:52:56 -07:00
Christian Wailes 7d1f1cf27c Merge "Add test suite to legacy core platform allowlist." 2021-03-16 23:02:39 +00:00
Yuexi Ma 627263fece Export a few utility methods
Add a few utility methods to support generating TradeFed test plan in C-Suite

Test: go test .
Change-Id: I86a505068b5d5aa0f5a37b3e3a2465839a7480ef
2021-03-16 15:57:59 -07:00
Jaewoong Jung 9f315dea28 Merge "Improve java.go readability." 2021-03-16 21:32:48 +00:00
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
Jaewoong Jung bc15e3a798 Improve java.go readability.
Test: TreeHugger
Change-Id: I98bb7bddb740451ff2ccd28dcdaddff27e35a8cd
2021-03-15 13:58:44 -07: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
Chris Wailes 4bf7f0db22 Add test suite to legacy core platform allowlist.
Test: atest DexManagerTests
Bug: 174783329
Merged-In: Ife2be3cbc15f06ae382c08c2d6a5c5962feb0caf
Change-Id: Ife2be3cbc15f06ae382c08c2d6a5c5962feb0caf
2021-03-12 14:57:26 -08: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