Commit graph

3705 commits

Author SHA1 Message Date
Paul Duffin
6a766453fd Export monolithic hidden API files from platform_bootclasspath
Makes the monolithic hidden API files accessible from the
platform_bootclasspath so they can be output to the dist build target
and used by other modules, e.g. by doing something like this:
  java_resources: [
    ":platform-bootclasspath{hiddenapi-flags.csv}",
  ],

It makes the paths relative to the out/soong/hiddenapi directory rather
than the out/soong directory to make them easier to use in the
java_resources property without changing the structure of the APK.
Without that attempting to use them in a java_resources property will
result in them being copied to a hiddenapi/ within the APK instead of
being used at the top level as existing APKs like
CtsHiddenApiBlocklistTestApiTestCases expect.

Bug: 177892522
Test: m nothing
Change-Id: I829412fc7d25411e0c2e0713d0d219a18f4af2ee
2021-04-13 00:23:55 +01:00
Paul Duffin
702210b804 Move generation of global hidden API flags to platform_bootclasspath
This change moves the generation of the global hidden API flags from
the singleton to the platform_bootclasspath module. It involves:
1. Moving the ruleToGenerateHiddenApiFlags to hiddenapi_modular.go.
2. Adding HiddenAPIAugmentationProperties to be used by the
   platform_bootclasspath type.
3. Moving the file paths into the platform-bootclasspath module
   definition in frameworks/base/boot/Android.bp.

The flagsRule is kept as a placeholder for now. The emptyFlagsRule is
also kept so that builds continue to work even when the frameworks/base
repository is not present.

Bug: 177892522
Test: verified that the out/soong/hiddenapi/... files are unchanged
      by this change
Change-Id: Idf4dd414a016831bfe04a01f93234c1c33819881
2021-04-12 11:04:24 +01:00
Paul Duffin
c6bb7cf8d7 Extract ruleToGenerateHiddenApiFlags
Extracts the code for creating the rule that creates the monolithic
hidden API flags file which is encoded into dex implementation jars.
This refactoring is in preparation for moving the functionality from
the hiddenapi_singleton into the platform_bootclasspath.

A follow up change will move the method into the new
hiddenapi_modular.go alongside the hiddenAPIAugmentationInfo as they
will both be used to perform hidden API processing for a
bootclasspath_fragment.

Bug: 177892522
Test: verified that the out/soong/hiddenapi/... files are unchanged
      by this change
Change-Id: I2729afa80cdfd2d1d4717365001648453d65632f
2021-04-12 11:04:09 +01:00
Paul Duffin
62d8c3b110 Allow platform_bootclasspath to specify contributing fragments
Adds the fragments property to the platform_bootclasspath to allow the
fragments that contribute to it to be specified.

Bug: 177892522
Test: m nothing
Change-Id: I14f83d9336f6984442c7315cc86dfdd0a0fd2d20
2021-04-08 18:53:04 +01:00
Paul Duffin
b432df9cda Add dependencies from platform_bootclasspath to contents
Adds a FinalDeps mutator to add dependencies from the
platform_bootclasspath to the configured boot jars which can be from
either the platform or any apex. It adds dependencies for every
configured boot jar, whether in ArtApexJars, BootJars or
UpdatableBootJars.

At the moment the dependencies are only used for testing purposes
but following changes will make more use of them.

Bug: 177892522
Test: m nothing
Change-Id: I981305bf45bc20539a3d36987252f490e2b885cc
2021-04-08 18:53:04 +01:00
Anton Hansson
f247ff73ae Merge "Fix bug in sdk_library string matching" 2021-04-08 09:28:41 +00:00
Paul Duffin
5bdc83c20a Merge "Update build to new location of hiddenapi config files" 2021-04-07 15:52:06 +00:00
Anton Hansson
08f476bf83 Fix bug in sdk_library string matching
- The public stubs were being matched against the string ".stubs.public"
  which was never the suffix that these stubs used
- Remove obsolete naming pattern matching

Test: m
Change-Id: I1f7bd54e4629f42e34fb3c09828d8853813ba2a7
2021-04-07 15:39:58 +01:00
Paul Duffin
4896da1444 Merge "Remove hidden API special handling of android.test.base" 2021-04-07 12:27:16 +00:00
Pedro Loureiro
9537d594ce Merge "Update soong for new lint version" 2021-04-07 09:30:06 +00:00
Paul Duffin
b5933f64e4 Remove hidden API special handling of android.test.base
The android.test.base module should never be on the bootclasspath.

Bug: 184331423
Test: m droid
Change-Id: Ibb963b4ce2d915d0205fb1b5a7ca9159a5c99b3f
2021-04-07 10:06:31 +01:00
Paul Duffin
de21202bd2 Merge changes I45274836,I47268b81
* changes:
  Add PrebuiltNameFromSource
  Add IsModulePreferred
2021-04-07 09:04:18 +00:00
Treehugger Robot
27d220662f Merge "Make lint HTML output deterministic" 2021-04-06 23:14:10 +00:00
Paul Duffin
864116ce3f Add PrebuiltNameFromSource
Bug: 177892522
Test: m nothing
Change-Id: I45274836d59adbd6b2a2a848705b189398f1e766
2021-04-06 21:20:58 +01:00
Paul Duffin
e1d3837645 Add IsModulePreferred
Bug: 177892522
Test: m nothing
Change-Id: I47268b81359d6fceb60e899a730b3b6034e09814
2021-04-06 21:18:34 +01:00
Treehugger Robot
4238c5fe07 Merge "Set the usesNonSdk manifest attribute whan targeting module SDKs." 2021-04-06 18:25:12 +00:00
Pedro Loureiro
70acc3dc0c Update soong for new lint version
Test: m nothing
Change-Id: Iaa9d37ef73f1fef5f2dbb8a840e774bb86c65bf7
2021-04-06 17:49:19 +00:00
Paul Duffin
aa73ae5b59 Update build to new location of hiddenapi config files
Bug: 179354495
Test: m nothing
Change-Id: I563237d46f35ae1d2b99ffaa93f77dfcef5a2b6e
2021-04-06 13:08:26 +01:00
Treehugger Robot
8c56183fb7 Merge changes Id33bf640,I4d67b9b9
* changes:
  Don't use incorrect version names like VER or BOARD even in tests
  SdkSpec = Scope + ApiLevel
2021-04-06 03:18:16 +00:00
Colin Cross
ee4a8b7070 Make lint HTML output deterministic
Remove a date from the lint HTML output to make it deterministic.

Bug: 183509050
Test: m out/soong/.intermediates/packages/apps/DocumentsUI/DocumentsUI/android_common/lint/lint-report.html
Change-Id: I796c0b571780814b657b9427a17c248668053983
2021-04-05 18:38:05 -07:00
Colin Cross
7fef94f57b Merge "Remove support for unsandboxed metalava" 2021-04-05 23:23:00 +00:00
Lorenzo Colitti
fa9b3f30fd Set the usesNonSdk manifest attribute whan targeting module SDKs.
From an ART perspective, calling module-lib APIs requires the
ability to bypass hiddenapi enforcement entirely. This CL ensures
that if an APK compiles against module-lib APIs, it will be able
to call those APIs. Currently, compiling against module-lib APIs
is not safe because APKs that are subject to hiddenapi protection
will crash at runtime.

Bug: 181309531
Test: made NetworkStackNext compile against module-current, and:
Test: aapt dump xmltree .../NetworkStackNext.apk AndroidManifest.xml | grep usesNonSdk
Change-Id: I5ca3328c64412078d803e0e3ffa1d8383602416f
2021-04-05 22:53:41 +09:00
Jiyong Park
54105c48f4 SdkSpec = Scope + ApiLevel
SdkSpec.Version was an int type. Now it becomes ApiLevel type which
is a better abstraction of the version (or api level).

Bug: 1655587
Test: m

Change-Id: I4d67b9b9eae45f653b6af4f5b73da9e091b3dfab
2021-04-05 09:32:06 +09:00
Jiyong Park
f1691d2a2c Move java.sdkSpec to the android package
... in preparation for making the handling of sdk versions consistent
across java and cc modules.

Bug: 175678607
Test: m
Change-Id: I598f0454bce9b7320621022115412fbe97403945
2021-04-03 08:25:12 +09:00
Jaewoong Jung
d0afefa4b1 Merge "Revert "Revert "Add min_sdk_version to java_import.""" 2021-04-02 15:49:58 +00:00
Colin Cross
2fbc234fd6 Merge "Silence kotlinc JDK9 warnings" 2021-04-02 15:39:13 +00:00
Jaewoong Jung
56e12dbbaf Revert "Revert "Add min_sdk_version to java_import.""
This reverts commit 5ab6508008.

Reason for revert: Resubmitting Ie255f74d40432f4bdd0092d618705a7d17235e58 after fixing the broken targets.

Bug: 183695497
Test: https://android-build.googleplex.com/builds/forrest/run/L58600000849810513
Change-Id: I5f072f396002ca3a45bd530ad9be987efa732833
2021-04-02 04:55:27 +00:00
Julien Desprez
cb05715e9e Merge "Remove tradefed static_lib heuristic" 2021-04-02 03:47:13 +00:00
Jaewoong Jung
37a5d5ebd8 Merge "Revert "Add min_sdk_version to java_import."" 2021-04-02 00:34:06 +00:00
Jaewoong Jung
5ab6508008 Revert "Add min_sdk_version to java_import."
This reverts commit 6d15d63556.

Reason for revert: Broke git_sc-mainline-prod on test_suites_x86_64

Fixes: 184305592
Change-Id: I4b2e2675e0dd9e2e84966f545a52f45d5b731bab
2021-04-02 00:17:59 +00:00
Jaewoong Jung
51a0d85ebc Merge "Add min_sdk_version to java_import." 2021-04-01 19:45:53 +00:00
Paul Duffin
379f36b6e5 Merge changes Idc01d3cc,I644db99c
* changes:
  Remove FixturePreparer.Extend()
  Remove FixtureFactory
2021-04-01 14:34:02 +00:00
Paul Duffin
79abe57f53 Remove FixturePreparer.Extend()
Use GroupFixturePreparers instead.

Bug: 182885307
Test: m nothing
Change-Id: Idc01d3cc5a57576a4cf417e9105d1ab851126e10
2021-04-01 10:33:20 +01:00
Jaewoong Jung
6d15d63556 Add min_sdk_version to java_import.
Fixes: 183695497
Test: apex_test.go
Change-Id: Ie255f74d40432f4bdd0092d618705a7d17235e58
2021-03-31 16:50:42 -07:00
Paul Duffin
bb7f1ac794 Add a new platform_bootclasspath module type
Initially, this is just a placeholder but functionality will be added
in follow up changes.

Bug: 177892522
Test: m nothing
Change-Id: I890b0d5a117c51a19c9ac5df98c766761d3aa16c
2021-03-31 22:44:34 +01:00
Paul Duffin
4aa7faf487 Merge "Remove unused java testing methods" 2021-03-31 21:41:42 +00:00
Colin Cross
8095c29597 Remove support for unsandboxed metalava
Everything is running in the sandbox, remove the unsandboxed support.

Bug: 153703940
Test: m checkbuild
Change-Id: I811b8a0ad37143518c120367dd20b2b6aa011570
2021-03-31 13:17:42 -07:00
Colin Cross
d47f4ac828 Silence kotlinc JDK9 warnings
Silence the "Illegal reflective access" warning from kotlinc tracked
by https://youtrack.jetbrains.com/issue/KT-43704

Test: m SystemUI
Change-Id: I98eaf530c69cc4d3cefe09f5feab54c764352912
2021-03-31 13:17:42 -07:00
Paul Duffin
535e0a105e Remove unused java testing methods
Also, stops exporting methods that are no longer used outside the java
package.

Bug: 181070625
Test: m nothing
Change-Id: I23d35bbc21f82f2dae802aa53badda4c58b41024
2021-03-31 16:20:12 +01:00
Paul Duffin
55e740e9a6 Remove varargs from RunTest(t *testing.T)
Use GroupFixturePreparers instead.

Bug: 182885307
Test: m nothing
Change-Id: Iaedb0ddc9d6a704f4d41363e705f3025a1291dc8
2021-03-31 16:03:59 +01:00
Colin Cross
8b6378b0dc Merge "Default metalava sandboxing to true" 2021-03-30 23:30:51 +00:00
Paul Duffin
dff50dffbc Merge "Remove extraneous calls to TestingBuildParams.RelativeToTop()" 2021-03-30 23:09:52 +00:00
Colin Cross
ff1c8c49c0 Merge changes I866850b3,I9022d17b
* changes:
  Add dependencies for Metalava's implicit android.jar references
  Support sandboxing droiddoc and droidstubs with args properties
2021-03-30 21:54:51 +00:00
Paul Duffin
a71a67a4f5 Remove extraneous calls to TestingBuildParams.RelativeToTop()
Deprecated the method to try and prevent any other uses being added.

Bug: 183650682
Test: m nothing
Change-Id: Ia6f43851e5a00c9d96af780e3bd21e03175e1a2f
2021-03-30 20:03:22 +01:00
Paul Duffin
e8366da1f6 Automatically call TestingBuildParams.RelativeToTop()
Fixes the few tests that break due to this and which cannot easily be
separated into their own changes.

Bug: 183650682
Test: m nothing
Change-Id: Ia2f31213a1f114a78e66a81d89279ecde9f4c465
2021-03-30 19:35:35 +01:00
Paul Duffin
87d3bae657 Merge "Migrate system_modules_test.go from NormalizePathsForTesting" 2021-03-30 16:42:55 +00:00
Paul Duffin
58367574a5 Merge "Add the transitive dependencies of boot_image to apex" 2021-03-30 16:42:07 +00:00
Paul Duffin
8d3c44a986 Merge "Add contents property to boot_image (and prebuilt_boot_image)" 2021-03-30 16:26:20 +00:00
Colin Cross
3fbf2bea6a Default metalava sandboxing to true
Turn on sandboxing everywhere.

Bug: 153703940
Test: m checkbuild
Change-Id: Ie64913d302efb780d5be9c1b32e6c368d72feba3
2021-03-29 21:57:49 -07:00
Colin Cross
5f6ffc72f7 Add dependencies for Metalava's implicit android.jar references
Metalava implicitly searches
prebuilts/tools/common/api-versions/android-%/android.jar and
prebuilts/sdk/%/public/android.jar when looking for --android-jar-patterns
matches, and fails if it can't find a match for an API level between 1 and
28 in at least one pattern.  Add android.jar files from the
api_levels_annotations_dirs directories to try to satisfy these patterns.

Bug: 153703940
Test: m docs
Change-Id: I866850b33d9a5cd82cc5135bd8f9e9400ed65439
2021-03-29 21:57:49 -07:00