Instead of using `x := $(x) foo`, make sure `x` is initialized first,
then use `x += foo`.
For a aosp-master/aosp_crosshatch-userdebug build, this takes the build
from 49s to 33s (no significant difference in peak memory)
Bug: 158488548
Test: build-aosp_crosshatch.ninja is the same before/after
Change-Id: I41fb7611030dd3ba824f896a9c9eadbdd218f464
The first component is the apex name, or a special name "platform"
if the boot jar is a platform jar rather than a part of some apex.
This is a prerequisite change for moving core-icu4j to a separate
com.android.i18n apex.
Old one-column format is still supported, but all unqualified
components of PRODUCT_BOOT_JARS get "platform:" prepended to them
after reading the product makefiles.
Test: aosp_walleye-userdebug boots
Bug: 138994281
Change-Id: I0f79c7d10477880ca65354251a5d1ca0b7ce79ab
Current information is not enough if the prebuilt modules are depend on
AAR libs Therefore, AIDEGen has to collect the classes.jar of the
prebuilt modules from build system.
Build module-info.json without this change:
Build time: 1m55.001s
File size: 14,918,354 Bytes
Build module-info.json with this change:
Build time: 1m56.292s
File size: 15,577,031 Bytes
Bug: 132768299
Test: 1. Checkout the internal master branch
2. Patch this CL
3. m -j out/target/product/generic_x86_64/module-info.json
4. Open the module-info.json
5. For verifying soong_java_prebuilt.mk, check the classes.jar of
module prebuilt-google-play-* exists.
e.g.
"prebuilt-google-play-...": {
...
"classes_jar": [
"out/target/common/obj/JAVA_LIBRARIES/
prebuilt-google-..._intermediates/classes.jar"
]
}
5. For verifying java_prebuilt_internal.mk, check the classes.jar
of module ink exists.
e.g.
"ink": {
...
"classes_jar": [
"out/target/common/obj/JAVA_LIBRARIES/ink_intermediates/
classes.jar"
]
}
Change-Id: I09518c92260db47d2686493fa13951f316159d13
After I25163e91886cea6941afa25cdb529ed053278dcb there is no longer
a dependency on $(LOCAL_BUILT_MODULE) for boot jars, as boot.art
is installed instead. Add a dependency from boot.art to
$(LOCAL_BUILT_MODULE) so that $(LOCAL_BUILT_MODULE) and its
dependencies (which may include jacoco-report-classes.jar) is
copied for every build.
Fixes: 127702563
Test: forrest
Change-Id: I4db2d1f5fe2e1141fe93317cd7a2a58a33f8fbff
Hiddenapi rules are now in build/soong/java/hiddenapi_singleton.go.
This effectively requires any module in PRODUCT_BOOT_JARS to be
defined in Soong.
Bug: 123645297
Test: m checkbuild
Change-Id: If72bd1c20b2014d0a3d400624d37fdb0a3052245
TARGET_BUILD_APPS sets TURBINE_ENABLED := false, which triggers
an issue where a dependency is added on classes-header.jar but
there is no rule to create it. Skip creating the dependency
when TURBINE_ENABLED is false for now.
Bug: 123183568
Test: m TARGET_PRODUCT=mainline_modules_arm UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true TARGET_BUILD_APPS=com.android.media
Change-Id: I8ec3e244b8f9618c58f4ac57329a5a07f01dc797
Perform hiddenapi CSV generation and dex encoding for Soong modules
in Soong. This fixes an issue where dexpreopting was happening on
a different jar than was being installed.
Bug: 122856783
Test: m checkbuild
Change-Id: I24a235c63ff62fed7e1af9f2fd17e55b0c1598a5
Simplify importing Soong modules into Make by always copying
LOCAL_PREBUILT_MODULE_FILE to LOCAL_BUILT_MODULE, which lets
Soong pick the final output file instead of trying to figure
out which of the various intermediate files should be the
output file.
Also fixes an issue where hostdex modules could attempt to
copy to both $(common_javalib.jar) and $(LOCAL_BUILT_MODULE),
which are the same file for host java modules.
Test: set compile_dex:true on core.platform.api.stubs. no warnings
of target overriding
Test: m checkbuild
Change-Id: I2e089012436fe8649db82a673d446d1c5a73a731
Simplify importing Soong modules into Make by always copying
LOCAL_PREBUILT_MODULE_FILE to LOCAL_BUILT_MODULE, which lets
Soong pick the final output file instead of trying to figure
out which of the various intermediate files should be the
output file.
Also fixes an issue where hostdex modules could attempt to
copy to both $(common_javalib.jar) and $(LOCAL_BUILT_MODULE),
which are the same file for host java modules.
Test: set compile_dex:true on core.platform.api.stubs. no warnings
of target overriding
Test: m checkbuild
Change-Id: Id84d499a0869961be5a906d8472b75b9c843b4b4
Only dex jars should be installed, make it an error to not provide
a dex jar for an device installable java module.
Bug: 122831369
Test: m checkbuild
Change-Id: I99c5738e6053fbaa3dd22406f50b7a002555702c
Building $OUT/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar
is no longer updating the common intermediates:
out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar
out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/classes.jar
after I25163e91886cea6941afa25cdb529ed053278dcb. Add the missing
dependency on common javalib.jar, which already depends on common
classes.jar.
Bug: 119412419
Bug: 121194944
Test: rm out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/classes.jar &&
m core-tests &&
ls out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/classes.jar
Change-Id: Id463d159e46c82656c364fdb2dbe53f33ee1a103
Don't create the install rules for boot.art when WITH_DEXPREOPT
is not set to true, which will ensure there is no dependency on
boot.art in a normal build, which matches the behavior before
I25163e91886cea6941afa25cdb529ed053278dcb.
This should fix the Mac build, which never sets WITH_DEXPREOPT
and does not support running dex2oat.
Bug: 119412419
Bug: 121130576
Bug: 121183382
Test: lunch aosp_sailfish-eng && m WITH_DEXPREOPT=false
files does not depend on out/target/product/sailfish/dex_bootjars/system/framework/arm/boot.art
Change-Id: I39e96b1f35f6808d3007cf1785ec3db89e0decb6
Move the dexpreopting logic into Soong. Make modules will be
dexpreopted by executing the Soong logic in the standalone
dexpreopt_gen binary, which will generate scripts that will
perform dexpreopting for each module. Export global configuration
as JSON to $OUT/dexpreopt.config, which will be used by
dexpreopt_gen and Soong, and per-module JSON configuration that
will be used by dexpreopt_gen.
This relands I59b20c931ee3e5a8d35eb30da4148691c5095502,
I39d580999947ee54cfefe875b57a028be5333bd7,
Ie7daa94e107d53eff075ca58dbe721bd9d7fc8c2 and
Ica006a007d112c232311435aaac0c0e476232b67, with a minor
update to match the changes made to dexpreopt_gen arguments
and a fix to correctly keep dexpreopt disabled on mac builds.
Bug: 119412419
Bug: 120273280
Test: no differences to dexpreopt outputs on aosp_sailfish system/,
only expected changes to dexpreopt outputs on system_other
(.vdex files for privileged Soong modules no longer incorrectly
contain .dex contents).
Change-Id: I25163e91886cea6941afa25cdb529ed053278dcb
Move the dexpreopting logic into Soong. Make modules will be
dexpreopted by executing the Soong logic in the standalone
dexpreopt_gen binary, which will generate scripts that will
perform dexpreopting for each module. Export global configuration
as JSON to $OUT/dexpreopt.config, which will be used by
dexpreopt_gen and Soong, and per-module JSON configuration that
will be used by dexpreopt_gen.
Bug: 119412419
Bug: 120273280
Test: no differences to dexpreopt outputs on aosp_sailfish system/,
only expected changes to dexpreopt outputs on system_other
(.vdex files for privileged Soong modules no longer incorrectly
contain .dex contents).
Change-Id: I59b20c931ee3e5a8d35eb30da4148691c5095502
Combine existing hiddenapi-* txt files into a single CSV containing
a list of all class members and their corresponding flags.
Test: m, phone boots
Change-Id: I67f1b5f331b262e9b681d9a3c78c9e4cbb5ea082
Previously, all the UnsupportedAppUsage annotations were assumed to be
in the same target as was used at runtime. e.g. frameworks,
core-libart, etc. This change allows separate targets to be specified
in the EXTRA_HIDDENAPI_JARS. It is needed to avoid maintaining local
patches for those annotations in the libcore/ojluni/src/main/java code
which comes from upstream OpenJDK.
This was tested by making and then manually checking that the generated
out/target/common/obj/PACKAGING/hiddenapi-light-greylist.txt was the
same (after sorting) before and after this change.
Test: see above
Bug: 117818301
Change-Id: Icfadbe52601371f6a4cabef106750b16f6c6d4c8
Store the path to the AAR file from Soong so that it will be picked
up by dist if requested in TARGET_BUILD_APPS.
Test: m checkbuild
Change-Id: Ifeaf2b5ca3f405fbe79a966ceee9989a38d77f6e
nostripping causes confusing double negatives, allow nostripping
in LOCAL_DEX_PREOPT and DEFAULT_DEX_PREOPT, but convert to
LOCAL_STRIP_DEX outside of dex_preopt_odex_install.mk.
Test: m checkbuild
Change-Id: I996e9258ce20c394900d9fe937d638bc2ab8589d
Also add support for merging these into a single file elsewhere in the
build.
Test: m, inspect generated greylist.csv
Bug: 117314178
Change-Id: If28110fc1ed090222e55c274e8363110753d10f1
Currently, we support maxTargetSdk values of 26 & 28, corresponding to
the P blacklist (existing dark grey list) and upcoming Q blacklist.
For now, just put the two into the same list, as the runtime support to
distinguish between the two does not exist yet.
Bug: 114361293
Test: m
Change-Id: I2f8d206e8dd22afc6c0e98fb5e53b1d78a534125
Libcore has support for annotating a virtual method which is known
to change its return type in a future release. This annotation is
recognized by the dexer and a future-proof bridge method is created.
This patch integrates changes in class2greylist to support this
annotation into the build system and generation of hidden API lists.
Calling class2greylist on each boot classpath module now produces two
text files instead of one: signatures for greylisting and now also
whitelisting. They are passed on to the hidden API list generating rules
in frameworks/base.
Bug: 112186571
Test: m appcompat, diff public-list.txt whitelist.txt
Change-Id: I9861203e6e07a17d50850892ec13880971457d11
soong_to_convert looks for modules with no unconverted deps, but
the list of converted modules was not being updated for java and
app prebuilts. That meant soong_to_convert only reported modules
with no deps at all.
Test: examine soong_to_convert.txt
Change-Id: I136e6fa74153a80df5ecd767642bb2feb2ddb9dc
Soong droiddoc modules were using soong_java_prebuilt.mk, but they
don't need any of the java logic from it, and it includes
base_rules.mk which was not included by droiddoc.mk. Add
soong_droiddoc_prebuilt.mk that just installs the droiddoc
outputs without including base_rules.mk.
Fixes building docs modules in mm, mma, and m checkbuild.
Bug: 112388925
Test: m docs
Change-Id: I4f7262e2c3b1afbee44c1cc306330885b687a074
Uses the new class2greylist tool to extract API descriptors from .class
files.
Also add these generated greylist.txt files as dependencies of
INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST so they can be merged later in
the build.
Bug: 110868826
Test: m
Change-Id: I406587732b537f9b56768ad9909039dfab34c334
So that we can start restricting non-phony targets to $OUT_DIR and
$DIST_DIR.
Test: add --writable=out/, see fewer warnings
Change-Id: I411fe4af732b1bce35d4a4c1e2a47b5f8a15e6b8
The soong_java_prebuilt.mk file used to assume that if a Soong module
defines a dex jar, it is the output of the module and the module is
installable. This may now not be true if the module uses 'compile_dex'
to define a secondary build rule for a dex jar. If the module is not
installable (LOCAL_UNINSTALLABLE_MODULE=true), do not attempt to preopt
and copy classes.jar to the modules output destination.
Bug: 79409988
Test: on related CL
Change-Id: Ica958ac793e09a0e52125448b44e7cd36e7f35d5
A java module exports SDK library names that it is using directly or
indirectly via its dependencies. Manifest fixer uses the SDK lib names
to automatically add <uses-library> tags for the apk.
The SDK library names are exported via exported-sdk-libs file in make.
From Soong, they are exported via LOCAL_EXPORT_SDK_LIBRARIES flag.
Bug: 77575606
Test: m -j
Change-Id: I4e7a9bdc5bf845af85168abf55f8063900bacc72
Pass LOCAL_STATIC_ANDROID_LIBRARIES to ManifestMerger, and copy
manifests for prebuilts AARs and static android libraries to
$(intermediates.COMMON)/manifest/AndroidManifest.xml.
Bug: 78447299
Test: m java
Change-Id: I02ac29d3445fcd591101ff0ce215e60dd0997224
Merged-In: I02ac29d3445fcd591101ff0ce215e60dd0997224
Merged-In: Ib20aa4849978283f1da1ce601b28199fc0183e05
If a static android library lib1 has LOCAL_STATIC_ANDROID_LIBRARIES
lib2, then the R.class files for packages in lib2 will be merged
into the jar for lib1. If an app has lib1 in its
LOCAL_STATIC_ANDROID_LIBRARIES it will get the R.class files from
lib2 through lib1, instead of regenerating the R.java files with
numbering that matches the resource table of the app.
This was worked around for support libraries by keeping a
fix_dependencies.mk that added transitive static support libraries
to the direct static dependencies of apps. Instead, propagate
the packages that aapt2 generated R.java files for up as
--extra-packages arguments to the next aapt2 invocation, which
will force aapt2 to regenerate the R.java files for those packages.
Bug: 78300023
Test: m checkbuild
Change-Id: I7375e13241b4c4f2933032409fb7935abe133bfc
Soong uses lists of proguard flags files from dependencies instead
of a single concatenated file. Allow Soong to pass the list to
make, which will concatenate it.
Move the check inside ifdef LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE
in case Soong exports an Android library with an empty
LOCAL_SOONG_EXPORT_PROGUARD_FLAGS.
Bug: 73724997
Test: m checkbuild
Change-Id: Ia8f229ec5f9fc99a23bd471dfa70c9de7316de94
Old droiddoc will install the *-docs.zip & API files to the dist.
And also remove INTERNAL_PLATFORM_*API_FILE variables from config.mk and
get rid of the dependencies on api-stubs, system-api-stubs, test-api-stubs
timestamp.
Test: m -j api-stubs-docs
Bug: b/70351683
Change-Id: I08923bb5f62d2f55961d9a2865723d7b3fae7206
Merged-In: I08923bb5f62d2f55961d9a2865723d7b3fae7206
Modules from Soong do not have dependency specified (via
LOCAL_JAVA_LIBRARIES). So, link-type check 'from' them doesn't make
sense. Resetting my_warn_types and my_allowed_types
Bug: 69899800
Test: m -j checkbuild on aosp_walleye, aosp_sailfish
Test: build/soong/build_test.bash --dist
Change-Id: I2a409e64f388bd8cb9336be589bf6af33e48a6f4