Define non_system_module in base_rules.mk when the module is product, vendor,
product_services or proprietary module.
Bug: 74699609
Test: m -j
Change-Id: Iebdd3ec8c643be3d9877b7a96cbdd83465fa3878
The strip rule does not need to wait for the boot image to finish,
create a separate DEXPREOPT_STRIP_DEPS list that only contains
tools used by GenerateStripRule in build/soong/dexpreopt/dexpreopt.go.
Bug: 123038675
Test: m checkbuild
Change-Id: I0814c8d99781533f5778e14547d3e9671e06317f
Dump the list of APKs that aren't located at system partition and signed
with system certificate.
And when enforcement option is enabled, it makes build error if there is
the apk that satisfies the condition above.
Bug: 74699609
Test: m -j
Test: m out/target/product/$(get_build_var TARGET_DEVICE)/certificate_violation_modules.txt
Change-Id: I23c41f2665dd97abac3e77d1c82d81ff91b894eb
It is a list of <module_name>:<manifest_name> pairs. When the module
name of an APK or an APEX matches with <module_name>, then its app
manifest name is overridden to <manifest_name>.
<module_name> and <manifest_name> can be patterns as in
com.android.%:com.mycompany.android.%.release
Test: m with PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES for
1) an APK in Android.mk
2) an APK in ANdroid.bp
3) an APEX
and check that manifest names are modified as specified
Change-Id: Ic09e059ea7b7ea99a50a1cf423a25aa587ef4466
Data Binding only works as part of tools. It also only builds there
(in studio-master-dev branch). This CL removes references to the data
binding checkout which will be followed by removal of data binding
from master manifest.
Bug: 122478832
Change-Id: I338cc1aa10a5ad39114bc0ed14a529365016e9a4
strip.sh uses $2.d to write the depfile, while this had been passing in
$@.tmp in as $2. Instead, move the file first, then use strip.sh with
the real output file so that we can find the depfile.
Also don't specify a depfile (or other dependencies) when
LOCAL_CERTIFICATE==PRESIGNED, as we'll skip all of that in the rule in
that case.
Bug: 121058584
Test: NINJA_ARGS="-w missingdepfile=true" m
Change-Id: I1323e775e3a6ce5a06a19d59f3fb07495f116f34
Mainline modules are tightly coupled to the platform, and should
build against the current SDK from source and not prebuilts. Add
a flag UNBUNDLED_BUILD_SDKS_FROM_SOURCE to specify that a
TARGET_BUILD_APPS build should build the current SDK instead of
using the prebuilts.
Bug: 121194841
Bug: 121231426
Test: no change to out/build-aosp_sailfish.ninja
Test: forrest unbundled build
Test: forrest master apps build
Test: forrest mainline modules build
Change-Id: I9ebc08745409a817d831817cb282aba1de6d81bb
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
$(align-package) uses $(ZIPALIGN), add it as a dependency to the
rule.
Bug: 119403628
Test: rm out/host/linux-x86/bin/zipalign && m out/target/product/sailfish/obj/APPS/SystemUI_intermediates/oat/arm64/package.odex
Change-Id: Iffc9506fd3168481ad998c5d8423ed4e13e6d11b
Only attempt to zip2zip the bundle parts/res.zip if it was created
because of full_classes_jar or PRIVATE_EXTRA_JAR_ARGS.
Bug: 117295826
Test: m dist on unbundled target with no resources or classes
Change-Id: I6072b29c7331201f33d196c24154f9947b4b0053
This reverts commit afc4604f67.
Reason for revert: zip2zip fails for multiple resources with the same name in different directories
Bug: 117295826
Change-Id: I807dffdaced999b5514ff49fb732a461c1fc90a2
Create a bundle module in addition to creating an APK, which can
then optionally be merged with bundle modules from builds for
other architectures and then be passed to bundletool to create an
app bundle.
Bug: 117295826
Test: tapas Gallery2 && m dist
Change-Id: Ib9b5558888d6d6e841e8a5dcd7037dd0fd65a730
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
Unzipping and rezipping files causes the umask of the host machine
to affect the permissions in the APK. Use the new zip2zip -0 feature
to rewrite the zip file with selected files uncompressed.
Bug: 69500920
Test: m checkbuild
Change-Id: I82dd3aa441712772a1d1ddd6aaf5f41179facaa7
$OUT/obj/APPS/SystemUI_intermediates/package.dex.apk was not being
written after being converted to Soong. Add a copy rule for it
to soong_app_prebuilt.mk, add it as an implicit output to the Make
rules that create it, and add it as a real dependency to the
platform.zip rules.
Test: m platform
Change-Id: I96f58d3d80b764a51a6acb87e92498589cfe5c18
$(HOST_OUT)/obj/PACKAGING is cleaned via `installclean`, so regular
built modules should not be depending on it. Explicitly call out the
dependencies instead.
Test: m; m installclean; m
Change-Id: I0f318257e4742d6b7bd099dc06958ca8aba0cfb8
zip maintains permissions when adding files to zips, which causes
the final jars and apks to change based on the umask of the build.
Move some of the rules that were using zip to soong_zip instead.
Since soong_zip doesn't support adding files to existing zips,
create a new zip file for each part of the package creation
process and then merge them together at the end with merge_zips.
Bug: 69500920
Test: m checkbuild
Change-Id: Id253df776ce19ec4cac3a36fa470a50461ea3cad
In preparation for rearranging the way jars and apks are built.
Relands Ib9f0da132196942062c58fd5b12e84588106724e with a fix to
correctly include classes.dex in hostdex jars.
Test: m checkbuild
Change-Id: I397544456b8ce5827716fcd1828de707b719c2bb
Attempting to reduce the number of different spellings we have for
"product services" partition in the codebase.
Bug: 112431447
Test: m
Change-Id: I6debd3f5f5abc4bd1e22f2ef11c5fe131915976c
Merged-In: I6debd3f5f5abc4bd1e22f2ef11c5fe131915976c
Also add some more relevant information at the beginning of each report,
to make triaging of the reports easier.
To test this I declared ExactCalculator as
LOCAL_PRODUCT_SERVICES_MODULE, and this is the resulting log:
"""
Package name: com.android.calculator2
Module name in Android tree: ExactCalculator
Local path in Android tree: packages/apps/ExactCalculator
Install path on aosp_marlin-eng: out/target/product/marlin/system/product-services/app/ExactCalculator/ExactCalculator.apk
appcompat.sh output:
NOTE: appcompat.sh is still under development. It can report
API uses that do not execute at runtime, and reflection uses
that do not exist. It can also miss on reflection uses.
1: Reflection light greylist Landroid/os/Bundle;->getIBinder use(s):
Landroid/support/v4/app/BundleCompat$BundleCompatBaseImpl;->getBinder(Landroid/os/Bundle;Ljava/lang/String;)Landroid/os/IBinder;
2: Reflection light greylist Landroid/view/View;->mAccessibilityDelegate use(s):
Landroid/support/v4/view/ViewCompat$ViewCompatBaseImpl;->hasAccessibilityDelegate(Landroid/view/View;)Z
3: Reflection light greylist Landroid/view/View;->mMinHeight use(s):
Landroid/support/v4/view/ViewCompat$ViewCompatBaseImpl;->getMinimumHeight(Landroid/view/View;)I
4: Reflection light greylist Landroid/view/View;->mMinWidth use(s):
Landroid/support/v4/view/ViewCompat$ViewCompatBaseImpl;->getMinimumWidth(Landroid/view/View;)I
4 hidden API(s) used: 0 linked against, 4 through reflection
0 in blacklist
0 in dark greylist
4 in light greylist
To run an analysis that can give more reflection accesses,
but could include false positives, pass the --imprecise flag.
"""
Test: m (also on internal)
Bug: 110073830
Change-Id: I5114f51d1ab163e954fcffb159ef335abc289cf6
Unbundled app builds do not build the framework, only apps against
the prebuilt public API. Running veridex from the local tree does,
however, depend on the framework to generate the list of non-SDK
APIs. Disable veridex on such builds and remove appcompat.zip from
artifacts.
Test: make ANDROID_BUILDSPEC=vendor/google/build/app_build_spec.mk
Change-Id: I16289adc7fc660109d61260e8a49e992228e727c
This CL is largely an adaptation of Change-Id
I774e6a38003734421591e51bed103802ff84f432
It adds the following variables:
- BOARD_AVB_PRODUCT_SERVICES_KEY_PATH
- BOARD_AVB_PRODUCT_SERVICES_ALGORITHM
- BOARD_AVB_PRODUCT_SERVICES_ROLLBACK_INDEX_LOCATION
- BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE
- BOARD_PRODUCT_SERVICESIMAGE_EXTFS_INODE_COUNT
- BOARD_PRODUCT_SERVICESIMAGE_EXTFS_RSV_PCT
- BOARD_PRODUCT_SERVICESIMAGE_PARTITION_SIZE
- BOARD_PRODUCT_SERVICESIMAGE_JOURNAL_SIZE
- BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_BLOCK_SIZE
- BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR
- BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR_OPT
- BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_DISABLE_4K_ALIGN
- BOARD_PREBUILT_PRODUCT_SERVICESIMAGE
- BOARD_USES_PRODUCT_SERVICESIMAGE
- LOCAL_PRODUCT_SERVICES_MODULE
- PRODUCT_PRODUCT_SERVICES_BASE_FS_PATH
- PRODUCT_PRODUCT_SERVICES_VERITY_PARTITION
- PRODUCT_PRODUCT_SERVICES_PROPERTIES
- TARGET_COPY_OUT_PRODUCT_SERVICES
- TARGET_OUT_PRODUCT_SERVICES
- TARGET_OUT_PRODUCT_SERVICES_*
Bug: 80741439
Test: Successfully built product-services.img with one module in it, and flashed
on device. Also successfully built image with /system/product-services directory
and no /product-services partition.
Change-Id: I5d229f6ac729ea6df9ff1f14cee2e28972cd9b4d
The output of the appcompat tool is store on $(PRODUCT_OUT)/appcompat.
Bug: 110073830
Bug: 78924201
Test: m
Change-Id: Ia77cc53fc241a048958cf243ba298298f800f933
LOCAL_STATIC_JAVA_AAR_LIBRARIES are slightly different from
LOCAL_STATIC_ANDROID_LIBRARIES, due to b/78447299 the
AndroidManifest.xml from ANDROID libraries are ignored.
Temporarily add support for LOCAL_STATIC_JAVA_AAR_LIBRARIES
when using LOCAL_USE_AAPT2 := true, treating them the same
as LOCAL_STATIC_ANDROID_LIBRARIES except that they are
merged by android_manifest.xml
Bug: 78447299
Bug: 79481102
Test: m FORCE_AAPT2=true checkbuild
Change-Id: Ia6210810c1ea6e776be97ae1c9a586b5de844125
The presence of LOCAL_STATIC_ANDROID_LIBRARIES is used early to
decide whether to move resources to overlays, and late to decide
whether to add --auto-add-overlay. If support_libraries.mk moves
the last LOCAL_STATIC_ANDROID_LIBRARIES value to
LOCAL_STATIC_JAVA_LIBRARIES then the resources will be moved to
overlays but --auto-add-overlay will not be added, causing aapt2
to fail with:
error: resource bool/leanback_outline_clipping_disabled does not override an existing resource.
note: define an <add-resource> tag or use --auto-add-overlay.
Bug: 79481102
Test: m FORCE_AAPT2=true java
Change-Id: Icc67acf23b846bd506a5d397d02ad5775ad0ea1d
Fix some incorrect dependencies after I12d33e52019aebac6ea33271939228e4690a4173.
Bug: 73885582
Test: m java FORCE_AAPT2=true
Change-Id: Ica2758991603e1605f629d843d19df5e2ef4fae1
Renderscript was using LOCAL_RENDERSCRIPT_TARGET_API := 0 to mean
current. Use current instead, and check for it when comparing
if LOCAL_RENDERSCRIPT_TARGET_API >= 21.
Fixes an issue where LOCAL_RENDERSCRIPT_TARGET_API := 0 was being
treated as < 21, causing the renderscript resources to be passed
to aapt2:
out/target/common/obj/APPS/RSTestBackward_intermediates/flat-res/zip_res.flata.contents/raw/bc32: error: resource file cannot be a directory.
Bug: 79481102
Test: m java FORCE_AAPT2=true
Change-Id: I7726d0463ce1693bc9653b4d869ced181c491036
Building with FORCE_AAPT2=true will turn on AAPT2 for all modules
unless they set LOCAL_USE_AAPT2 := false. The build system will
attempt to rewrite common AAPT patterns into AAPT2 patterns,
including removing --extra-packages for support library packages,
removing LOCAL_RESOURCE_DIR point to support library resources,
adding a default empty manifest file if it doesn't exist, and
converting LOCAL_STATIC_JAVA_AAR_LIBRARIES to
LOCAL_STATIC_ANDROID_LIBRARIES.
Bug: 79481102
Test: m checkbuild
Change-Id: I8d9d55fe4d5d5c965c64b0407efe74e0afc35c3a
This file has been copied into a 'public' subdir. Use that, so that
the old file can be deleted. Also introduce a new macro to avoid
duplicating this path in a bunch of places.
Bug: 77525052
Test: m checkbuild
Change-Id: Ifcf59c6fb357769b2765e417c8dd56d2ad9b97aa
Dumping files in the *_intermediates/src causes incremental build
problems, because we don't know when to delete them if they are
no longer generated. Switch to outputting a srcjar instead, and
pass it in to the turbine and javac compiles.
Bug: 73885582
Test: m checkbuild
Change-Id: Ibef28507522339d930c09426d0c98372eb864cb6
Merged-In: Ibef28507522339d930c09426d0c98372eb864cb6
(cherry picked from commit 2d1cddd567)
aapt2.mk will export a srcjar that will be compiled by java.mk, so
it needs to be evaluated first. Also move java_renderscript.mk
before aapt2.mk so that the generated resoures are available.
Bug: 73885582
Test: m checkbuild
Test: rm -rf out/target/common/obj/APPS/RsHelloCompute_intermediates &&
m out/target/common/obj/APPS/RsHelloCompute_intermediates/src/R.stamp
Change-Id: Ide3050ec993a945f7077b75e952c3b3532306ede
Merged-In: Ide3050ec993a945f7077b75e952c3b3532306ede
(cherry picked from commit 8528eabbba)
renderscript_target_api is set by java_renderscript.mk, it doesn't
need to be computed again in static_java_library.mk and
package_internal.mk.
Bug: 73885582
Test: no change to ninja file
Change-Id: Ib6e00be425c385f4911def19ed5042a740f2c79b
Merged-In: Ib6e00be425c385f4911def19ed5042a740f2c79b
(cherry picked from commit 55cce23360)
Replace RenderScript.stamp with a srcjar, with a resource zip as
an implicit output. This makes the renderscript rules self contained,
which will make it easier to move them before aapt.
Bug: 73885582
Test: m checkbuild
Change-Id: I12d33e52019aebac6ea33271939228e4690a4173
Merged-In: I12d33e52019aebac6ea33271939228e4690a4173
(cherry picked from commit e00e2fae52)
Allow java modules to take jars containing .java files as an input.
For turbine, pass them directly to turbine. For javac, extract them
to a directory and pass a list of the files to javac.
Bug: 73885582
Test: m checkbuild
Change-Id: Ib4351a5b4b165a55e5fb02ee2680466db368983a
Sharding is not used in make any more, the large java modules
(libcore and framework) have moved to Soong. Keeping sharding
support complicates java compiling, so remove it.
Bug: 73885582
Test: m checkbuild
Change-Id: I2932f9e96bfc8f2ebf82095b16d6c0b3c51613f0
The aapt flags were being set in java_common.mk, which is used by
various entry points. host_dalvik_java_library.mk and
host_java_library.mk, and java_library.mk don't support aapt, only
package_internal.mk and static_java_library.mk do. Move the aapt
flags into aapt_flags.mk, and include it from package_internal.mk
and static_java_library.mk.
Bug: 73885582
Test: no change to build-${TARGET_PRODUCT}.ninja
Change-Id: I124393846d37b9bbc941272cce4274121ac235ef