Commit Graph

20170 Commits

Author SHA1 Message Date
Treehugger Robot c7c7e466ac Merge "AIDEGen: Add path attribute to okhttp module." 2020-05-27 07:18:19 +00:00
Dan Willemsen 570a292bab Better handling of low memory situations
Drop down to a single high-mem task when we've got <=16GB, as the system
probably isn't completely free RAM, ninja will be using a couple gigs,
along with whatever "normal" actions will be running concurrently. So
it's unlikely that we can handle two 6-8GB actions along with everything
else.

Also print warnings when we detect <=16GB total RAM, or when we're
running more parallel jobs than than we have GB RAM. These both notify
the user and suggest lowering the `-j` value if they run into problems.

Test: fake totalRAM to [0.5,8,16]GB, checking warning
Test: fake totalRAM to 17GB, `m -j4 nothing` has no warning
Test: `m -j187 nothing` on a 188GB system
Test: `m -j188 nothing` on a 188GB system
Change-Id: Ieb008e9f462d5f40fb65781d94cf116b1caf8446
2020-05-26 23:29:18 -07:00
Kousik Kumar a858736c86 Merge "Add support for remote-execution / caching of turbine actions" am: 97d095516e
Change-Id: Ic5b941bc743ca9471393f1f8467daa9591d674d5
2020-05-27 04:01:27 +00:00
Kousik Kumar 97d095516e Merge "Add support for remote-execution / caching of turbine actions" 2020-05-27 03:41:50 +00:00
Jaewoong Jung 6abfbf7f9c Make android_app_import multi targets arch module.
I made a mistake and only fixed android_test_import in my previous
change, I5bbb2d2b733bbd6b868898285683ba5ff45be10b.

Bug: 154281342
Test: TreeHugger
Test: chromium-webview
Change-Id: I1575d9ef3f8596f1eb8db0867db09de08945d711
2020-05-26 20:10:08 -07:00
Paul Duffin 033f903c76 Switch droiddoc to use SdkHeaderJars() am: 649dadfb87
Change-Id: I759808445fe9fa92fa52181fb0098e6c6136a7c4
2020-05-26 21:49:27 +00:00
Paul Duffin af853b758f java_sdk_library: Expose implementation within APEX am: 9b879594ed
Change-Id: Id2517fa4b099a75663b2f8599f280223aafa25f8
2020-05-26 21:49:24 +00:00
Paul Duffin d3320c8787 java_sdk_library: Only expose impl jars when they are built am: daaa332827
Change-Id: I18f5be5e66fca6c1185b5c3f92d790a2fee8b3c2
2020-05-26 21:49:02 +00:00
Paul Duffin 649dadfb87 Switch droiddoc to use SdkHeaderJars()
Previously, droiddoc was using SdkImplementationJars() to get a JAR to
add to the classpath in order to resolve unknown references in the
source.

Given that SdkHeaderJars() returns jars created by Turbine which are
(for compilation at least) functionally identical to the implementation
jars there is no point in using the implementation jars.

Bug: 148080325
Test: m nothing
Change-Id: I2b718cc1445c04e849dcb0b1f53bba2b0bd90c95
2020-05-26 18:32:44 +01:00
Paul Duffin 9b879594ed java_sdk_library: Expose implementation within APEX
Access to the implementation JARs is restricted to avoid code from
depending on implementation details that could change from one release
to the next which could cause compatibility issues. That is not a
problem when referenced from within the APEX that contains the
java_sdk_library.

As references from within the same APEX often need to access
implementation specific details of the java_sdk_library and doing that
from within the same APEX is safe this change all references to a
java_sdk_library made within the same APEX to use the implementation
jars instead of stub jars.

Bug: 155164730
Test: m droid
Change-Id: If239059690de61683c2ad2d8a0ce2e47286a3637
2020-05-26 18:32:44 +01:00
Paul Duffin daaa332827 java_sdk_library: Only expose impl jars when they are built
The implementation jars are not built if api_only: true. In that case
the jar paths must not be exposed implicitly as they will be nil and
they will just be ignored.

This change ensures that stubs are returned when the implementation
jars are not built.

Bug: 155164730
Test: m droid
Change-Id: Ic495982a5dcb2754916260e7d91d921a5da288ae
2020-05-26 18:32:44 +01:00
Anton Hansson 668b8a21cf Remove conditional running of checklast during checkapi
Since the metalava invocations have been merged into a single one,
and checkapi already requires the other timestamp, this has no effect.

Bug: 151160048
Test: m checkapi
Change-Id: I560058f0f4cdeaedaf247cd35119da2cf0b86ea0
2020-05-26 18:09:33 +01:00
Nikita Ioffe df5ef957cc Merge "Always set targetSdkLevel to DefaultAppTargetSdk" am: 62bd3c7b47
Change-Id: I2aae04937917406f12c7446aa5e4349a4aa5d143
2020-05-26 16:58:20 +00:00
Nikita Ioffe 62bd3c7b47 Merge "Always set targetSdkLevel to DefaultAppTargetSdk" 2020-05-26 16:47:42 +00:00
Liz Kammer 6e85e4c2bc Support preprocessed prebuilt tests in androidmk
Adds support to translate app prebuilt tests to android_test_import and
LOCAL_REPLACE_PREBUILT_APK_INSTALLED to preprocessed property.

Test: androidmk_test.go, bpfix_test.go
Bug: 155412211
Change-Id: I77c07c684125adf228ba91911998823a68b3a65d
2020-05-26 09:12:42 -07:00
Treehugger Robot 327b94a92a Merge "java_sdk_library: Simplify SdkLibrary.sdkJars" am: 3f82e2426e
Change-Id: Ide69775757b1cf0c3346a1e43b9f29e89c1ad098
2020-05-26 16:00:52 +00:00
Treehugger Robot 3f82e2426e Merge "java_sdk_library: Simplify SdkLibrary.sdkJars" 2020-05-26 15:46:52 +00:00
Jooyung Han 43d3025cd5 pom2bp: add apex_available/min_sdk_version
apex_available/min_sdk_version are required to be available for mainline
modules(APK/APEX).

- java_import/java_library_static
- android_library/android_library_import

Bug: 156996905
Test: prebuilts/sdk/update_prebuilts.sh
Change-Id: I201ebabaa533c5ee19e394ab30ca2fa0e3d7ce0e
2020-05-27 00:37:45 +09:00
satayev 3a0a6427bd Merge "Generate combined deps-info for all updatable modules." am: ede18549e5
Change-Id: If886f3b3228b8e26138dff0329c03aad9c71d33d
2020-05-26 13:47:02 +00:00
satayev ede18549e5 Merge "Generate combined deps-info for all updatable modules." 2020-05-26 13:28:28 +00:00
Paul Duffin c91f5d0cc7 java_sdk_library: Simplify SdkLibrary.sdkJars
The expression !sdkVersion.specified() is equivalent to the following:
    !sdkVersion.valid() || sdkVersion.kind == sdkPrivate

That means that the else if clause "sdkVersion.kind == sdkPrivate" will
never be reached so it was removed.

There is also no need to check sdkVersion.valid() as that will already
have been checked, and an error reported, before this code has been
called. Therefore that has been removed.

Bug: 148080325
Test: m nothing
Change-Id: Ib7c544b48dfb53bad3e15f9f73f71bd05cff9b49
2020-05-26 11:12:28 +01:00
Treehugger Robot 3d075275c2 Merge "Add preprocessed property for android_test_import" am: 42ada5cff3
Change-Id: Ie29e07ede82444235182a79aa74939e9358e7389
2020-05-21 22:38:18 +00:00
Treehugger Robot 42ada5cff3 Merge "Add preprocessed property for android_test_import" 2020-05-21 22:22:28 +00:00
Liz Kammer 3b70b3fea5 Add preprocessed property for android_test_import
If set to true, preprocessed indicates that the prebuilt apk is
installable as is and does not need any further processing (e.g.
zipaligning, signing).

Test: app_test.go
Bug: 155412211
Change-Id: If0c27c1e340c1bdb270064f636dc6bf33a0fc949
2020-05-21 13:00:46 -07:00
David Srbecky e033cbae40 Allow the user to explicitly set the java Uncompress_dex property.
ART tests need to explicitly control the compression.

Bug: 157239179
Test: "atest ArtGtestsTarget" with http://go/aog/1302773
Change-Id: I4490aa0a61fa71f830feb6a46dffd8d20fccfc66
Merged-In: I4490aa0a61fa71f830feb6a46dffd8d20fccfc66
2020-05-21 19:59:25 +01:00
Treehugger Robot 55224ccdd1 Merge "java_sdk_library: Control shared library use" am: eee58d0eed
Change-Id: I825b4244a04ede2cc999dcf14a6d7ea021bbf4b6
2020-05-21 12:21:30 +00:00
Jooyung Han 17a8699112 Merge "apex: Make android_library support APEX variants" am: 5ab5856db3
Change-Id: Ica5977558ef6b5b828ba112e64d574c518eae085
2020-05-21 12:21:23 +00:00
Treehugger Robot 9e6bbde8b1 Merge "Improve tracking of exported sdk libraries" am: 7d74b5f142
Change-Id: I079fbce6f41fb8a36063f085b423f25aa79e6952
2020-05-21 12:21:09 +00:00
Treehugger Robot eee58d0eed Merge "java_sdk_library: Control shared library use" 2020-05-21 12:14:23 +00:00
Jooyung Han 5ab5856db3 Merge "apex: Make android_library support APEX variants" 2020-05-21 12:02:39 +00:00
Treehugger Robot 7d74b5f142 Merge "Improve tracking of exported sdk libraries" 2020-05-21 12:02:05 +00:00
Jooyung Han acc7bbebe4 apex: Make android_library support APEX variants
The android_library module type can be used within an android_app that
can itself be added to an apex but android_library does not call
android.InitApexModule(module) and so it does not support apex variants
and so is treated as if it cannot be part of an APEX even though it
actually is.

Now, android_library supports AEPX variants.

Due to this change, the whilelist for apex_available got bigger.

Exempt-From-Owner-Approval: cherry-pick from internal

Bug: 156978407
Test: m
Merged-In: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
Change-Id: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
(cherry picked from commit bd133b1bdc)
2020-05-21 12:01:54 +00:00
Ulyana Trafimovich 556290d2e4 Merge "Fix TestDexpreoptBootZip on non-Linux hosts." am: 8a4ec5024d
Change-Id: Ibd20365bf4dd5ef299d3de4467f62bec269d42d2
2020-05-21 10:01:49 +00:00
Ulyana Trafimovich 8a4ec5024d Merge "Fix TestDexpreoptBootZip on non-Linux hosts." 2020-05-21 09:39:38 +00:00
Paul Duffin dfa131e673 java_sdk_library: Control shared library use
Previously, all java_sdk_library instances were assumed to be usable as
shared libraries, i.e. referenced from <uses-library> in Android
manifest. However, that was not true for any instances that specified
api_only: true and will not be true for many of the new Android
modules.

One consequence of this assumption is that use of one of the api_only
instances could (but fortunately does not appear to) have lead to an
invalid library being referenced in an app's manifest which would
prevent the app from loading. That would have been done automatically
by the implicit sdk library tracking and manifest fixing mechanism and
there would have been nothing a developer could have done about it.

Changes:
1) Prevents api_only instances from participating in the automatic
   tracking which will prevent them from being added to Android
   manifests and breaking apps.

2) Add a new shared_library property that can have the same effect as
   api_only while still creating a runtime implementation library.

3) Renamed commonProperties to commonSdkLibraryProperties to
   disambiguate it from the ModuleBase.commonProperties field.

4) Extracts requiresRuntimeImplementationLibrary() to remove duplicate
   code accessing the Api_only property.

5) Tests for the api_only and shared_library behaviours.

Test: m nothing - added tests, tests broke, fixed code, tests passed.
Bug: 156723295
Change-Id: Iccf509e808d5ff53522188541a4c54d8f9ada93c
2020-05-21 10:39:34 +01:00
Paul Duffin 859fe961b0 Improve tracking of exported sdk libraries
The build tracks the java_sdk_library/_import modules that are
referenced by libraries so that it can ensure that any Android app that
includes code that depends on one of those modules has the appropriate
<uses-library> entry in their manifest.

Unfortunately, there were a couple of issues with that:
1) It only tracks direct references to the java_sdk_library module
   itself, e.g. android.test.mock. Direct references to the stubs
   module, e.g. android.test.mock.stubs were not tracked. Making it
   possible for Android apps to reference libraries which would not be
   available at runtime.
2) The logic for determining whether something was a java_sdk_library
   was repeated in a number of places making it difficult to allow
   java_sdk_library/_import instances to determine whether they should
   be treated as an Android shared library.
3) It tracks (and could use) even those java_sdk_library instances
   which do not represent a shared library, e.g. the ones that set
   api_only: true. While this change will simplifty fixing that the
   actual issue will be fixed in a follow up change.

Changes:
* Added EmbeddableSdkLibraryComponent and embedded it into
  java_sdk_library/_import, java_library and java_import. It provides
  the common code to minimize duplication. It contains an
  SdkLibraryToImplicitlyTrack field that if set will cause any
  references to the containing module to add the SdkLibraryParent to
  the list of implicit sdk libraries being tracked.
* Changed code that assumed that anything that implemented
  SdkLibraryDependency required tracking to use the
  OptionalImplicitSdkLibrary() method to get the optional name of the
  sdk library to track. That will allow a follow up change to return
  nil from that method to exclude an sdk library from being tracked.
* Moved SdkLibraryDependency from java.go to sdk_library.go as that is
  a better place for it to be.
* Changed the stubs java_library/java_import creation code to initialize
  the SdkLibraryToImplicitlyTrack field with the name of the creating
  module.
* Initialized the SdkLibraryToImplicitlyTrack field in the
  java_sdk_library/_import so that direct references to them will be
  tracked too.
* Added tests to verify that direct access to the .stubs child of both
  java_sdk_library and java_sdk_library_import are tracked properly.

Test: atest CtsProviderTestCases - which relies on android.test.mock
      being implicitly tracked to verify that I had not broken
	  anything. Used aapt2 dump badging to read the manifest.
	  m nothing - to run the new tests which failed before fixing the
	  code.
Bug: 156723295
Change-Id: Ia99def91e9b74d2ed0a777de04b476c00ea0393d
2020-05-21 10:39:32 +01:00
Ulya Trafimovich 5006d8d4f7 Fix TestDexpreoptBootZip on non-Linux hosts.
The test was written with the assumption that the build OS is
Linux, which is not always the case (the test was broken on Darwin).

Test: m nothing (on Linux host)
Bug: 157192627
Change-Id: I6ae3deed7a3342f4526528f29ce0a299d24b464b
2020-05-21 09:39:24 +00:00
Treehugger Robot 8054254ae9 Merge "java_sdk_library: Do not expose stubs implementation jar" am: c912b4617e
Change-Id: I57d56d0cd52e829e0d18cf2e82697a2d2e6cc059
2020-05-21 09:31:53 +00:00
Treehugger Robot 5cd1713634 Merge "java_sdk_library: Access outputs using tags" am: f716d58339
Change-Id: Icbadfb253714dca2aaff95914c46a9bd96152faa
2020-05-21 09:31:45 +00:00
Treehugger Robot c912b4617e Merge "java_sdk_library: Do not expose stubs implementation jar" 2020-05-21 09:16:04 +00:00
Treehugger Robot f716d58339 Merge "java_sdk_library: Access outputs using tags" 2020-05-21 09:15:58 +00:00
Treehugger Robot 12eaf6e62e Merge "java_sdk_library: Improve consistency with ..._import" am: 4e1f005046
Change-Id: If886ade59939af2e7b14cb4b6bca9e3c09cea2b1
2020-05-21 07:55:41 +00:00
Paul Duffin 8a75a5d5f3 Merge "java_sdk_library: Add redirection to module-lib stubs" am: 83322ba6a2
Change-Id: Id063adf60040bfcbcabd7bcfd03ee79a1621bc5f
2020-05-21 07:55:34 +00:00
Paul Duffin fb0e2c82ae Merge "java_sdk_library: Extract common stubs redirect code" am: 4b05b9ca39
Change-Id: I0126c939c51297c1e5aec30900f80a05f1ec72bb
2020-05-21 07:55:24 +00:00
Treehugger Robot 4e1f005046 Merge "java_sdk_library: Improve consistency with ..._import" 2020-05-21 07:36:35 +00:00
Paul Duffin 83322ba6a2 Merge "java_sdk_library: Add redirection to module-lib stubs" 2020-05-21 07:25:17 +00:00
Paul Duffin 4b05b9ca39 Merge "java_sdk_library: Extract common stubs redirect code" 2020-05-21 07:24:56 +00:00
bralee 1fbf44089e AIDEGen: Add path attribute to okhttp module.
Bug: 157115477
Test: 1. aidegen Settings -n
         open merged_module_info.json
	 "okhttp": {
	     ...
	     "path": ["external/okhttp"]
         },
	 modules: "mimemap-testing-res.jar", "mimemap-res.jar"
                  "services.core.priorityboosted", "framework-tethering"
                  "bouncycastle_ike_digests",
                  "robolectric-sqlite4java-native"
                  have the 'path' attribute.
Change-Id: If3628887866c29dcc948dd427727f175a5199edc
2020-05-21 11:25:51 +08:00
Jooyung Han f7879cbfbd Merge "apex: install hwasan lib if depended on libc" am: 166349beeb
Change-Id: I5f87d8da976e47bf8cdc59613308942b492c23df
2020-05-21 01:11:21 +00:00
Jooyung Han 166349beeb Merge "apex: install hwasan lib if depended on libc" 2020-05-21 00:48:26 +00:00