Desugar default methods if requested by LOCAL_MIN_SDK_VERSION < 26.
Also remove --desugar_try_with_resources_if_needed=false, it is no
longer necessary if we always proguard against frameworks.jar.
Fixes d8 issues when it sees unexpected default methods that dx
was passing through.
This reapplies I81796b452d5a70a951e175727953d4295ca32c0c after
If30943efcaea44b2db1b38a6c1d558113324757f.
Test: m checkbuild
Change-Id: I3bafbb2d63de2a6b50bc8c7ff40259b54d24f128
When LOCAL_SDK_VERSION is not set, frameworks.jar is put
in the classpath for javac. If it is also in the classpath
(as opposed to the bootclasspath) for desugar then desugar
tries to rewrite classes that implement interfaces with
default methods to contain calls to the generated companion
classes for those interfaces. frameworks.jar will not
contain the companion classes, which causes proguard to
fail.
Move frameworks.jar to the bootclasspath, which matches more
closely with builds against the SDK stubs jars.
Also remove the static libraries from the classpath, they have
already been merged into the input jar.
Test: m checkbuild
Change-Id: If30943efcaea44b2db1b38a6c1d558113324757f
If anything looks like a module name instead of a path (so if it doesn't
have a / in it), forbid it from being in LOCAL_ADDITIONAL_DEPENDENCIES.
Phony modules should not be dependencies, since they're never considered
clean, and will force rebuilds. It will also force installation when
we're only attempting to checkbuild. Most of the time
LOCAL_REQUIRED_MODULES should be used instead, which will trigger the
required modules to be installed if the local module is installed.
Bug: 68042065
Test: build/soong/build_test.bash on aosp and internal
Change-Id: I058ed6734d895eba3417b1d47c7f4a6b341bc137
Jacoco normally recurses into .jar files, but we don't want it to.
Some .jar files may be intentionally corrupt test files.
Test: m -j showcommands dist EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true WITH_DEXPREOPT=false cts google-tradefed-all general-tests tests
Bug: 68056327
Change-Id: I1550e3acafd7cd9a65164742370e051d3eb3bf69
When running with R8 instead of Proguard + dx the proguard mapping is
produced together with the dex output.
Bug: 68249935
Test: m -j ahat-test
Change-Id: Ica5ef455eb3bd1eabe55c43e9e026f47cadace1c
For now, vendor build properties are added into /system/build.prop
when property split isn't enabled.
So we have the duplicate codes to add them to /system/build.prop and
/vendor/build.prop case by case.
But either /vendor/build.prop or /system/vendor/build.prop can exist
always.
So this CL will install $(TARGET_OUT_VENDOR)/build.prop always and
remove the duplication.
Bug: 68115808
Test: tested on aosp_x86-userdebug
Change-Id: Ic734418890629d011c733c2d8d14739275e64a78
Duplicate essential product sysprops for manufacturer, model, brand, name, and device
from system on vendor so that mixed builds (vendor.img + GSI system.img) have correct
product information in their CTS/VTS reports.
Test: make
Bug: 64458205
Merged-In: Ib63b37772be493b9e035d9b7e8c5e2cf66f2fa8c
Change-Id: Ib63b37772be493b9e035d9b7e8c5e2cf66f2fa8c
(cherry picked from commit aea0f92ff3)
Shipping API level is associated with the vendor image. When
a device ships in, say, O and is then run against the O-MR1
GSI image, the shipping API level is currently reported as
the shipping API level which the GSI was built with. This means
that various tests and control flows assume that the image
is the newest possible image. However, this is not the case.
Bug: 67965044
Test: boot on pixel
Merged-In: If18cc99e2599957d88860e0902a99ff3f67e5fd8
Change-Id: If18cc99e2599957d88860e0902a99ff3f67e5fd8
(cherry picked from commit 9411f9b4dc)
Desugar default methods if requested by LOCAL_MIN_SDK_VERSION < 26.
Also remove --desugar_try_with_resources_if_needed=false, it is no
longer necessary if we always proguard against frameworks.jar.
Fixes d8 issues when it sees unexpected default methods that dx
was passing through.
Test: m checkbuild
Change-Id: I81796b452d5a70a951e175727953d4295ca32c0c
The platform build system doesn't have the concept of a "compile sdk
version", it uses the "min sdk version" throughout the compilation
process. This means that no stage of the compilation process can
introduce references to APIs that do not exist in the selected
LOCAL_MIN_SDK_VERSION without causing problems. Support library
worked around this by effectively making the "compile sdk version"
"current" when running proguard if support library was in the direct
dependency list.
Extend the support library hack everywhere, and always use "current"
or the full bootclasspath when running proguard.
Test: m checkbuild
Change-Id: Iaf5853361767f0ea3e9ad4ec908aadd72d639c79
With this change building with USE_R8=true will run R8 instead of Proguard + dx
for all targets that have LOCAL_PROGUARD_ENABLED set. R8 (through the
compatproguard wrapper) will use the same options as Proguard for now.
Additional Proguard configurations for R8 can be added using LOCAL_R8_FLAG_FILES
on individual targets. This makes it possible to make configuration updates
without touching the Proguard + dx configuration
Test: m -j
Test: m -j USE_D8=true USE_R8=true
Test: m -j USE_D8=true USE_R8=false
Test: m -j USE_D8=true
Change-Id: I78e8a0fd17cc5cefedccffe95b93c94a60a727f1
Specify paths to instrument with coverage using space separated lists
instead of comma separated. This makes it easier to specify the lists in
a typical format in the device mk.
Test: add COVERAGE_PATHS to device-sailfish.mk, make -j60
Bug: 67998360
Change-Id: I26c67127d72bd7a153eb4a2c23eae4881a813d54
Make javalib.jar files copied from soong modules depend on the copied
classes.jar files.
Test: rm classes.jar && m modulename && ls classes.jar
Test: rm classes.jar && m javalib.jar && ls classes.jar
Change-Id: I5ab77960a43b07c214969834cb3472ed121c8828
ro.vndk.version property is VNDK version in vendor partition.
It is set to the value of BOARD_VNDK_VERSION at build time.
Bug: 66072863
Test: build & run
Change-Id: Iecaede005474c4179a8135cf967e5b5b5ebcb881
Print a large warning and stop unless we're using ckati. Then remove a
bunch of code that soong_ui doesn't use.
Test: command make -f build/core/config.mk
Test: . build/envsetup.sh; lunch aosp_arm-eng; m nothing
Test: cs/CALLED_FROM_SETUP
Change-Id: Ib823d5ef8955fb68dbc9a035cfa8d5ac4903534a
We have removed the 92 character limit on ro.build.fingerprint, so
there is no longer a reason to truncate ${USER} when generating
fingerprints.
Bug: 34954705
Test: boot bullhead and observe non-truncated username
Change-Id: If79bf1d5372f709c9c1725f860bc61b99e830751
The property is PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK. If specified,
this preopts the APK with the default compile filter (quicken).
This will be used to quicken preopt of gmscore dynamite modules when
preopting is disabled. This fixes a possible RAM regression caused
by running out of the APK.
Bug: 65601274
Test: make and flash
(cherry picked from commit 0fbb836cf6)
Merged-In: Ibf0fa73ee7fafd9735e587baf19c4950a7da817a
Change-Id: Ibf0fa73ee7fafd9735e587baf19c4950a7da817a
When building the recovery image on marlin (m bootimage):
----- Making recovery image ------
Copying baseline ramdisk...
Modifying ramdisk contents...
/bin/bash: line 0: [: 0x02000000: integer expression expected
----- Made recovery image: out/target/product/marlin/boot.img --------
Because if -gt doesn't like hexadecimal numbers. Fix the issue by doing
a dummy arithmetic to get integer $$maxsize.
Test: `m bootimage` with aosp_marlin-userdebug. Also change the
BOARD_BOOTIMAGE_PARTITION_SIZE closer to the actual size to
trigger the different size check paths.
Change-Id: I75c7727664d7255b9c18f57ae38076ff90b8a957
Soong has support for building system modules. Use the directories
produced by Soong with --system to replace -bootclasspath arguments
when using javac -target 1.9.
Since soong can't generate current SDK stubs yet, and no existing
SDK stubs need -target, only use -target 1.9 for modules that are
not compiling against the SDK. That means in practice the only
system modules that will be used for now is the default one,
core-system-modules.
Bug: 63986449
Test: m -j EXPERIMENTAL_USE_OPENJDK9=true makes some progress
Change-Id: I350ef50aedf36fdd72458c23d4fe8a2edf1a9a02
This time wrapped with a check for the docs directory for unbundled
branches.
Test: make checkbuild
Bug: None
Change-Id: If80f0a03850d6cad3eab6d759af02ff2a7870974
Kati seems to have some problems updating this file, and the echo
syntax gets a bit messy. So define some macros and write out the file at
eval time using $(file).
Test: multiproduct_kati -only-config, check soong.variables (on AOSP and internal)
Change-Id: I74279b962918ca1f70fb1d0d25cbb30bd5675041
So that we can use kati instead of make for the initial config loading.
Test: m clean; m nothing
Test: USE_GOMA=true m nothing
Test: m PRODUCT-aosp_x86-sdk
Test: m APP-Calculator
Test: multiproduct_kati -only-config (on AOSP and internal master)
Change-Id: I5d3af847607fa48868c2045401977eca37dc6ae1
Renamed WITH_DEXPREOPT_BOOT_IMG_ONLY to
WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY and changed the
behavior accordingly.
Preopt system server jars since selinux prevents system server from
loading anything from /data. If we don't do this they will need to
be extracted which is not favorable for RAM usage or performance.
Test: make and flash and look at system server maps
Bug: 65122284
Bug: 62356545
(cherry picked from commit 418258cee9)
Merged-In: I2e70c80a86327b455450b95144f21020e7bf0c6f
Change-Id: I316e79c7c6d45e2ccbfff4065137cc3ef9d2738e
JAVAC_WRAPPER seems not be used when SOONG_JAVAC_WRAPPER is used.
Since JAVAC_WRAPPER just wraps actual javac call, the result must
be the same.
Bug: 67723445
Change-Id: I944f9534587c00ffd1bc79806c534432467ba4a5
Adding verified boot metadata with a "disable magic". The resulting
metadata at the end of each image (e.g., system.img, vendor.img) will
be the same as triggering an "adb disable-verity" on an USERDEBUG image.
This can help simplify the code on fs_mgr, which won't have to check if
current image is an ENG build or not.
Bug: 63056044
Test: boot sailfish eng/userdebug builds
Change-Id: I95d23ac7b76c04d6d4483c9c4dc1de16bf0d9c3a
For module installed to /vendor partition, direct linking to the libs
marked as `vendor_available: false` is not allowed. The
Bug: 64730695
Test: Add vendor_available: false to libft2 and
libcompiler_rt. Add the two libs into LOCAL_SHARED_LIBRARIES of a vendor
lib (e.g. libdrm). Build fails with the link_type check error message.
Change-Id: Iaf23574ceddb0c087111e1d95997e9ddd60cdf87
This wasn't initializing the STATS.MODULE_TYPE.* variables, leading to
106kB of stack usage in ckati for sdk_x86_64-eng. With this fixed, the
next highest stack usage is 35kB.
Bug: 36182021
Test: Run $(flavor) over all the variables
Test: Check stack usage with custom ckati patches
Test: build-sdk_x86_64.ninja is identical before/after this change
Change-Id: Id1d8ffb8415ad6613d0093d31be5472d42d300fd
When limiting ckati to 768kB of stack, it would crash with a segfault
when processing this recursive expanded variable. So always use := to
turn this into a simple variable.
I measured this using 772kB of stack in ckati on sdk_x86_64-eng. With
this change, the next highest stack user is 106kB.
Bug: 36182021
Test: ulimit -s 768; lunch sdk_x86_64-eng; m nothing
Test: build-sdk_x86_64.ninja is identical before/after this change
Change-Id: I20a6396db173decf178107e3aac6cf089e541e36
When LOCAL_IS_HOST_MODULE is set LOCAL_BUILT_MODULE is the same
as common_javalib.jar, and dexpreopting shouldn't be enabled.
Bug: 67600882
Test: m -j checkbuild
Change-Id: I7397fa430ebc18d5cb6ba71b06e343180f09ae08
Dexpreopt jars from soong, which also strips classes.dex from
javalib.jar.
Test: m -j checkbuild
Test: unzip -l $OUT/system/framework/core-oj.jar
Change-Id: I06b8efa8993f6c44f0ad8c988e57a3cba08e17ad
Combining $(call dexpreopt-remove-classes.dex) into a
$(call copy-one-file) rule is hacky and error prone. Make a helper
dexpreopt-copy-jar function that takes LOCAL_DEX_PREOPT and copies
the jar, removing the dex files if necessary.
Test: only description message changes to out/build-${TARGET_PRODUCT}.ninja
Change-Id: Id2fa2d18571ca01bc81302c912b8de25f3dde7a1
The default LOCAL_JAVA_LANGUAGE_VERSION is normally 1.8, or 1.9
when EXPERIMENTAL_USE_OPENJDK9 is explicitly set to the
nondefault value of "true".
Since old Android API levels do not support later versions,
LOCAL_JAVA_LANGUAGE_VERSIONs is already capped at 1.7 for
APIs <= 23.
This CL further caps it at 1.8 for all released APIs (currently
<= 26) even when EXPERIMENTAL_USE_OPENJDK9=true.
This may need to be updated in future.
This CL only affects builds where EXPERIMENTAL_USE_OPENJDK9 is
set; it does not affect the default build.
Bug: 67454477
Test: Treehugger
Change-Id: I54ca72bdb09aeb4184d5bb3c51d881dcfc943839
Those dependencies are jars/apks on which we want to
uncompress their dexs.
bug: 30972906
bug: 63920015
Test: sailfish build
Change-Id: Ic96ffe9dbe39abc1c28e7de134892d689207c9ca
When checking *.img size with the partition size, the build system
reserves additional bits for spare bits and spare bad blocks.
However, for emmc and ufs, the space bits and blocks are entirely
managed by the underlying controller and thus not visible from outside
of the controller. In fact the check routine was made for legacy MTD
storages where raw flash blocks are directly exposed.
This makes the size checking a little bit conservative in modern devices.
Builds were failed even though the *.img can actually fit into the
partition. To handle this problem, the additional size is no longer
reserved when checking *.img size with the partition size.
This change also removes following build flags that are meaningful
only for devices having MTD storages:
BOARD_NAND_PAGE_SIZE
BOARD_NAND_SPARE_SIZE
Further use of them breaks the build
Bug: 35790399
Bug: 66399382
Test: build
Merged-In: I954bf261441b53844e75d05788866f1692a2ad43
Change-Id: I954bf261441b53844e75d05788866f1692a2ad43
If a resource was moved / removed without any other timestamp updates,
ninja would not re-run aapt. To fix this, add a list of resource files
into the same command as aapt (echo ... >/dev/null). That way if the
list changes, ninja will recognize the command line changing and rerun
aapt.
Bug: 67315436
Test: mmma cts/tests/autofillservice
Test: mv cts/tests/autofillservice/res/layout/welcome_activity.xml \
cts/tests/autofillservice/res/layout/welcome_activity_test.xml
Test: mmma cts/tests/autofillservice
Change-Id: Ia93ac4ff48910fed74a1f1539ce4e1f5a9db023f
Remove all support for running jack.
Bug: 65302138
Test: m -j checkbuild
Change-Id: I1ef87c88af3f2689f8b0dcf1a01c958b16159631
Merged-In: I1ef87c88af3f2689f8b0dcf1a01c958b16159631
(cherry picked from commit 5db5d31d73)
Remove all support for running jack.
Bug: 65302138
Test: m -j checkbuild
Change-Id: I1ef87c88af3f2689f8b0dcf1a01c958b16159631
Merged-In: I1ef87c88af3f2689f8b0dcf1a01c958b16159631
(cherry picked from commit 5db5d31d73)
So that they can't be generated into src/, which would be added to the
source list automatically.
Bug: 36698184
Test: m telephony-common without this change, pass
Test: m telephony-common without the cleanspec, fail with dup class
Test: m telephony-common with the cleanspec, pass
Change-Id: I7b2fc1847d52ff4a9ba8c69e76123fe152629ef8
Make R.stamp actually part of the same rule that creates R.java.
Otherwise if the generated sources directory is removed, we don't
regenerate R.java / Manifest.java.
Also move the package-export.apk and proguard options file into the same
rule.
Test: m telephony-common; rm out/target/common/obj/*/*_intermediates/src; m telephony-common
Change-Id: I71f6fcaf20593ca23271d52d15537aaa9ef4cc77
Follow Jack's behavior for now and pass LOCAL_MIN_SDK_VERSION to
dx. Don't pass it to desugar for now, desugar with low
--min_sdk_version numbers enables features we haven't verified
yet, and existing apps won't be using the new language features
that require extra desugaring.
Test: examine classes.dex from an app with LOCAL_MIN_SDK_VERSION
Change-Id: Ic7d679b1b11fba98a33418a4f79d4762a91f1f9c
libm is a default library for device builds, so default it for host
builds as well.
Also removes duplicate additions of -ldl, -lpthread, -lm and -lrt.
Test: m host
Change-Id: I6a07e12053090eb6997b79d4091c28ac9a9022de