Commit graph

20666 commits

Author SHA1 Message Date
Jooyung Han
2963716220 DO NOT MERGE apex: install flattened from apex_set
apex_set is a set of prebuilt apex files. To support GSI which installs
both flattened and unflattened APEXes when apex_set is used, we extract
the contents from the selected APEX file.

Bug: 159711661
Test: TARGET_PRODUCT=gsi_gms_arm64 m
      should install flattened apexes in /system/system_ext/apex
Change-Id: I0a51b9f4a4537d3230aaa3eece532664ea18bc7c
2020-06-30 12:13:28 +00:00
Paul Duffin
c4422106a7 Apply hiddenapi encoding to java_sdk_library .impl
Adds a ConfigurationName property, and ConfigurationName() method that
allows a library to separate its name (e.g. framework-tethering.impl)
from the name used in the build configuration,
    e.g. ctx.Config().BootJars().

Updates hiddenapi processing to use ConfigurationName() instead of
ctx.ModuleName().

Changes java_sdk_library to set the ConfigurationName property
of the implementation library to the name of the module instead of
<module>.impl so that it will match the name in the boot jars list.

Bug: 159683330
Test: m framework-tethering
      dexdump ${PRODUCT_OUT}/apex/com.android.tethering/javalib/framework-tethering.jar | grep hiddenapi | wc -l
      Verify that there are >0 hiddenapi entries.
      Add java_sdk_library_import prefer=true for framework-tethering
      and repeat the above to verify that there are 0 hiddenapi entries.
      Apply this change, repeat above and verify that there are the same # of entries as before.
      Remove the prebuilt for framework-tethering
      Repeat the above and verify that there is no change to the # of entries
Change-Id: I6c3016c35d0fcb1b95d4f9b37a307a69878f8e0a
2020-06-26 18:14:18 +01:00
Victor Khimenko
82f62fdac4 Merge "Add exclude_shared_libs, expand exclude_static_libs to cover static_libs" into rvc-dev 2020-06-25 14:02:04 +00:00
Colin Cross
1429cdcf87 Add exclude_shared_libs, expand exclude_static_libs to cover static_libs
Allow variants to exclude shared or static libs.

Bug: 153609531
Test: manual
Change-Id: I6ac9c445ed233c774a051743ed6760058c9918e9
2020-06-24 21:57:46 +02:00
Colin Cross
16e8b0492d Merge changes Ie163a4da,I16375b88 into rvc-dev
* changes:
  Set root dir in lint project.xml
  Set ANDROID_SDK_HOME when running lint
2020-06-24 00:14:23 +00:00
Colin Cross
91edfc29c3 Set root dir in lint project.xml
Set the root dir in the project.xml for lint so that the paths in the
lint report are relative to the top of the tree instead of relative
to the project.xml.

Bug: 153485543
Test: run lint
Change-Id: Ie163a4dadd976e708f798855de73e58084931a91
Merged-In: Ie163a4dadd976e708f798855de73e58084931a91
(cherry picked from commit c31efeb25c)
2020-06-23 14:45:04 -07:00
Colin Cross
bca9028825 Set ANDROID_SDK_HOME when running lint
Lint tries to create ~/.android, set ANDROID_SDK_HOME to keep it
from attempting to write to the home directory, which may not be
writable.

Test: run lint
Bug: 159676171
Change-Id: I16375b88d309a8fa416b3a8efeabe15759889ae3
Merged-In: I16375b88d309a8fa416b3a8efeabe15759889ae3
(cherry picked from commit 977b6a822d)
2020-06-23 14:45:04 -07:00
Jaewoong Jung
433ea2321a Change how override_modules work with prebuilts.
If an override module is overridden by a prebuilt, only skip its
installation instead of completely ignoring it, so that other modules
rely on it can still get configured and built properly.

Fixes: 159694118
Test: m checkbuild
Change-Id: I96d24f1440ff8a8aa8b1253fc22fd532b5588339
2020-06-23 08:18:02 -07:00
TreeHugger Robot
d4c3d0d162 Merge "Stem name should be fixed the same was as masterFile" into rvc-dev 2020-06-23 04:43:47 +00:00
Sasha Smundak
3c904e8b77 Stem name should be fixed the same was as masterFile
BUG: 159641682
Test: TH

Change-Id: Ic0300676c35821cedc693eeb7b970318790f6189
2020-06-23 04:13:25 +00:00
TreeHugger Robot
78d26d169b Merge "VNDK listing contains device modules only" into rvc-dev 2020-06-23 03:12:44 +00:00
TreeHugger Robot
d65089b4a4 Merge "Enforce permitted_packages for Q+ and R+ modules" into rvc-dev 2020-06-22 17:55:16 +00:00
Jooyung Han
d166f79278 Merge "apex: make allowed_files prop overridable" into rvc-dev 2020-06-22 17:05:58 +00:00
Paul Duffin
4c21463f04 Merge "Fix build breakages when WITHOUT_CHECK_API=true" into rvc-dev 2020-06-22 12:39:41 +00:00
Paul Duffin
49d3a523bf Instrument the java_sdk_library implementation library
Bug: 159241638
Test: build jacoco-report-classes-all.jar with and without
      prebuilt for framework-tethering. Ensure it contains the
      jacoco-report-classes.jar for framework-tethering.
Change-Id: I8183bd9613dfaf0ded5f9ac36567d5d29a8941e8
Merged-In: I8183bd9613dfaf0ded5f9ac36567d5d29a8941e8
2020-06-20 11:38:22 +01:00
Paul Duffin
9ee66da850 Fix check-boot-jars when a boot jar is provided by prebuilt
Previously, when a boot jar was provided by a java_sdk_library_import
module the check-boot-jars check failed because the file it depended on
was not available. In an incremental build the build failed due to the
file in the out directory not having a rule to generate it.

That was because the module was named prebuilt_<module>.<apex> instead
of <module>.<apex>. This was fixed by simply removing prebuilt_ prefix
from the name if it was present.

After fixing that the check-boot-jars still did not work properly
because it was expecting a jar file containing .class files but instead
was given a jar file containing .dex files which meant the check did
not work properly.

This was fixed by defining a new ApexDependency interface for use by
the apex/apex.go code to use instead of java.Dependency for generating
the androidmk entries. The *SdkLibraryImport type then implemented
those, by delegating to the implementation library.

Bug: 158304459
Bug: 159112414
Test: m check-boot-jars
      m checkbuild
	  manual inspection of the .jar file used by check-boot-jars to
	  ensure it contained .class files and not .dex files.
Change-Id: I545c5c9072dd472337d2f9b4dfdf08f53c981662
Merged-In: I545c5c9072dd472337d2f9b4dfdf08f53c981662
2020-06-20 11:38:08 +01:00
Jooyung Han
faa5399b3f apex: make allowed_files prop overridable
Because override_apex can modify the contents of the base apex,
allowed_files (which describes the contents) should be overridable.

Bug: 159503079
Bug: 159392784
Bug: 158169437
Test: m (soong test added)
Change-Id: I12744b0465dc3cfc90a66643867e65b4092cd0f7
2020-06-20 12:56:49 +09:00
Colin Cross
5ef04d1ee7 Merge changes I25c77994,I7da78ef4,I89197d0a into rvc-dev
* changes:
  Support adding extra lint checks
  Allow kotlin modules to skip packaging the kotlin stdlib
  Fix annotation processors in kotlin modules that generate resources
2020-06-19 23:48:25 +00:00
Colin Cross
94c9790591 Merge changes from topic "soong-lint" into rvc-dev
* changes:
  Add support for running Android lint on java and android modules.
  Consolidate adding common java properties
2020-06-19 20:58:48 +00:00
Colin Cross
205a504053 Support adding extra lint checks
Add a lint.extra_check_modules property to list modules to use as
plugins to Lint.

Bug: 153485543
Test: m checkbuild
Change-Id: I25c7799438cfec43163e757637c65b8657488d36
Merged-In: I25c7799438cfec43163e757637c65b8657488d36
(cherry picked from commit 92e4b46af5)
2020-06-19 12:53:09 -07:00
Colin Cross
aaf58061a0 Allow kotlin modules to skip packaging the kotlin stdlib
Host tools like lint may package their own version of the kotlin
stdlib, and any jars loaded by them shouldn't contain the platform
version.  Add a static_kotlin_stdlib property that defaults to true
to allow building the module without staticalling including the kotlin
stdlib.

Bug: 153485543
Test: m ApiFinder
Change-Id: I7da78ef493806ce4ab0050e4ee9e8d330b0509c8
Merged-In: I7da78ef493806ce4ab0050e4ee9e8d330b0509c8
(cherry picked from commit 0b67a8bd0f)
2020-06-19 12:53:09 -07:00
Colin Cross
3791b45f67 Fix annotation processors in kotlin modules that generate resources
The kapt rule was only keeping the generated sources, and not the
generated classes directory.  The generated classes directory will
contain resources generated by the annotation processor and needs
to be added to the final jar.

Test: m ApiFinder
Bug: 153485543
Change-Id: I89197d0afcb1eee011c01aa400f9977e66f43768
Merged-In: I89197d0afcb1eee011c01aa400f9977e66f43768
(cherry picked from commit 9ca38d22a4)
2020-06-19 12:53:09 -07:00
Paul Duffin
86672f6f4e Fix build breakages when WITHOUT_CHECK_API=true
Bug: 158578354
Test: export WITHOUT_CHECK_API=true
      m checkbuild
Change-Id: I7b5fff40b870c9d754f779ff1c3314bac7e42440
2020-06-19 19:15:29 +01:00
TreeHugger Robot
f58305a6a4 Merge "Don't remove entries for overriddable modules" into rvc-dev 2020-06-19 13:59:00 +00:00
Inseob Kim
fc14a1383b Merge "Exclude kernel_headers from vendor snapshot" into rvc-dev 2020-06-19 03:40:30 +00:00
Colin Cross
1e28e3c615 Add support for running Android lint on java and android modules.
Add a rule that runs Android lint on each java and android module
and produces reports in xml, html and text formats.

Bug: 153485543
Test: m out/soong/.intermediates/packages/apps/Settings/Settings-core/android_common/lint-report.html
Change-Id: I5a530975b73ba767fef45b257d4f9ec901a19fcb
Merged-In: I5a530975b73ba767fef45b257d4f9ec901a19fcb
(cherry picked from commit 014489c1e6)
2020-06-18 11:01:47 -07:00
Colin Cross
1c14b4ecf6 Consolidate adding common java properties
Use a method to add the properties that are present on all java modules.

Bug: 153485543
Test: m checkbuild
Change-Id: I7803b15eb0de810c8ab8d4b9acf2511935a26fb6
Merged-In: I7803b15eb0de810c8ab8d4b9acf2511935a26fb6
(cherry picked from commit ce6734e666)
2020-06-18 11:01:47 -07:00
Andrei Onea
115e7e77d8 Enforce permitted_packages for Q+ and R+ modules
Q+ and R+ mainline modules may only add code in a restricted set of Java
package prefixes, that may never be changed.
If a mainline module owns the Java package prefix "foo.bar", it may have
classes in "foo.bar", "foo.bar.baz", "foo.bar.baz.bat" etc.

Test: m
Bug: 156725734
Change-Id: I30bf510ed473309871469bf439d7c81575450931
2020-06-18 16:57:39 +01:00
Jiyong Park
ac5e79f900 Don't remove entries for overriddable modules
Previously, when there is apex_set that is overriding another module,
the entry for the overridden module is removed from apexkeys.txt.
However, this is wrong because the existence of the apex_set module
doesn't necessary mean that the module is insatalled instead of the
overridden module. That is determined by PRODUCT_PACKAGES which Soong
has no knowledge of. Therefore, we don't delete the entry for the
overridden (actually possibly overridable) modules in the file.

Bug: 158729168
Test: m
Change-Id: I85d0c756f862323bae556bf657d66ec50038985f
2020-06-18 23:05:31 +09:00
Yo Chiang
97c74da17b VNDK listing contains device modules only
Fix a bug where host-only modules were incorrectly listed as VNDK.
Also refactor VndkMutator() / apexVndkDepsMutator() module skipping
logic.

Bug: 158543482
Test: Add unit test to cc/cc_test.go
Change-Id: I50b09f526cbc081149d8241c2a091e3ee48ef4d7
Merged-In: I50b09f526cbc081149d8241c2a091e3ee48ef4d7
(cherry picked from commit bba545e039)
2020-06-18 10:02:07 +00:00
Inseob Kim
cea768007f Exclude kernel_headers from vendor snapshot
Vendor snapshot is supposed to have AOSP-defined modules which are
installed to vendor. kernel_headers are excluded from snapshot because
they always depend on vendor, regardless of locations they are defined.

Bug: 157106227
Test: m vendor-snapshot
Change-Id: If47634678797973266fcf502739216daf28ad790
Merged-In: If47634678797973266fcf502739216daf28ad790
(cherry picked from commit 65ca36a72e)
2020-06-17 15:01:26 +09:00
Jiyong Park
8d6286befe apex_sets is added to apexkeys.txt
apex_sets is a new module type that can be used to deliver pre-signed
APEXes, which previously could be done only via prebuilt_apex.

Soon gnow understands apex_sets module types and emits the signing info
of the modules to apexkeys.txt

Exempt-From-Owner-Approval: cherry-pic from AOSP

Bug: 158729168
Test: m
Merged-In: I9507375342ec053309660d94c931a79bf4f21218
(cherry picked from commit 8d6c51ebcc)
Change-Id: I9507375342ec053309660d94c931a79bf4f21218
2020-06-17 13:17:11 +09:00
TreeHugger Robot
78bb73972d Merge "Installed APKs should not have prebuilt_ prefix" into rvc-dev 2020-06-16 23:27:33 +00:00
Anton Hansson
c3754ba042 Merge "Let APEX build against preferred java_sdk_library_import" into rvc-dev 2020-06-16 17:47:16 +00:00
Sasha Smundak
854c14f334 Installed APKs should not have prebuilt_ prefix
Bug: 159031374
Test: treehugger & manual
Merged-In: I48f2595781efc1303c777619e082ce7765b73038
Change-Id: I86d8036e277ef978256d0a69de0edbb30a2bc304
2020-06-16 10:29:18 -07:00
Paul Duffin
f642a31ab5 Let APEX build against preferred java_sdk_library_import
If a java_sdk_library_import has a corresponding java_sdk_library then
make the java_sdk_library_import export both the xml and impl modules
created by the java_sdk_library.

Makes java_sdk_library_import consistent with java_sdk_library by
providing libraries within the same APEX access to the implementation
library instead of the stubs.

Bug: 158304459
Test: m nothing
      Test what happens when building com.android.tethering with and without
      a preferred "framework-tethering" java_sdk_library_import. Make sure that
      it does not change the generated APEX.
Merged-In: I2f4edea937ac377431a5696c92cbd467bded62ef
Change-Id: I2f4edea937ac377431a5696c92cbd467bded62ef
(cherry picked from commit eedc5d55ce)
2020-06-16 10:43:19 +01:00
Colin Cross
f4a5492ec9 Merge changes from topics "soong-inclusive-language", "soong_inclusive_language2" into rvc-dev
* changes:
  Use inclusive language in Android.bp files
  Use inclusive language in build/soong
2020-06-16 03:28:15 +00:00
Colin Cross
c8697f6ae5 Merge changes from topics "soong-dist", "tests-PathForSource" into rvc-dev
* changes:
  Add DistForGoal to MakeVarsContext
  Define Soong phony rules in Make
  Remove paths from cc.TestConfig
  Remove most paths from java.TestConfig
  Allow tests to bypass PathForSource existence checks
2020-06-16 03:27:32 +00:00
Colin Cross
287638be7e Fix using generated test configs for sh_test, python_test and rust_test modules
Annotate the test config properties with android:"path", and always
use LOCAL_FULL_TEST_CONFIG to pass the path to Make.

Bug: 157621988
Test: manual
Change-Id: I1c020e642f83d994d63c9e9cb56e686086d5acaa
Merged-In: I1c020e642f83d994d63c9e9cb56e686086d5acaa
2020-06-15 16:46:47 +00:00
Colin Cross
a44a6b27f9 Use inclusive language in Android.bp files
Bug: 158889297
Test: m checkbuild
Change-Id: Id9efbd99be54b191193eae1c5672230ca54cf1d2
2020-06-15 09:46:32 -07:00
Colin Cross
871b80fb77 Add DistForGoal to MakeVarsContext
Add methods to MakeVarsContext to allow Singletons to dist
artifacts without manually adding $(dist-for-goals) in Make.

Bug: 153485543
Test: m checkbuild
Change-Id: Ia5ddb31afe29329f2df0ae1297ed963c8c28e590
Merged-In: Ia5ddb31afe29329f2df0ae1297ed963c8c28e590
(cherry picked from commit 3cda0d8df9)
2020-06-15 09:46:31 -07:00
Colin Cross
95f7b34e8e Use inclusive language in build/soong
Bug: 158889297
Test: m checkbuild
Change-Id: Id07890b7cbc2397291a658ca00e86b43c743aafc
Merged-In: Id07890b7cbc2397291a658ca00e86b43c743aafc
(cherry picked from commit 440e0d0542)
2020-06-15 09:46:31 -07:00
Colin Cross
9855207d0e Define Soong phony rules in Make
To support dist-for-goals in Soong, we need to define all phony rules
in Make so that dist-for-goals can insert additional dependencies on
them.  Collect all the phony rules in phonySingleton and write them
out as Make rules when Soong is embedded in Make, or as blueprint.Phony
rules when Soong is run standalone.

Bug: 153485543
Test: m checkbuild
Change-Id: I68201eff30744b0f487fc4f11f033767b53a627d
Merged-In: I68201eff30744b0f487fc4f11f033767b53a627d
(cherry picked from commit c3d87d3112)
2020-06-15 09:46:31 -07:00
Colin Cross
5a3458ddc0 Remove paths from cc.TestConfig
Now that tests don't need to specify every path passed to
PathForSource or PathForModuleSrc, remove them from cc.TestConfig.

Bug: 153485543
Test: all soong tests
Change-Id: I90cd7b4dfc49c156afbb0eea9a77159c3e1860fa
Merged-In: I90cd7b4dfc49c156afbb0eea9a77159c3e1860fa
(cherry picked from commit 2fce23ae6d)
2020-06-15 09:46:31 -07:00
Colin Cross
f5f663b0c3 Remove most paths from java.TestConfig
Now that tests don't need to specify every path passed to
PathForSource or PathForModuleSrc, remove most of them from
java.TestConfig.  Leave a few that are globbed by lots of tests,
and move a few that are globbed by a single test into the tests.

Bug: 153485543
Test: all soong tests
Change-Id: Ica91d7203a6a7dbca0fd4fed84c78f149b8699e1
Merged-In: Ica91d7203a6a7dbca0fd4fed84c78f149b8699e1
(cherry picked from commit 238c1f3903)
2020-06-15 09:46:31 -07:00
Colin Cross
f77c720b08 Allow tests to bypass PathForSource existence checks
Forcing every test to specify every file it wants to pass to
PathForSource or PathForModuleSrc is painful to maintain and
doesn't add any value.  Allow tests to reference paths through
PathForSource and PathForModuleSrc without specifying them in
the mock FS.

Bug: 153485543
Test: all soong tests
Change-Id: Ia8a8fd965a338d0645b3721314bf91f50146ad21
Merged-In: Ia8a8fd965a338d0645b3721314bf91f50146ad21
(cherry picked from commit 5e6a797982)
2020-06-15 09:46:31 -07:00
Colin Cross
03aa290b52 Merge "Add eakammer and patricearruda to OWNERS" into rvc-dev 2020-06-15 16:38:27 +00:00
Colin Cross
0fd3329a3c Add eakammer and patricearruda to OWNERS
Bug: 0
Test: none
Change-Id: I4209fc5149dcce6bf75aef130afc69c4600c7f3b
Merged-In: I4209fc5149dcce6bf75aef130afc69c4600c7f3b
(cherry picked from commit b83929c944)
2020-06-15 16:38:09 +00:00
TreeHugger Robot
b1522d9990 Merge "Implement test config auto-gen for sh_test." into rvc-dev 2020-06-15 16:37:06 +00:00
TreeHugger Robot
a5fa9f6df9 Merge "Fix type assertion error regarding dex_import" into rvc-dev 2020-06-15 10:40:17 +00:00