Export proguard flags from Android library modules, and use them
from static dependencies in Android apps when running proguard.
Also export them to Make.
Unlike Make, which concatentates all the exported flags from
dependencies, Soong dedups exported flags files.
Bug: 73724997
Test: m checkbuild
Change-Id: I8f86fecb09cbc591832ce67e8ecef551a6600349
Merged-In: I8f86fecb09cbc591832ce67e8ecef551a6600349
(cherry picked from commit 89c31581a5)
Static android libraries should not get the product-specific
flags.
Bug: 73724997
Test: m checkbuild
Change-Id: I89e8c0a3fb788b18ee6603e9d21c9b9a5275f42f
Merged-In: I89e8c0a3fb788b18ee6603e9d21c9b9a5275f42f
(cherry picked from commit e78dcd313c)
Add support for compiling android_library modules into AARs,
and refactor app support on top of it.
Bug: 73724997
Test: app_test.go
Change-Id: I1dfac5fffe577c6680bc4709147b2061eb7d819c
Merged-In: I1dfac5fffe577c6680bc4709147b2061eb7d819c
(cherry picked from commit a97c5d3f08)
Some builds set AppsDefaultVersionName() to include the build
number ("P-123456"). aapt2 copies the version name of
framework-res into app manifests as compileSdkVersionCodename,
which confuses things if it contains the build number. Use the
DefaultAppTargetSdk ("P") instead.
Bug: 78324052
Test: m TARGET_BUILD_WITH_APPS_VERSION_NAME=true Dialer
aapt dump badging $OUT/system/priv-app/Dialer/Dialer.apk | grep compile
shows compileSdkVersionCodename=P
Change-Id: If67f40aae1066d4ff3bf97da1b2de2e1e250ad9c
Merged-In: If67f40aae1066d4ff3bf97da1b2de2e1e250ad9c
(cherry-picked from commit 402d5e0919)
LOCAL_RESOURCE_DIRS puts the highest priority overlay first, but
aapt2 expects the highest priority overlay last. Soong stores the
list in aapt2 order (low to high priority), but that means when it
exports to Make as LOCAL_SOONG_RRO_DIRS, which goes to
build_rro_package.mk and then package_internal.mk, it gets reversed
again and comes out backwards.
Bug: 78032566
Test: m checkbuild
Change-Id: If72bf929fbf1d126f9051a2f21ec1eb4e3030e6e
Merged-In: If72bf929fbf1d126f9051a2f21ec1eb4e3030e6e
(cherry picked from commit a140bb05f1)
aapt2 --min-sdk-version was using AppsDefaultVersionName(), which
is OMR1 for a non-finalized SDK, but 8.1.0 after finalization.
Add PlatformSdkCodename() for non-finalized SDKs, use it for
DefaultAppTargetSdk(), and pass it for aapt2 --min-sdk-version.
Bug: 78224641
Test: TestAppSdkVersion in app_test.go
Change-Id: I622eaf92f8a940f79007c2a579536da325700b06
Merged-In: I622eaf92f8a940f79007c2a579536da325700b06
(cherry picked from commit d09b0b653b)
In preparation for unexporting ProductVariables, explicitly return a
pointer to the structure from TestConfig / TestArchConfig.
Bug: 76168832
Test: m blueprint_tools
Change-Id: Iccfb4c912f8e0ee3f620cc1ee00f0cdc5cba7735
Merged-In: Iccfb4c912f8e0ee3f620cc1ee00f0cdc5cba7735
(cherry picked from commit 674dc7f7f0)
An upcoming change will stop exporting ProductVariables from Config, so
switch to using existing accessor functions, and add more when they're
missing.
Bug: 76168832
Test: out/soong/build.ninja is identical
Change-Id: Ie0135bdbd2df3258ef3ddb53e5f8fc00aa9b97f7
Merged-In: Ie0135bdbd2df3258ef3ddb53e5f8fc00aa9b97f7
(cherry picked from commit 3fb1faeeb9)
So that the Path and similar functions can be used directly, without
manually adding something like configErrorWrapper (it just uses it all
the time now).
Bug: 76168832
Test: out/soong/build.ninja is identical
Change-Id: I8cb524b09a84d0b8357d7c3501c71270af411e17
Merged-In: I8cb524b09a84d0b8357d7c3501c71270af411e17
(cherry picked from commit 54daaf0371)
The AIDL code generator can now include trace code in every generated
AIDL call. We don't want to enable this by default for all interfaces
for two reasons:
1) Potential performance overhead
2) For Java targets, the code depends on @hide APIs in android.os.Trace,
and I haven't found a clean way to determine whether a target is
allowed to use @hide stuff in the SDK. LOCAL_PRIVATE_PLATFORM_APIS
is almost it, but it's not set for the core framework (which is
exactly one of the things we'd like to trace).
Bug: 74416314
Test: verify correct code is generated when flag is set
Change-Id: Ic6ab8aee3e708207813da3e803911a844ff3e52b
Merged-In: Ic6ab8aee3e708207813da3e803911a844ff3e52b
(cherry picked from commit 6424d17a2d)
Bug: 73175642
Test: Add proto.canonical_path_from_root: true in a cc_defaults
Test: Add proto.canonical_path_from_root: true in a java_defaults
Merged-In: I9ddfc8af0025705a34b6e487225f1f98915054c3
Change-Id: I9ddfc8af0025705a34b6e487225f1f98915054c3
* changes:
Allow VNDK extensions under vendor or device
Add unit tests for android/neverallow.go
Extract failIfErrored() to android/testing.go
RemoveFromList() should remove all matches
Add unit tests for android/util.go
extract_srcjars.sh uses zipinfo and unzip, which fail with an
error on an empty zip file. Instead of trying to hack around
this (which is hard to make guarantees for since they are
non-hermetic host tools), replace them with a go tool to unzip
a set of zip files into a directory.
Bug: 73885582
Test: m checkbuild
Change-Id: I151fed347ed5196726e36866ffc27bc831799afb
Merged-In: I151fed347ed5196726e36866ffc27bc831799afb
(cherry picked from commit 436b76564d)
Turbine doesn't need extract_srcjars.sh, just pass the source jars
with --source_jars.
Bug: 74339924
Test: m checkbuild
Change-Id: Ie7fe06f5a9f5e29287cf79c2d46b23a676a03d41
Merged-In: Ie7fe06f5a9f5e29287cf79c2d46b23a676a03d41
(cherry picked from commit 6981f658ef)
GlobFiles had allowed results to be anywhere in the source tree,
restrict it to results within the current module directory.
Then use it for ExpandSources and other places where we only want files.
This fixes using '*' in cc_test's `data` property, which can only
support files.
The only thing this changes today is that java_resource_dirs and
java_resources no longer pass directories to soong_zip's -f argument.
core-libart previously added some icu directories, now it only passes
files.
Bug: 71906438
Test: only expected changes in out/soong/build.ninja
Test: add data: ["**/*"] to a cc_test, build successfully
Change-Id: Iff1bd8c005a48e431c740706d7e23f4f957d8b1d
We prefer not to use absolute paths in modules, but to reference modules
that have associated paths. This a few benefits:
* it's easier to move a module than to update all the references
* if the module doesn't exist, we treat it as a normal missing
dependency, not having to deal with the missing dependency in path.go
* implementing visibility(etc) in the future would be simpler if there
was a module attached to the reference, so we don't have to do various
path-based lookups to try and match things up.
So define a `droiddoc_template` module, which takes a path, and will run
the glob once in that module. All of the `droiddoc` modules can then
specify it through the `custom_template` property, which will pull the
necessary data.
Also fix that htmldirs should be references from the local path, the
htmldir2 argument never being specified, and complain if more than two
htmldirs are specified, or if the custom template isn't specified.
Test: m core-docs
Test: out/soong/build.ninja is nearly identical
- line numbers in comments
- adds directories to droiddoc template dependency lists, which
is more correct, since we need to rerun on added or removed
files too.
Change-Id: Iff630bddb3818b8eeed439de7e41fc7fbe7cdcb0
* changes:
Use PathForSource instead of PathsForSource
Move AllowMissingDependencies check from PathsForSource to PathForSource
Pass nil instead of []string{} to ctx.Glob* functions
This reapplies If1690a708393964d3030cb908beaf7b6897c0084.
PathForSource does the AllowMissingDependencies check now, use it
instead of PathsForSource.
Test: m checkbuild
Change-Id: I84868c92ee43779f9b5c8b285dac92f5f87b018c
This reverts commit 9d37831dd3.
Reason for revert: Broke builds with ALLOW_MISSING_DEPENDENCIES=true
Change-Id: Ibff79642f747b83364c83d6b298334121028e02d
* changes:
Use PathForSource instead of PathsForSource
Move AllowMissingDependencies check from PathsForSource to PathForSource
Propagate errors out of validatePath
Add t.Run and t.Helper to paths_test.go
Remove unused intermediates parameter from ExistentPathForSource
Historically, we've always passed '-I .' as the first argument to
protoc, essentially treating all proto file package names as their full
path in the android source tree. This would make sense in a monorepo
world, but it makes less sense when we're pulling in external projects
with established package names.
So keep the same default (for now), but allow individual builds to opt
into using local paths as the default names with
'canonical_path_from_root: false'. A cleanup effort and/or large scale
change in the future could change the default to false.
As part of this, run protoc once per input proto file, since the flags
may need to change per-file. We'll also need this in order to specify
--dependency_out in the future.
Bug: 70704330
Test: aosp/master build-aosp_arm.ninja is identical
Test: aosp/master soong/build.ninja has expected changes
Test: m
Test: Build protobuf test
Change-Id: I9d6de9fd630326bbcced1c62a4a7e9546429b0ce
Add support for android_library_import modules that take an
aar file.
Bug: 73724997
Test: m checkbuild
Change-Id: I670b56f0a3b7501d9478a6064a04d0cb9c1bb611
PathForSource does the AllowMissingDependencies check now, use it
instead of PathsForSource.
Test: m checkbuild
Change-Id: If1894fd98d8d757ebc3c1635d5fcea86f81bfc4a
Add -I arguments to the aapt link command line if sdk_version is
set to a numbered SDK prebuilt jar.
Test: m checkbuild
Change-Id: Ieeadf84bc131ba94e0e4ee1b9eec7d1e80b31b19
Support Droiddoc to Soong based on core/droiddoc.mk. The non-std doclet
based droiddoc compilation output is a "real" stubs.jar instead of a
directory of java files and a timestamp file.
The std doclet based javadoc compilation output is a "empty" stubs.jar
instead of a timestamp file.
The stubs.jar will be exported to
out/target/common/obj/JAVA_LIBRARIES/$(LOCAL_MODULE)_intermediates/classes.jar
and out/target/common/docs/$(LOCAL_MODULE)-stubs.jar
A $(LOCAL_MODULE).zip file will be generated also, and is exported to
out/target/common/docs/$(LOCAL_MODULE)-docs.zip if property: installable is not set
to false.
Bug: b/70351683
Test: unittest + convert libcore docs Android.mk to Soong manually.
Change-Id: I1cffddd138a5d9d445f86a3d4a3fd4de88a2bc0f
(cherry picked from commit 78188ec622cb1ee24171455867fc58ffab91562e)
This reverts commit 606e9de344.
Reason for revert: <try to fix the broken build yesterday>
Change-Id: I2963b9af63c7c7398159e5e9a1e448266e1c81d5
Test: unittest
Rsp files are supported through helper script (gen-kotlin-build-file.sh)
that generates the kotlinc module/build xml file.
Since rsp files are supported, I've added ExtractSrcJarsCmd step
to handle srcjars extraction.
Minor reorderings to make sure that TransformKotlinToClasses
recives only .java and .kt files when called from Module.compile.
Bug: 73281388
Test: make -j hidl-doc
Change-Id: I5a40b914569018dc529903a7f2864a5aeae838e5