Commit Graph

4330 Commits

Author SHA1 Message Date
Colin Cross
2207f87756 Split droidstubs out of droiddoc.go
Split part of droiddoc.go into droidstubs.go.  Also split droiddoc_test.go
and droidstubs_test.go out of java_test.go.

Test: go test ./java
Change-Id: Iea742e75b6925b135016f7bbf3a168c696a6c433
2021-03-25 11:11:34 -07:00
Paul Duffin
f329307878 Merge "Filter duplicate modules in platform_compat_config_singleton" 2021-03-25 18:09:38 +00:00
Colin Cross
7ee54ffd70 Replace ANDROID_SDK_HOME with ANDROID_PREFS_ROOT for metalava
Fixes warnings:
Warning: Using ANDROID_SDK_HOME for the location of the '.android' preferences location is deprecated, please use ANDROID_PREFS_ROOT instead.
Support for ANDROID_SDK_HOME is deprecated and will be removed in 6.0

Test: m android_stubs_current
Change-Id: Ie8721dcda0578c670dfc796675ba43cda16883f6
2021-03-25 11:06:45 -07:00
Colin Cross
5bedfa2d45 Simplify lint rules using improved RuleBuilder rsp support
With the improved RuleBuilder rsp support a manual resources.list
file is not necessary, use FlagWithRspFileInputList instead.

The switch to RBE support in RuleBuilder in
Iab4e09d961891ef182643583d4d456e413bc5e39 obsoleted tracking remoteInputs
and remoteRSPInputs, remove them.

writeLintProjectXML was written to allow it to be applied to a separate
rule than the one that ran lint, but it is not used that way.  Using
the same rule for both means that manual tracking of the input
dependencies described by the project.xml rule but read by the lint
rule is not necessary, just treat them as inputs to the single rule.

Test: m lint-check
Test: m USE_RBE=true RBE_LINT=true RBE_LINT_EXEC_STRATEGY=remote lint-check
Change-Id: If1827b9dede3ebcd0792b6b4b8114d3199f6570b
2021-03-25 11:06:45 -07:00
Colin Cross
ce3a51dc96 Support multiple rsp files in RuleBuilder
The lint rule is manually creating a second rsp file because Ninja
only supports on per rule.  Move the support into RuleBuilder so
that it can apply the same rewrites that it does to the primary
one.

Test: TestRuleBuilder_Build
Change-Id: Iec250a2d60e74ccf1b4ad085a960fec6867ea559
2021-03-25 11:06:45 -07:00
Colin Cross
a4eafddc41 Support multiple rsp files in REParams
rewrapper supports a comma separate list of rsp files, replace
REParams.RSPFile with REParmas.RSPFiles.

Test: remoteexec_test.go
Change-Id: I7850c071c23d368d6fad4480dd527d146c13c6d3
2021-03-25 11:06:45 -07:00
Paul Duffin
6c968b1f0f Merge "Fix TestDroiddoc's reliance on absolute paths" 2021-03-25 18:02:26 +00:00
Roland Levillain
737ad608ab Merge "Fix a typo in the definition of varApexNames in java/dexpreopt_bootjars.go." 2021-03-25 17:25:44 +00:00
Paul Duffin
4dd6cdb3bc Fix TestDroiddoc's reliance on absolute paths
TestDroiddoc compares the value returned by OutputFiles(""), which will
usually be absolute paths including the temporary buildDir, against
paths returned from TestingBuildParam.RelativeToTop(), which does not
currently change the Path contents and so will include absolute
temporary paths. However, a follow up change to this will make the
TestingBuildParam.RelativeToTop() also change the Path contents at
which point this test would be comparing relative to absolute paths.

So, this change makes sure that they are all converted to relative to
top paths before comparison.

Bug: 183650682
Test: m droid
Change-Id: Ia4478f527af27a920945f5849525e5031cc5b8b6
2021-03-25 13:14:37 +00:00
Paul Duffin
bb9ff5108b Filter duplicate modules in platform_compat_config_singleton
Previously, unpacking a snapshot containing a
prebuilt_platform_compat_config into a source build would cause build
failure because of duplicate ids because the singleton would collate
ids from both prebuilts (versioned and unversioned) and source.

This change filters out versioned prebuilts and only uses prebuilts
that are preferred and source modules that have not been replaced by a
prebuilt.

Bug: 182402754
Test: m nothing
Change-Id: Idacbb34444e5156370df70bf88c6e8a7e2d67890
2021-03-25 12:53:25 +00:00
Ulyana Trafimovich
a7836fa341 Merge "Allow using updatable boot jars in dexpreopt (but don't use them yet)." am: 2258cbbe42 am: 29dae7ed73
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647188

Change-Id: I1849bcde5949b3d19a996bc01837469518c6cba7
2021-03-25 11:29:43 +00:00
Ulyana Trafimovich
2258cbbe42 Merge "Allow using updatable boot jars in dexpreopt (but don't use them yet)." 2021-03-25 10:13:45 +00:00
Paul Duffin
cd3cc29952 Merge "Convert test that disallows non existent paths to use fixtures" am: e742ee14f8 am: 4a08263f48
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647169

Change-Id: I7d91d68f6402e087a1f7693373fe101e979907a2
2021-03-25 10:03:03 +00:00
Paul Duffin
6a8ac75e6a Merge "Cleanup usages of Dex2oatDepTag" am: 958408d921 am: 15204cf1ea
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652452

Change-Id: Iea09f5217e72ff0a1051f455adee3bfff1ebe889
2021-03-24 23:10:25 +00:00
Paul Duffin
76e5c8a37f Convert test that disallows non existent paths to use fixtures
This change needed to add some additional files to the registered
files for PrepareForTestWithJavaDefaultModules because otherwise they
would fail when "TestAllowNonExistentPaths = false". Those files were
being added by the TestJavaLintRequiresCustomLintFileToExist (albeit in
some cases in different locations to that required by the default
modules but as the files are needed by the modules defined in
PrepareForTestWithJavaDefaultModules they should be defined in it.

A couple of other places also provided some files so moving them into
PrepareForTestWithJavaDefaultModules caused some conflicts which needed
to be resolved.

Bug: 183184375
Test: m nothing
Change-Id: I76ce9f1673c1c1c4000635b76b8377d582224bf1
2021-03-24 22:08:05 +00:00
Paul Duffin
958408d921 Merge "Cleanup usages of Dex2oatDepTag" 2021-03-24 22:04:58 +00:00
Nicolas Geoffray
938db1752c Merge "Fix "filename too long" issue on Luci caused by test name" am: ed35a90d2c am: 1176680a1e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652453

Change-Id: Icfaf4342d2236a45c69db7ab26ff62b72f73d40e
2021-03-24 21:55:13 +00:00
Paul Duffin
a35178b105 Fix "filename too long" issue on Luci caused by test name
Stop including fields in the test name for TestJavaSdkLibraryEnforce to
reduce its length to avoid the filename too long limit.

Test: m nothing
      Check the lengths before (~240) and after (~74) to make sure
      there was a sizeable reduction.
Change-Id: I275a1110e5102b8ea8376759f28c7c6333a5efee
2021-03-24 15:09:37 +00:00
Paul Duffin
14ef1b2928 Merge changes I94f66e3e,I233a4fe1,Idbb37485 am: a1063c09f6 am: 842bbe246a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1651209

Change-Id: I8a4ab1c605742ab62a6f871b378c96d2d2febaa9
2021-03-24 15:02:36 +00:00
Paul Duffin
b506c9dc11 Cleanup usages of Dex2oatDepTag
Creates a new deptag type for it so that it can implement the marker
interfaces that will exclude it from being added to the APEX and from
visibility enforcement. The latter is probably not an issue ATM because
the dependencies are added after visibility checks are enforced but
this code is undergoing lots of refactoring so that may change.

Bug: 177892522
Test: m nothing
Change-Id: Ibd167d557adec761a2e3eed78f4d334c40a04fb9
2021-03-24 14:34:40 +00:00
Roland Levillain
d603c7dbae Fix a typo in the definition of varApexNames in java/dexpreopt_bootjars.go.
Change-Id: If1267cf18dcd307316cce8d2cac7c6f5c173f3d4
Test: `m nothing` in internal tree
Bug: 180325915
2021-03-24 14:24:04 +00:00
Paul Duffin
a1063c09f6 Merge changes I94f66e3e,I233a4fe1,Idbb37485
* changes:
  Group all the preparations needed for testing dexpreopt
  Separate methods used for fixture based and legacy tests
  Use more inclusive language in dexpreopt/testing.go
2021-03-24 13:41:56 +00:00
Ulyana Trafimovich
eea78d54fc Merge "Split functions for compiling boot jars to allow future code reuse." am: 8ef5b4f95f am: a90c28ccce
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1648368

Change-Id: Ic8677e9a98645440bfaca2a0ce7ada819a73b079
2021-03-24 11:50:56 +00:00
Ulya Trafimovich
9023b02c00 Allow using updatable boot jars in dexpreopt (but don't use them yet).
This CL handles updatable boot jars in the same hacky way as we handle
non-updatable boot jars: it creates a set of predefined paths to the dex
jars in a global config, then traverses all modules in a singleton
context, finds updatable boot jars and adds copy rules from these jars
to the predefined paths. A proper way would be to register dependencies
of the dexpreopted modules on the boot jars and extracting paths to dex
files by walking these dependencies.

Bug: 178467404
Test: lunch aosp_cf_x86_64_phone-userdebug && m
Test: added new Soong test
Change-Id: I87f764109315f79315d73bf43799b70eb010fc0b
2021-03-24 11:16:11 +00:00
Ulyana Trafimovich
8ef5b4f95f Merge "Split functions for compiling boot jars to allow future code reuse." 2021-03-24 10:48:51 +00:00
Paul Duffin
91d532241f Merge "Remove javaFixtureFactory" am: b6535d329f am: 1c496b075d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1649805

Change-Id: I0e1527fb0a46de68af78621ead4d819fa1e22e87
2021-03-24 08:53:37 +00:00
Paul Duffin
f40055f794 Merge "Remove unused test methods and buildDir" am: 9d33cf237a am: b87810c575
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1649804

Change-Id: Ibfd37931c9dfe217f3165f02085e579d1ad5deec
2021-03-24 08:53:29 +00:00
Paul Duffin
ced05d6327 Merge "Remove uses of buildDir from java/rro_test.go" am: 38e73fcfc0 am: 541e2124bf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1649803

Change-Id: I24a33795db144f676ac9810fd5003e1fef109326
2021-03-24 08:53:21 +00:00
Paul Duffin
a4d25c3350 Merge "Remove uses of buildDir from java/kotlin_test.go" am: 5916fe6856 am: 2d074dd87d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1649802

Change-Id: I458512183e0c4dbe77212b55805539194350cc5f
2021-03-24 08:53:11 +00:00
Paul Duffin
0053a19238 Merge "Remove uses of buildDir from java/java_test.go and java/sdk_test.go" am: 369c3aae53 am: 372c1fc7f4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1649801

Change-Id: Icf83624c876f69517fcdb2d4166a5f294a27b0b6
2021-03-24 08:53:02 +00:00
Paul Duffin
1cf0f03fac Merge "Remove uses of buildDir from java/app_test.go" am: 700185b1f8 am: 306639beac
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1649800

Change-Id: Ie950744c2f4cbc3c3aaa62ad8ebccacd1a069c78
2021-03-24 08:52:53 +00:00
Paul Duffin
7f76b4acbd Merge "Remove uses of buildDir from java/app_set_test.go" am: 86da0448c6 am: 84e6aaa26c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1649799

Change-Id: I0594d5584a24393bb46581eb8687054f1bd6773b
2021-03-24 08:52:44 +00:00
Paul Duffin
de9cbc5d2e Merge "Remove uses of buildDir from java/app_import_test.go" am: 6567d07f59 am: c9d8035712
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1649798

Change-Id: Ia01eb0d840fad738684107da378a48edc7d6780f
2021-03-24 08:52:35 +00:00
Paul Duffin
656096fa43 Merge "Remove uses of buildDir in java/androidmk_test.go" am: 6f59e6a568 am: 1a5e03e155
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1649797

Change-Id: I9a1f2065e2fd1c346c882ed1dacc062cb157c99c
2021-03-24 08:52:26 +00:00
Paul Duffin
8c0829717b Merge "Remove uses of buildDir in java/hiddenapi_singleton_test.go" am: eed60863d0 am: 5054e0dc9e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1649796

Change-Id: I24fac8fba16e54a21eefface0449cd87420577f2
2021-03-24 08:52:18 +00:00
Paul Duffin
ec4fbf21fa Merge "Remove uses of buildDir from java/dexpreopt_bootjars_test.go" am: 1b095e5177 am: cf0f595e90
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1649795

Change-Id: I297585f390acbeb8fd3e630161f37f44fa6a31aa
2021-03-24 08:52:09 +00:00
Paul Duffin
8da7bc4a85 Merge "Register java_plugin in PrepareForTestWithJavaBuildComponents" am: 5863c2ae65 am: 9c976257f7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1649794

Change-Id: Ic10b1169c3d2411f7c5608d078e90febba99f1e4
2021-03-24 08:52:00 +00:00
Paul Duffin
9fc9f53423 Group all the preparations needed for testing dexpreopt
Make it easier to test dexpreopt functionality by grouping all the
fixture preparations together.

Bug: 177892522
Test: m nothing
Change-Id: I94f66e3ec82efc4fd791f4fdab678d298565e452
2021-03-24 08:30:27 +00:00
Paul Duffin
3c84eaaa98 Separate methods used for fixture based and legacy tests
The fixture mechanism makes it easy to refactor by splitting up an
existing preparer into separate ones and then combining them back
together. Unfortunately, that becomes slightly more tricky when
preparers and legacy tests use the same functions to register build
components and define default modules.

This change splits the RegisterRequiredBuildComponentsForTest and
GatherRequiredDepsForTest methods into two methods each, with the
existing method used for legacy tests and calling the new method that
is used for the preparer.

At the moment all the functionality is in the new methods but over
time, as functionality is extracted into separate preparers, the
functionality can also be moved from the method that is common to both
legacy and fixture based tests into the legacy only method.

Bug: 177892522
Test: m nothing
Change-Id: I233a4fe1fb072a00292acc2bb20821ec82a9bd67
2021-03-24 08:27:04 +00:00
Paul Duffin
71ae59412b Remove javaFixtureFactory
Replaces uses of javaFixtureFactory with prepareForJavaTest and removes
the unused javaFixtureFactory.

Bug: 182885307
Test: m nothing
Change-Id: I809772d14af2af211b9e15ad676fbdc06b07cd46
2021-03-24 01:07:12 +00:00
Paul Duffin
d6339af0b6 Remove unused test methods and buildDir
Bug: 182885307
Test: m nothing
Change-Id: I251145a82479428a82f19cbde6b415d149acd619
2021-03-24 01:07:12 +00:00
Paul Duffin
0342dc9c35 Remove uses of buildDir from java/rro_test.go
Remove any uses, either direct (or indirect via testJavaConfig or
similar methods), of the package level buildDir variable from this
file.

Bug: 182885307
Test: m nothing
Change-Id: Id0e5710f1f121aec9c5f744a7bc7df82d95484f6
2021-03-24 01:07:12 +00:00
Paul Duffin
b148a49319 Remove uses of buildDir from java/kotlin_test.go
Remove any uses, either direct (or indirect via testJavaConfig or
similar methods), of the package level buildDir variable from this
file.

Bug: 182885307
Test: m nothing
Change-Id: Id1d449d55fe992ebc3d7bad38a76bb1652844f52
2021-03-24 01:07:12 +00:00
Paul Duffin
414ea5eb73 Remove uses of buildDir from java/java_test.go and java/sdk_test.go
Remove any uses, either direct (or indirect via testJavaConfig or
similar methods), of the package level buildDir variable from this
file.

Bug: 182885307
Test: m nothing
Change-Id: I4d9dc39d3b1e5c37ba1f9e72da94048949c0fd17
2021-03-24 01:07:12 +00:00
Paul Duffin
fb0fe9f5cb Remove uses of buildDir from java/app_test.go
Remove any uses, either direct (or indirect via testJavaConfig or
similar methods), of the package level buildDir variable from this
file.

Bug: 182885307
Test: m nothing
Change-Id: Ia8f835a8250934ef328cad02b272e6b94b13c459
2021-03-24 01:07:02 +00:00
Paul Duffin
f71e4ed326 Remove uses of buildDir from java/app_set_test.go
Remove any uses, either direct (or indirect via testJavaConfig or
similar methods), of the package level buildDir variable from this
file.

Bug: 182885307
Test: m nothing
Change-Id: I64b13dcb310e0a0a2049b5e3b0ea0115e7e9c2f5
2021-03-24 00:01:15 +00:00
Paul Duffin
fb8bc95199 Remove uses of buildDir from java/app_import_test.go
Remove any uses, either direct (or indirect via testJavaConfig or
similar methods), of the package level buildDir variable from this
file.

Bug: 182885307
Test: m nothing
Change-Id: I700a3cafaa427243212aab1eb903d1871327483c
2021-03-24 00:01:15 +00:00
Paul Duffin
f04311cbc1 Remove uses of buildDir in java/androidmk_test.go
Remove any uses, either direct (or indirect via testJavaConfig or
similar methods), of the package level buildDir variable from this
file.

Bug: 182885307
Test: m nothing
Change-Id: Ibb9520d1500fcef9a4348570926a07b5bb54bf8c
2021-03-24 00:01:15 +00:00
Paul Duffin
2f9e71e5ad Remove uses of buildDir in java/hiddenapi_singleton_test.go
Remove any uses, either direct (or indirect via testJavaConfig or
similar methods), of the package level buildDir variable from this
file.

Bug: 182885307
Test: m nothing
Change-Id: I664465808cd4edf1fef611c07ae05a32683dc976
2021-03-24 00:01:15 +00:00
Paul Duffin
67d485e9d4 Remove uses of buildDir from java/dexpreopt_bootjars_test.go
Remove any uses, either direct (or indirect via testJavaConfig or
similar methods), of the package level buildDir variable from this
file.

Bug: 182885307
Test: m nothing
Change-Id: I852dbb5ad2e1aa58df103679c5e9de14cf64abc3
2021-03-24 00:01:15 +00:00