Commit Graph

1058 Commits

Author SHA1 Message Date
Colin Cross 7d06395f0c Merge "Revert "Port uses-shared library verification and dexpreopting to Soong"" 2019-05-29 20:34:10 +00:00
Colin Cross c032498336 Revert "Port uses-shared library verification and dexpreopting to Soong"
This reverts commit b66d7b1c20.

Reason for revert: broke unbundled builds

Change-Id: I96ae287885107079de4a26e6b100ad8ed66961c0
2019-05-29 20:28:47 +00:00
Treehugger Robot 2f4c55e9f7 Merge changes from topic "verify_uses_libraries"
* changes:
  Port uses-shared library verification and dexpreopting to Soong
  Move verify_uses_libraries.sh out of dexpreopt
2019-05-29 18:09:01 +00:00
Tobias Thierer 4b06c20215 Merge "Support defaults properties in java_system_module" 2019-05-29 11:09:01 +00:00
Colin Cross 89574e0c40 Merge "Document escaping" 2019-05-29 01:28:02 +00:00
Colin Cross 9c74a1ee85 Don't build hiddenapi flags or encode dex for unbundled builds
Builds with TARGET_BUILD_APPS shouldn't build the hiddenapi flags
or encode dex files even if frameworks/base exists.

Bug: 133343287
Test: mainline modules build
Change-Id: I0647451420fd09bb680808b35e1ad3b8f514ba46
2019-05-28 21:48:54 +00:00
Colin Cross 667ffa192f Support defaults properties in java_system_module
Test: none
Change-Id: I08e5c39690b3c9960dc5e99c4b866a2523c9eafb
2019-05-28 20:36:46 +00:00
Colin Cross b66d7b1c20 Port uses-shared library verification and dexpreopting to Soong
Ports 09f3b97f4b488cd3a7b7d72038b173575b02c162 (Add support for
preopt with uses-libraries) from Make to Soong to support verifying
and preopting shared libraries.

Bug: 132357300
Test: app_test.go
Test: m checkbuild
Change-Id: Id25f55f07a55120bebe2a9b32c094209efc85c8b
2019-05-28 11:20:09 -07:00
Colin Cross e4a0584f60 Document escaping
Document that strings can contain double quotes escaped as \", and
the droiddoc args argument can contain a dollar signe escaped as $$.

Test: none
Change-Id: I91d3fa73f484094c9ce8cbecc93189850856de84
2019-05-28 10:19:31 -07:00
Colin Cross 7211910fd0 Add manifest_check tool
Add a tool that can check that the <uses-library> tags in an
AndroidManifest.xml file match a list provided by the build.

Bug: 132357300
Test: manifest_check_test
Change-Id: If15abf792282bef677469595e80f19923b87ab62
2019-05-24 13:43:27 -07:00
Colin Cross 4af387c20e Move manifest_fixer to a python_binary_host module
In preparation for making it use multiple files so that some
implementation can be shared with a new tool.

Also make manifest_fixer_test a python_test_host, and add it
to TEST_MAPPING.

Test: m checkbuild
Change-Id: Iaae177efcb978187b126d90359b82cdfd3176857
2019-05-24 13:43:19 -07:00
Colin Cross 5446e88657 Add <uses-library> tags for SDK libraries to AndroidManifest.xml
Port I4e7a9bdc5bf845af85168abf55f8063900bacc72 and
Ieb7c1429077aaf6899e214a217d9455d95dbfea6 from Make to Soong to
support adding <uses-library> tags to AndroidManifest.xml for
transitive java_sdk_library dependencies and android.test.base
and android.test.mock.

Fixes: 133306356
Test: m checkbuild
Change-Id: I23763bb689c474d25d04a418df1c46e7f0d807af
2019-05-24 13:39:26 +00:00
Jaewoong Jung ace17d35fd Merge "Add stl property to android_app." 2019-05-23 20:55:42 +00:00
Colin Cross 6be6c2e4c5 Merge "Add kotlin-stdlib-jdk8 when using Kotlin" 2019-05-21 18:11:59 +00:00
Pete Gillin 3f3a70c0ec Merge "Avoid targeting Java 9 for targets with SDK version up to 29." 2019-05-21 10:19:06 +00:00
Pete Gillin 9c64014102 Avoid targeting Java 9 for targets with SDK version up to 29.
Targets with sdk_version values up to and including 29 should not use
Java language level 9, even if EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9=true
is set.

This change fixes a downstream issue.

Bug: 131678633
Test: EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9=true make droid tests docs cts java
Test: (same test in downstream branch)
Change-Id: Ic58e8df2e06d6e07bc42255314521831dc41b239
2019-05-20 15:48:19 +01:00
Jaewoong Jung bc625cd942 Add stl property to android_app.
The flag is a Soong version of LOCAL_NDK_STL_VARIANT in apps and app
tests. Unlike in the case of cc_library and its siblings, the only
meaningful value for the make var when it's used in apps is
'c++_shared', in which case we add additional dependency to libc++.

Fixes: 130891985
Test: app_test.go + CtsNdkBinderTestCases
Change-Id: I83f45d375742164fff7f160a734b0686e56b5c38
2019-05-16 13:16:15 -07:00
Jaewoong Jung 4c83b8950a Merge "Turn off dex actions for sourceless modules." 2019-05-16 18:01:48 +00:00
Jaewoong Jung 105920a792 Merge "Fix override_android_app dependency issues." 2019-05-16 15:07:13 +00:00
Treehugger Robot f50406eecc Merge "Add No_dist property" 2019-05-16 01:25:53 +00:00
Jaewoong Jung a24af3ba20 Turn off dex actions for sourceless modules.
Test: dexpreopt_test.go
Fixes: 129370564
Change-Id: Ic292f37c4f782b14fce625b85817b58c31d3f276
2019-05-15 15:46:26 -07:00
Jaewoong Jung b639a6adb2 Fix override_android_app dependency issues.
This change fixes an issue where an android_test could not depened on an
override_android_app or an android_app overridden by one by moving all
override processing to post-deps and forwarding incoming dependencies on
override_android_apps to base android_app modules

Fixes: 132447700
Test: app_test.go
Change-Id: I4ac593be661f541f5ea9823ef97373bee4b186f9
2019-05-15 12:11:18 -07:00
Colin Cross 0b03d9701b Add kotlin-stdlib-jdk8 when using Kotlin
kotlin-stdlib-jdk8 contains extensions to the Kotlin standard library
for use when targeting Java language level 8.

Test: m checkbuild
Change-Id: Iac5f977f9080d8e0e2402b08a992a93c909744e9
2019-05-15 17:38:11 +00:00
Sundong Ahn 80a87b3309 Add No_dist property
For the sysprop apis, we don't need dist. So the No_dist property is
added for it.

Bug: 132448761
Test: m -j dist
Change-Id: I51c6a6b87ab9dc90b6825c0d4d414e958dd7b265
2019-05-15 12:20:03 +09:00
Sasha Smundak d2e5361c90 manifest_fixer argument should be --use-embedded-dex rather than --use-embedded-dex=true
Test: building soong tests, treehugger
Change-Id: Id0df92171a2e547794979fb473d8abc47f33d13c
2019-05-14 17:03:24 -07:00
Treehugger Robot bc975e8b89 Merge "Fixes typos in device_host_converter.go comments." 2019-05-14 01:16:27 +00:00
Jaewoong Jung 707d788ea2 Fixes typos in device_host_converter.go comments.
Test: TreeHugger
Change-Id: Ie786e8fc950c3e9913c9d51f2b88bc036bb17462
2019-05-13 15:11:23 -07:00
Treehugger Robot f3e802bf0d Merge "Don't hide *.kotlin_module in turbine dependencies" 2019-05-13 20:21:47 +00:00
Jaewoong Jung b7cb607812 Merge "Uncompress dex file in imported apk when needed." 2019-05-13 17:54:00 +00:00
Pete Gillin dd6dd18ef6 Merge "Make core-generated-annotation-stubs link as core stubs." 2019-05-13 11:37:43 +00:00
Colin Cross 0967b34dd9 Merge "Write dexpreopt.config again during the build" 2019-05-11 04:11:58 +00:00
Colin Cross 2d00f0dcae Write dexpreopt.config again during the build
Writing $OUT/dexpreopt.config during build setup and then using
it during the build causes bad incremental builds if a cleanspec
removes $OUT/dexpreopt.config.  Create a rule in Soong to write
out a copy so that it is a normal build artifact.

Bug: 132379813
Test: m checkbuild
Change-Id: I7755a7f8c1d6561fc83022a7f4cf7e4a64e989c9
2019-05-10 07:07:21 -07:00
Pete Gillin cbff326fe6 Make core-generated-annotation-stubs link as core stubs.
Bug: 123891440
Test: EXPERIMENTAL_USE_OPENJDK9=true make droid

(cherry picked from commit 4528becc46)

Merged-In: I117828f13a604030d1c36bdb60fffec4c4e08d6e
Change-Id: I17fa4e0c4106b63bf3cb0e3c3f78498a4072d9f5
2019-05-10 13:05:23 +01:00
Pete Gillin 42e862c56d Merge "Rename EXPERIMENTAL_USE_OPENJDK9 to EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9." 2019-05-10 11:50:08 +00:00
Jaewoong Jung ea1bdb002d Uncompress dex file in imported apk when needed.
This implements the uncompress-dexs macro's behavior in Soong.

Test: Converted TvSampleLeanbackLauncher + zipinfo
Change-Id: I9477aa21429d055f3f36ca90c7fd2c345c999029
2019-05-09 14:38:11 -07:00
Treehugger Robot 11cd91dada Merge "Fix dangling rules on aosp_cf_x86_phone" 2019-05-09 16:16:01 +00:00
Pete Gillin 0c2143e1ee Rename EXPERIMENTAL_USE_OPENJDK9 to EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9.
The current EXPERIMENTAL_USE_OPENJDK9 environment variable is a legacy
from when the 8 -> 9 toolchain upgrade was happening. That migration
is done and the variable only affects the language level, so it should
have a name that reflects that. (The current situation would be
especially confusing if we started a 9 -> 11 toolchain upgrade,
presumably controlled by a variable like EXPERIMENTAL_USE_OPENJDK11,
since the two settings look incompatible but are actually orthogonal.)

The current variable historically allowed a value or "1.8" which meant
"use the OpenJDK 9 toolchain but target language level 8". That value
no longer has any meaning and the new variable doesn't allow it.

Bug: 131678633
Test: `make` with `EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9=true`
Test: `javap -v $OUT_DIR/soong/.intermediates/libcore/core-oj/android_common/javac/classes/java/util/List.class | grep 'major version'` shows 53
Test: Audit all mentions of the old string here and downstream
Change-Id: Idad808c7f07913baba1a777627322d5452dabcef
2019-05-09 15:36:29 +01:00
Jaewoong Jung 53ad63c127 Merge "Implement DPI variants in android_app_import." 2019-05-08 23:34:04 +00:00
Colin Cross c11e0c5a39 Fix dangling rules on aosp_cf_x86_phone
aosp_cf_x86_phone uses SecondArchIsTranslated, which was leaving
a dangling rule from the oatdump rules to
out/soong/vsoc_x86/dex_bootjars/system/framework/arm/boot.art.
Consolidate the code to select targets for dexpreopting and use it
in more places to prevent references to boot images that were not
generated.

Test: m checkbuild
Change-Id: Ia4945a99ff5e575e759299106559c85f38489acc
2019-05-08 22:26:14 +00:00
Colin Cross 6c6e6cd64d Don't hide *.kotlin_module in turbine dependencies
The jars containing the merged header classes from transitive
static dependencies were stripping all of META-INF/.  Kotlin
puts metadata in META-INF that is used to map the package to
the static class that contains the package-level functions.

This also exposed that the metadata in META-INF is always
called "name.kotlin_module", so a library that contains
kotlin files with a dependency that also contains kotlin files
would shade the metadata file.  Use a unique name instead.

Fixes: 131709692
Test: m checkbuild
Change-Id: I5cd276e563206e37c4c0d90fe9f346e9396f88c0
2019-05-08 14:30:12 -07:00
Jaewoong Jung a5e5abc449 Implement DPI variants in android_app_import.
Bug: 128610294
Test: app_test.go
Change-Id: Ie3e558bfdb40de6b0b9df95d3b373d08a4084d7b
2019-05-07 17:55:23 -07:00
Treehugger Robot 082640d6ee Merge "Track sources for srcjars across modules" 2019-05-07 17:25:52 +00:00
Treehugger Robot da2bba1d71 Merge "Allow module types to generate resources" 2019-05-07 14:19:52 +00:00
Jaewoong Jung ddda3ce23a Merge "uncompressedDex option for android_app_import." 2019-05-06 21:24:53 +00:00
Colin Cross 0c4ce21615 Track sources for srcjars across modules
Robolectric coverage needs a srcjar that sometimes needs to
include sources of dependencies.  Track the arguments and
dependencies necessary to jar the sources.

Test: TestIncludeSrcs
Change-Id: I9979d2b8350923a2237e743c232e6e548f54ba3b
2019-05-06 14:22:26 -07:00
Colin Cross 988708ce75 Allow module types to generate resources
Robolectric will need to generate extra resources to be added to
the jar.

Test: TestResources
Change-Id: I028f91ea8fc5d1e59e4e805876d70f57d8899f11
2019-05-06 14:22:26 -07:00
Jaewoong Jung acf18d7c63 uncompressedDex option for android_app_import.
This also partially consolidates shouldUncompressDex implementations.

Bug: 128610294
Test: TreeHugger
Change-Id: I7cea5a3890ddd473f63c0738a35af067455b5c4d
2019-05-03 15:58:41 -07:00
dimitry 1f33e40972 Add native_bridge target to Android.bp
This allows us to build guest libraries for the native bridge for
arm/arm64 architectures.

Bug: http://b/77159578
Test: make
Change-Id: I35520ca456105ddadd456c78a4eb1e6de39147c5
2019-05-03 15:33:28 +02:00
Treehugger Robot 0e7dbebe7e Merge "Fix use_embedded_native_libs handling for android_test" 2019-05-02 22:10:29 +00:00
Colin Cross 5346d07108 Merge "Support robolectric_test" 2019-05-02 16:37:33 +00:00