The bootclasspath libraries have direct dependencies now, so
remove them from LOCAL_JAVA_LIBRARIES so they don't also end
up in the classpath.
Test: m -j checkbuild
Test: m -j ANDROID_COMPILE_WITH_JACK=true java
Test: manually inspection of build-${TARGET_PRODUCT}.ninja
only has expected changes
Test: no changes to system.img
Change-Id: Icbc8987468f237aa351708b33c3abe5ea3d1816e
The libraries in the bootclasspath were getting their dependencies
because they were also in the default libraries list. Make the
dependencies explicit in preparation for rearranging the default
libraries.
Test: m -j checkbuild
Change-Id: I3ea004714a31cd648ec2ef57ed3099bce70bc6b9
- ndk/r10 is removed, we need to use SOONG ndk stubs instead.
- Use MIN_SUPPORTED_SDK_VERSION instead of hard coded version 9 for
32 bit compilation.
Bug: 38342163
Test: mm
Test: make -j40 FORCE_BUILD_RS_COMPAT=true RSTest_Compat
Change-Id: I9549446cb7f8faee8842b06f096d035535dc7f3d
Mac java build has flaky error for merge_zips. The error happend is
because both turbine.jar.premerged and static_java_libs are missing.
We allow one of them can be missing, but we don't allow both of them are
missing. So re-org the merge_zips logic to see if the input of Turbine is
empty or it is due to Turbine internal.
Bug: b/66441248
Test: m clean && m -j32
Change-Id: I3c4b15004fd67fef2b83eabc36841bc8c8ff6e4c
By doing this, the change of private_manifest file won't trigger
Javac to re-run during re-build.
Bug: b/65455145
Test: m clean && m -j32
Change-Id: Ib90d56daf0be5f31b51e07b7714a933bc5cf4496
1. Use merge_zips to merge jars without unzipping/rezipping static Java
libraries. And seperate merging process as a independent Make target so
that Javac can only depend on Turbine.
2. Remove duplicate vars: "full_java_lib_deps" in droiddoc.mk
3. Also use classes-header.jar for link_apk & link_instr
Bug: b/65455145
Test: m clean && m -j32
Change-Id: I7b0307664a6b86075c983284fce099bd3946318c
bug: 30972906
bug: 63920015
Test: doing zipinfo on the produced apks after build.
Test: fugu build
This reverts commit f69441b76b.
Change-Id: I6b029f2044385f3e3fa332091a9244cec79d2474
Broke Fugu build. Will work on a workaround for it.
bug: 30972906
bug: 63920015
This reverts commit 09dfe6739a.
Change-Id: I5a8b8de4ec98ae44808762ca1ba974ce89bebb05
To ensure the verified boot work does not make ART run
dex code uncompressed in memory, make the build system
generate uncompressed dex files in APKs.
The alignment of STORE files in an APK is already handled.
bug: 30972906
bug: 63920015
Test: doing zipinfo on the produced apks after build.
Change-Id: I0ccdeae5d674b2a409a1343c4a14699c7bf0defb
The problem is that when I added .KATI_RESTAT for javalib.jar, I didn't
change the function: create-empty-package to generate javalib.jar.tmp.
The problem causes the build breakage on MacOS/Jack.
Bug: b/64308460
Test: download <git-wear-master> branch locally, and then do:
m -j out/target/product/angelfish/package-stats.txt
Change-Id: I9a5d74caaf164b44676e456050b4f8a5b3bdded0
This reverts commit 33dcd0c5eb.
Reason for revert: <stub.jar.toc needs classes.jar.toc which is no longer existed after Turbine was introduced. So use classes.jar to represent stub.jar.toc>
Bug: b/64308460
Test: m clean && time m -j32 ANDROID_COMPILE_WITH_JACK=true
Change-Id: If618993f1e0c789d93cc15664212603f994fd460
This reverts commit 0739155c86.
Reason for revert: <sdk_google_aw_x86-sdk (linux) build 4310016 in git_master is broken>
Change-Id: I525d48557bd0425917e61a85f596663ccc63c887
1. Bundle static_java_header_libs during turbine-classes.jar if
necessary. This can be improved if we have the ability to merge jars on
the fly.
2. Copy sdk/stubs-classes.jar to sdk/stubs-classes-header.jar, and Use
.KATI_RESTAT to cut un-necessary targets rebuilt.
3. Copy prebuilt-classes.jar to prebuilt-classes-header.jar since
Turbine doesn't apply to prebuilt.
4. Run jarjar after Turbine compilation, otherwise downstream targets
won't find corresponding symbols.
5. Change classes.jar in -classpath used in Desugar to
classes-header.jar.
6. Change legacy-libs in Proguard from classes.jar to
classes-header.jar.
7. Add .KATI_RESTAT for turbine-classes.jar, and remove IJAR.
8.boot.art is re-generated during the incremental rebuild since
javalib.jar got re-generated. Then boot.art re-triggered lots of
downstream targets to be rebuilt. So we add .KATI_RESTAT for javalib.jar
to prevent downstream to be rebuilt. The ziptime & commit-change-to-toc
operation for javalib.jar(small) didn't bring too much overhead when we build
from clean state.
Next step: specify static_java_header_libs in -classpath, and merge jars
at the end.
touch frameworks/base/core/java/com/google/android/util/Procedure.java &&
time m
time: 1m58s (794 -> 49 targets)
m clean && time m java
time: 9m34s
Bug: b/64308460
Test: m clean && m checkbuild
Change-Id: Iefcc234405b9f461b6882c06bba15e21fa783d28
Move the java source list generation step into its own rule. This
has a couple of advantages. It consolidates the source list
generation so that it only has to run once for javac, jack, and
jack-check. It also massively reduces the length of the javac
command line, so that error messages are significantly shorter,
and allows easily rerunning the failing build command because
the file list is still on disk.
The primary disadvantage is that javac error messages no longer
include the list of files passed to javac, but the list is
available earlier in the build long when the file list was written,
and is still available on disk.
Test: m -j javac-check
Change-Id: I9730b352b33a060e08221b61c11c617d23320d67
jar -C <dir> . produces a jar containing files in filesystem order,
which can vary between builds. Manually find and sort the list of
files, and convert them into a list of -C <dir> <file> pairs.
Fixes: 64634025
Test: m -j checkbuild
Test: m -j out/target/product/sailfish/system/framework/ext.jar, check
that entries are sorted
Test: m -j out/target/product/generic_arm64/system/framework/ext.jar on mac
Change-Id: I7dced6acbe621a60cd49daf17872941485602732
Commit 2bdbb6e935 added
command line flags to the unzip command in unzip-jar-files
to skip the path 'module-info.class', if present.
This has led to log spam because unzip warns when an
excluded file is not present in the zip/jar file, and
that warning cannot be suppressed via command line flags.
Therefore, this CL modifies the unzip-jar-files macro
to rm -f the module-info.class file after the fact, if
it was created, which does not lead to log spam.
Note that module-info.class will be filtered out of
.jar dependencies (such as ASM 6.0) regardless of
whether one is building with an OpenJDK 9+ toolchain.
Test: Treehugger.
Bug: 64719206
Change-Id: Ic6be806a50557b4ba13fc18da91a8af12d14586c
This reverts commit 9cc3c76abd which
added command-line parameters to the invocation of SignApk to permit
it to access sun.** classes which are not accessible by default in
Java 9. This hack is no longer needed because SignApk no longer needs
this access because of tools/apksig commit
b40d3e4821bc9cb094b0ff13153340e3a0da1b3f which switched APK JAR
signature generation logic away from directly using sun.** classes.
Test: find out -name CtsPkgInstallTinyApp* | xargs rm -Rf
mmma -j74 cts/hostsidetests/appsecurity/test-apps/tinyapp
Test: find out -name CtsPkgInstallTinyApp* | xargs rm -Rf
EXPERIMENTAL_USE_OPENJDK9=target1.8 \
OVERRIDE_ANDROID_JAVA_HOME=<path to Java 9 SDK> \
PATH=${OVERRIDE_ANDROID_JAVA_HOME}/bin:${PATH} \
mmma -j74 cts/hostsidetests/appsecurity/test-apps/tinyapp
Bug: 37137869
Change-Id: I389c366f8a5bed56c496293bc871458adbedb0e8
- Prebuilts with LOCAL_MODULE_CLASS == APPS and BUILD_PACKAGE that
define LOCAL_COMPRESSED_MODULE := true will be installed compressed
in the system partition.
- The compression algorithm is simple gzip for now.
In addition :
- Compressed modules are not dex-preopted.
- JNI shared libraries are always embedded inside compressed modules,
they are never installed as separate files on the FS.
Test: Manual
Bug: 63802184
Change-Id: Id12b1ff0b1d68791ec1178783f7e78910e122a33
Test: runs "m -j checkbuild tests cts", and then --bootclasspath_entry
shows up in desugar command.
Change-Id: Ibcc8a3f51438723151c57f79e5a1184350efbd30
During the Android build process, multiple .jar files are
unzipped into the same directory. If the .jar is an OpenJDK 9
modular jar (with a module-info.class in the root directory),
the last module-info.class extracted will overwrite any earlier
module-info.class files extracted, and will cause all extracted
class files to be considered part of that module.
Therefore, this would break compilation under OpenJDK 9 (with
-target 1.9 -source 1.9). This CL fixes this by omitting the
module-info.class file (if present) when extracting the .jar.
This essentially turns any modular jar into a regular jar,
replacing the module with corresponding classes on the classpath.
This is sufficient for now because Android does not currently
support module dependencies.
Test: Treehugger
Bug: 38177569
Change-Id: Ia184e64d2f24b8ca79aeab1c00bd5da0386530bf
Desugaring try-with-resources is not necessary for platform builds,
and triggers some problems for apps built as part of the platform
that target SDK versions before 19. Disable all try-with-resource
desugaring.
Bug: 63180735
Bug: 63900665
Bug: 63901645
Test: m -j ANDROID_COMPILE_WITH_JACK=false checkbuild
Change-Id: I98b827aa1e80b43e6eb7b58254c23c7a4f7dc52d
The extension directory defaults to lib/ext and does not
exist by default. Setting it to the empty string de facto
disables this obsolete feature.
AOSP is moving to a hermetic toolchain so this argument
will stop working soon. Further, OpenJDK 9 javac no longer
supports this command line argument when compiling for
-source 1.9 -target 1.9.
This command line argument has been around since the
earliest versions of Android, but is now obsolete.
This CL drops it.
Bug: 63746471
Test: Treehugger
Change-Id: Ia0214c1b192e3ffda10772d777557a81ce346c03
Use $(JAVA) to invoke dx.jar instead of the dx wrapper script.
Also allow the dx command line or the dx jar to be specified on
the command line. Allows better dependencies on dx.jar, and
doesn't rely on having java on the path.
Bug: 62956999
Test: m -j checkbuild
Change-Id: I5f265132690ad28b3139954fea44eb0c4a43393a
Replace java -> $(JAVA), etc. to prepare for moving java binaries
out of the path and using full paths to them.
Test: builds
Bug: 62956999
Change-Id: I5dfcd0d4e855ecde69cd127169e9545e59723d12
Apparently the default bash echo doesn't support \e even though the man
page says it does. So use \033 instead.
Test: m -j nothing on mac, get colors
Test: m -j nothing on linux, still get colors
Change-Id: I608fa87e3c28bf8f99264d39f9b250008a81235a
Created math.mk and moved all math function definitions there.
Then, included this file in config.mk. This allows the functions to be
used by whatever includes config.mk (envsetup and build).
Test: manually setting combinations of PRODUCT_SHIPPING_API_LEVEL
and PRODUCT_FULL_TREBLE_OVERRIDE and looking at values of
PRODUCT_FULL_TREBLE.
Bug: 62229856
Change-Id: Icdab4214a1e65ae202411613dbcb9c9ea5f43b09
Bug: 38342163
- obj/lib is deprecated and TARGET_OUT_INTERMEDIATE_LIBRARIES will be
removed. We need to use per-module intermediates directory instead.
- prebuilts/ndk/current folder is gone. For libm and libc, we just
need ndk/r10 as stub libs for linking.
Test: mm and made sure this does not affect on device target.
Test: make -j50 FORCE_BUILD_RS_COMPAT=true RSTest_Compat works as
expected.
Change-Id: I8fbf5c10322707849a23c6b0dacc28b028db451e
signapk relies on internal APIs sun.security.{pkcs,x509},
for example in com.android.apksig.internal.apk.v1.V1SchemeSigner.
This breaks at signapk runtime under OpenJDK 9 because those
packages are not exported by the java.base module.
This CL unbreaks signapk by allowing it to access these internal
packages. In the long term, signapk should migrate away from these
internal APIs (bug 37137869).
Test: make ANDROID_COMPILE_WITH_JACK=false checkbuild tests \
&& make checkbuild tests
(with OpenJDK 8u45 toolchain on the PATH)
Test: make EXPERIMENTAL_USE_OPENJDK9=true \
ANDROID_COMPILE_WITH_JACK=false checkbuild
(with jdk 9-ea+170 toolchain on the PATH)
Bug: 37137869
Bug: 38177295
Change-Id: I64cab83e6eb7b135cf2ad7b523736cb409aaae02
Desugar reflects over internal APIs at runtime, using the
java.lang.invoke.MethodHandles.Lookup API.
On OpenJDK 9 toolchains, such reflection is only allowed
to packages to which the java.lang.invoke module is opened.
This CL adds an override to open the module to all unnamed
modules (i.e., to Desugar) when running Desugar.
Test: make checkbuild
(with OpenJDK 8u45 toolchain on the PATH)
Test: make EXPERIMENTAL_USE_OPENJDK9=true checkbuild
(with OpenJDK 9-ea toolchain on the PATH)
Bug: 38177295
Change-Id: I2cf74a96ea17366dd50b8d92af8e41e812247ef7
This CL resubmits a fixed version of commit
e2a8da2683.
This CL applies the following changes:
- explicitly set the path where desugar will dump temporary class files.
This ensures that the system property is set before it is read during
InnerClassLambdaMetafactory.<clinit>. Before this CL, the system
property was set by Desugar.createAndRegisterLambdaDumpDirectory(),
which may run too late.
- explicitly specify -source 1.8 for droiddoc's javadoc run.
Previously, the command used the language version of the build
toolchain, which might fail due the backward-incompatible restrictions
imposed by the proposed module system.
Some Android build targets use LOCAL_JAVA_LANGUAGE_VERSION 1.7,
but droiddoc combines sources from multiple build targets and there
where no backwards incompatible changes in 1.8, so it should be fine
to use 1.8 for code from either language level.
Bug: 38318052
Bug: 38225656
Bug: 38177295
Test: make clean && make ANDROID_COMPILE_WITH_JACK=false checkbuild tests \
&& make checkbuild tests
(using OpenJDK 8 toolchain)
Change-Id: I2fffe6668747f48be44e34c67332af9b8a996d2a
- explicitly set the path where desugar will dump temporary class files.
This ensures that the system property is set before it is read during
InnerClassLambdaMetafactory.<clinit>. Before this CL, the system
property was set by Desugar.createAndRegisterLambdaDumpDirectory(),
which may run too late.
- explicitly specify -source 1.8 for droiddoc's javadoc run.
Previously, the command used the language version of the build
toolchain, which might fail due the backward-incompatible restrictions
imposed by the proposed module system.
Some Android build targets use LOCAL_JAVA_LANGUAGE_VERSION 1.7,
but droiddoc combines sources from multiple build targets and there
where no backwards incompatible changes in 1.8, so it should be fine
to use 1.8 for code from either language level.
Bug: 38318052
Bug: 38225656
Bug: 38177295
Test: make clean && make checkbuild docs
(using OpenJDK 8 toolchain)
Change-Id: Ie5fe0502dfe2f99fc58b1a723b7c18d5896a2646
We shouldn't give non-clean paths to tools -- if a/b/../file was
specified, we can simplify that path to a/file, and not need to create
a/b just to make the path name work.
The testcases come from golang's filepath.Clean tests, this should be
compatible with that implementation.
Bug: 37716307
Test: TEST_MAKE_clean_path=true m -j blueprint_tools
Change-Id: I290a02b0a1e4a7c2b9255bca3c881589b521c402
Allow working around Jack bugs by using javac to compile *.java
to class files, and then pass through Jack for desugaring,
proguarding, and dexing.
Also make ANDROID_COMPILE_WITH_JACK=false override LOCAL_JACK_ENABLED.
Bug: 37483961
Test: m -j checkbuild
Test: Add LOCAL_JACK_ENABLED := javac_frontend to a target
Change-Id: I2189055aac9deccc36b8eab8e949796dddadf7a1
All the new features are turned off for now, since multiple branches and
products need to be verified before they can be turned on. So everything
should behave the same as today, except for no partition-based
warnings.
Instead of the current link type checks that happen during the build,
run as many as possible immediately after loading all the Android.mk
files. If we're allowing missing dependencies ('mm',
ALLOW_MISSING_DEPENDENCIES, tapas, etc), we'll defer the link type
checks to during the build. If we're not allowing missing dependencies,
we'll produce a better error message to the user about the missing
dependencies.
See core/main.mk for a description of the storage format.
This also remove the partition-based type checking. It hasn't worked all
that well, particularly with ASAN builds. The new VNDK checks will
handle the most pressing cases.
Test: Verify all link_type files and dependencies are the same:
grep link_type: out/build-aosp_arm64.ninja | sed -E "s/ rule[0-9]+//" | sort
Change-Id: Id643658b9d9e84f99f5db0d526aad88c1f5d3417
Add soong_javac_wrapper to all javac commands. soong_javac_wrapper
colorizes javac output, and hides noisy messages.
Previously attempted in I7e8fcd2e4e1ed3ff530a8ccfe931ceb7e411e0ad
and I449a61ed2c95b3e1afd51a31a11baab15d97e2f2.
Test: m -j ANDROID_COMPILE_WITH_JACK=false
Change-Id: I9d7a20d766fadab323a4cf95e5734741b3f578bb
Prebuilts may already be stripped. Instead of requiring every stripped
prebuilt to be annotated with LOCAL_STRIP_MODULE := false, just make
the default (mini-debug-info) pass through already-stripped modules
without failing.
Bug: 36793128
Test: m -j checkbuild
Change-Id: Iafc4614ceb91bbbb2e5ff82caefd18753f8961b1
The codebase is growing more uses of annotation processors,
through a mixture of LOCAL_ADDITIONAL_DEPENDENCIES and
LOCAL_JACK_FLAGS. Add LOCAL_ANNOTATION_PROCESSORS and handle
the rest in the build system.
For now we also need LOCAL_ANNOTATION_PROCESSOR_CLASSES to
work around bad behavior in grok (b/25860419).
Test: m -j java
Change-Id: I465b021e65d25ed3ea517333a82ec4ebd63fc038
(cherry picked from commit cde14987ba)
The codebase is growing more uses of annotation processors,
through a mixture of LOCAL_ADDITIONAL_DEPENDENCIES and
LOCAL_JACK_FLAGS. Add LOCAL_ANNOTATION_PROCESSORS and handle
the rest in the build system.
For now we also need LOCAL_ANNOTATION_PROCESSOR_CLASSES to
work around bad behavior in grok (b/25860419).
Test: m -j java
Change-Id: I465b021e65d25ed3ea517333a82ec4ebd63fc038
Jack can silently handle using a java library as a static java
library by merging in the java library dex file. This causes
problems when switching to javac, because dex doesn't support
dex merging with multidex enabled?
Make the output files consistent between java libraries and static
java libraries. Java libraries will now produce:
classes-pre-proguard.jar: the classes before proguard processing
classes.jar: the final jar file containing classes before dexing
javalib.jar: a jar containing classes.dex
Static java libraries will eventually only produce
classes-pre-proguard.jar and classes.jar. All inter-library
linking is done with classes.jar, so a java library can be
used as a static java library.
There are too many dependencies outside the build system that
expect javalib.jar to exist for static and host java libraries,
so for now continue to build a javalib.jar that is a copy of
classes.jar.
Test: m -j ANDROID_COMPILE_WITH_JACK=false java
Test: m -j java
Bug: 36901093
Change-Id: I6730e2d3ec38004874265b2a690442dec57b33f4
This CL addresses the problem that native tests build for multiple
architectures and also build for host.
First it restructures each testcase folder to the following layout:
<testcase>/<testcase>.config
<testcase>/<arch 1>/testcase
<testcase>/<arch 2>/testcase
Secondly it now uses the new soong-zip prefix capability to
separate out host and target testcases in the device-tests &
general-tests zip files.
Bug:36692141
Test: `make device-tests general-tests cts -j` &
ensured all built successfully.
Change-Id: I4e8b084ee56fa8940914911649ff35507d87eb27
This CL is to generate every static RRO package for its target package
automatically at build-time.
BOARD_ENFORCE_RRO build variable is added to specify whether enforcing
RRO is required or not.
BOARD_ENFORCE_RRO_EXEMPT_SOURCES build variable is added to specify
the module list of which item should be exempt from enforcing RRO.
Test: tested on bullhead and sailfish
Bug: 34097942
Change-Id: I455b2ce34e66c57a540c299b5e378b7c4e78d5b8
(cherry picked from commit 3070610b72)
This reverts commit 440079b84b.
Adding the pipe interferes with error codes, which results
in an empty classes-full-debug.jar output file being left
after the failure. The next build sees the output file with
an up-to-date timestamp and doesn't rerun the failing rule.
Bug: 36666657
Change-Id: I6658edb766d8ba3120f88e3d8d6eda6ea6c691da
DEFAULT_APP_TARGET_SDK is PLATFORM_VERSION_CODENAME (for example 'P')
for non-release builds, and PLATFORM_SDK_VERSION (for example 25) for
release builds. Use it for dx and desugar, and translate
PLATFORM_VERSION_CODENAME to 10000 to enable features in the current
development version.
Bug: 36087246
Bug: 36118520
Test: m -j ANDROID_COMPILE_WITH_JACK=false
Change-Id: I3d6bbc36a8869e4ced6bb850bc32f37b4cba3f85
This reverts commit 842a985f90. It's
causing test failures, warnings and complaints, so backing it out and
we'll resolve those before putting it back in.
This also bundles in the revert of a minor warning/error fixup for this
code, and does the correct thing with the CleanSpec.mk (which can't just
be reverted).
Bug: 33681361
Test: m -j
Change-Id: Ic889ce6a4737a497ad6bf633424ce1860713f7d0
Although performing the inclusion of assets/ at a later stage is
preferable, (since aapt just copies the files) do the easy thing and
support what aapt did. In the future perhaps we can zip up the
assets/ directories when also merging in the classes.dex.
Bug: 35461578
Change-Id: I7d7fde43333ea6455c4a1b9113bd25e1d88b7dd5
Test: manual
This reverts commit 996bc3ce7b.
Reason for revert: Need to update prebuilts, but prebuilts not built by server yet...
Change-Id: I87deb3ed9512278ff40c185059230dbd66524989
Although performing the inclusion of assets/ at a later stage is
preferable, (since aapt just copies the files) do the easy thing and
support what aapt did. In the future perhaps we can zip up the
assets/ directories when also merging in the classes.dex.
Bug: 35461578
Test: manual
Change-Id: I7cd36585e7c292e43b5528969900c6ead2b80c0b
This CL is to generate every static RRO package for its target package
automatically at build-time.
BOARD_ENFORCE_RRO build variable is added to specify whether enforcing
RRO is required or not.
BOARD_ENFORCE_RRO_EXEMPT_SOURCES build variable is added to specify
the module list of which item should be exempt from enforcing RRO.
Test: tested on bullhead and sailfish
Bug: 34097942
Change-Id: I455b2ce34e66c57a540c299b5e378b7c4e78d5b8
Shared libraries are now installed to different directories depending on
their types.
* NDK libraries: /system/lib/ndk (with symlink from /system/lib)
* VNDK libraries: /system/lib/vndk
* VNDK-ext libraries: /system/lib/vndk-ext
* Framework-only libraries: /system/lib
* Vendor-only libraries: /vendor/lib
* Same-process HALs: /vendor/lib/sameprocess
However, if LOCAL_MODULE_PATH is explicitly set, then it is respected,
with a warning message. Module owners are highly encouraged to
investigate the warnings and use alternatives to LOCAL_MODULE_PATH;
combination of LOCAL_[PROPRIETARY|OEM|ODM]_MODULE, LOCAL_MODULE_CLASS
and LOCAL_RELATIVE_PATH will cover most of the cases.
Furthermore, for each shared libraries whose path is changed, a symolic
link from the original path to the new path is *temporarily* generated.
e.g. /system/lib/libbase.so -> vndk/libbase.so. This is
to prevent sudden breakage of the code expecting the lib from the old
path. This symbolic links will eventually be removed before O launch
(b/34917183).
Finally, BOARD_SAME_PROCESS_HAL_DEPS is added. It contains the list of
shared libraries implementing the same-process HALs and its internal sub
libraries. This is designed to be defined in BoardConfig.mk
Bug: 33681361
Test: build & run. Libraries must be in the correct directories.
Symlinks from the old path to the new path must exist.
Change-Id: I46130aac09ae65400fd4d0abbc2e12dddd154fb1
external/dbus and external/dbus-binding-generator was removed from
the manifest.
Bug: 31602715
Test: make checkbuild
Change-Id: Iea0277720acad8ac0fa630b8745f90fb3c3b5f00
PRODUCT_FULL_TREBLE: whether the device has Treble fully enabled (no
passthrough hals, vendor.img, split sepolicy, etc..)
PRODUCT_FULL_TREBLE_OVERRIDE: used if someone wants to consider a device
as full Treble even if it didn't launch with Android O.
Bug: 35809750
Test: PRODUCT_FULL_TREBLE set appropriately with
PRODUCT_FULL_TREBLE_OVERRIDE and PRODUCT_SHIPPING_API_LEVEL = 24/25
Change-Id: I069448beaf26c70acb6c45d4228d8fdfe9476410
1) Updates the LOCAL_COMPATIBILITY_SUITE line to allow for a
testcase to belong to multiple suites.
2) Building testcases no longer fails if
COMPATIBILITY_TESTCASES_OUT_<suite> is not defined. This
testcase will just not output to that directory.
This will be utilized by the device-tests and general-tests
suites that don't require any extra output besides the common
testcase directory.
Bug: 35394351
Test: 1) Added multiple *TS testcases to cts & vts and verified they
ended up in the common directory and each suite's testcase
directory. Specifically tested CtsSplitApp to ensure the
split usecase still works as well.
2) Added a CTS testcase to the device-tests suite, built
device-tests and verified the cts/android-cts/testcases
copy was not produced.
Change-Id: Ic4c4e87e62be4fc0c5e394d88cc359518346dffa
The new javac/desugar/proguard/dx based toolchain can fail if
there are duplicate classes in the -injars and -libraryjars
passed to proguard. That causes problems for b/30188076 which
is attempting to remove various junit and android.test classes
from the API because it requires the changes to add those
classes statically to applications are submitted simultaneously
with the change to remove the classes from the API which is not
feasible.
This change simply causes Proguard to ignore the classes from
the application JAR so it will always use them from the library.
That allows the changes to be done separately and only requires
that this change is reverted simultaneously with the change to
update the API.
Bug: 30188076
Test: make checkbuild and make -j ANDROID_FORCE_JACK_ENABLED=disabled checkbuild
Change-Id: I6ed6c45a159d6261d90245551aa2913cc82d2e8b
This enables support for lambdas by passing class files through the
desugar tool.
Test: m -j checkbuild tests cts
Change-Id: I14ec152355243fd67fe2f107ccbe67a1b4e7e262
This reverts commit a341bf0f86.
Breaks grok builds that replace javac with another tool:
reading standard input: bufio.Scanner: token too long
Change-Id: I825587c465b05c1fbddb7794dc1c84f5f2c883d1
This is a partial revert of commits:
858657366f Remove support of disabling Jack.
3ae7861252 Remove javac support in host dex rules.
22313f2b2a Remove rules for building dex with dx
Test: builds
Change-Id: Ie12d743cbe978bdeb030910848b67f5945a4fec8
We currently use static libraries without any source files to represent
header libraries, but Soong actually has cc_library_headers. So to
export those in a separate namespace from static libraries, implement
them in Make as well.
This also adds a nice pretty-warning / pretty-error macro that can be
used to print out standard warning messages pointing to the real source
file having the problem.
Test: Use a header library exported by Soong in a Make module
Change-Id: I3486539e247524cb82a20620745fc7be03014e14
Creating static archives is often a multi-command process due to
adding whole static libraires or hitting command line length limits.
If one of the intermediate commands fails, the output file may
already exist. Unlike make, ninja has no option to delete output
files on failed builds, instead assuming all build commands will
produce their output file atomically
(https://github.com/ninja-build/ninja/issues/1135).
Change the static library rules to generate to a temporary file
that is then atomically moved into place as the output file.
Test: m -j checkbuild tests cts
Change-Id: I4faf269f0c8e313c738154870a5aa0b4774a72bc
Just move the proto and renderscript sources into their own directories
-- the entire directory is wiped if the file list changes since the
command line will change. So we can just enable/disable pulling sources
from those directories based on whether there were files in the list or
not.
Bug: 30947985
Test: m -j java
Test: Remove a proto file from a java lib, ensure the generated source
is not included.
Change-Id: If7529979de6fa62a651933a3a974f47b033851d6
The only user of get-package-min-sdk-version-int was signapk. signapk
no longer needs to be provided with the APK's minSdkVersion though.
(cherry picked from commit e185da21ca)
Test: make clean && make
Change-Id: I6867a004aec0f3752cbbc99cc30e02ca5404b3c4
The only user of get-package-min-sdk-version-int was signapk. signapk
no longer needs to be provided with the APK's minSdkVersion though.
Test: make clean && make
Change-Id: Ibc0fb9c8e412f8b46b1761359c34b64c608a06b6
Prior to this change, when signing APKs, the build system invoked
'aapt dump badging' on each APK, to detect the value to pass into
signapk as --min-sdk-version. Now that signapk uses the apksig
library, it can auto-detect that value on its own, thus avoiding the
need to invoke 'aapt dump badging' and thus speeding up the build
process.
The semantics of signapk's --min-sdk-version flag is changed by this
commit from having the default value of 0 to having the default value
of "auto-detect from APK".
P.S. The get-package-min-sdk-version-int is not removed from
core/definitions.mk in this commnit, because this function is used in
another project's .mk file and thus that .mk file needs to be modified
first.
Test: rm -Rf out/ && make
Change-Id: I0972fcf0abbde9cbf6794e6c05c743c77c8a78f9
This can be used to ship source data as test artifacts next to native
tests. It works for both local builds and the test bundles using
package_modules.mk.
You just specify a file list relative to the local directory, and those
files will be copied next to the executable under
/data/nativetest*/<module>/...:
LOCAL_MODULE := mytest
LOCAL_TEST_DATA := data/file1 file2
/data/nativetest/mytest/mytest
/data/nativetest/mytest/data/file1
/data/nativetest/mytest/file2
If the data is in another directory, you may also specify a different
prefix for the source files:
LOCAL_TEST_DATA := external/skia:resources/f.xml
/data/nativetest/skia_test/resources/f.xml
And there's a new convenience macro to find a list of files in this
format:
LOCAL_TEST_DATA := $(call find-test-data-in-subdirs,external/skia,"*.xml",resources)
I'll expand this to native benchmarks and fuzz tests in a later change,
since they don't have their own module classes yet.
Bug: 30564705
Test: m -j minikin_tests; ls $OUT/data/nativetest*/minikin_tests
Test: m -j continuous_native_tests dist; zipinfo -1 out/dist/*continuous_native_tests*.zip
Change-Id: Ic76a7b62e7f567f259c4ab1510ee97d26600ba9a
Building with LOCAL_STATIC_ANDROID_LIBARIES and LOCAL_USE_APPT2
causes a warning:
build/core/package_internal.mk:143: Empty argument supplied to find-subdir-assets
Only call find-subdir-assets if my_res_dir is not empty.
Also improve the warning message to make it easier to find the module
that caused it.
Test: m -j
Change-Id: I9a71162c7e2ed82f64d6844baca256968ac77317
The last user of this was the NDK, which has been using full paths in
binary.mk. So remove it.
Test: lunch aosp_arm-eng; m -j native
Change-Id: Ida2523a2d19131ee3ef005edb3e5bcf830710b11
This make aidl-cpp write out a dep file that ninja parses correctly.
Test: Manually inspect ninja depfile
Change-Id: I4890a91eb29a6388e17b1ffac23a3dc0ffe6c212
Ninja doesn't need the phony make targets, in fact, the parser doesn't
handle them correctly and ends up duplicating the dependencies. This
shrinks a `m native` deps file from 54M -> 35M on AOSP.
Test: Compare out/build-aosp_angler.ninja before/after
Test: wrote a tool to dump the .ninja_deps, added dedup feature, files
identical after dedup.
Change-Id: Iec7a9a0739e8678c1f4db79c68e423a39b9aad4b
Disable the NATIVE_COVERAGE code when not in use. Provide the proper
PRIVATE_ variables so that the $DISPLAY environment variable isn't
encoded into the ninja file.
Remove PRIVATE_ARFLAGS, which is never set.
Test: compare build-aosp_flounder.ninja
Test: NATIVE_COVERAGE=true build-aosp_flounder.ninja, inspect
Change-Id: I2a52de440fd991cdc5761ff8bd58a474892d2dfc
$(shell) isn't particularly fast in Kati, and they have to be executed
both when reading the makefiles and determining whether the ninja file
needs to be regenerated.
Right now, the regen time is mostly hidden because we run them in
parallel. We've also configured it to ignore any commands that contain
"echo", "date", or the output directory. That happens to remove most
commands that contain side effects, so running them in parallel is fine.
But the side effects contain some important things, like the clean up
necessary when switching products. So I'm removing those filters, and
then we'll need to run the shell commands in sequence, since there will
be side-effects. That makes regen take longer though, so use pure-Make
implementations instead of $(shell) where possible.
This set of changes reduces aosp/master aosp_arm64-eng build $(shell)
usage and time by 2/3:
*kati*: func shell time: 3.135095 / 709
*kati*: func shell time: 1.067331 / 236
Bug: 30947985
Test: Manual test lines for math functions
Test: Compare build-aosp_arm64.ninja before/after
Change-Id: I4fc9d6318957992921972994f277c17918e7e1eb
And ensure compatibility with coverage plugin.
(cherry picked from commit 862bb84d37e3e6ca61080de58f206e512e09d4e0)
Bug: 28876950
Test: Manually tested by some manual activations of the coverage plugin.
Change-Id: I804558a501825357bf0812de626d2957eedbdc13
This was printing "error:", but not actually triggering an error.
Instead of trying to write a single line bash script to handle this,
move the actual check into python. This allows us to print all of the
errors for a single module before triggering the failure.
Also updates the warning format and the warn.py script to properly parse
these warning. Many of the java:sdk -> java:platform warnings are false
positives due to the lack of LOCAL_SDK_VERSION markings on prebuilts.
Individual tags can be marked as warnings now, which lets us check for
system libraries linking against vendor libraries (which won't work on
AOSP). I'm not sure this is a completely valid check, which one reason
that it's just a warning.
Test: m all_link_types (with some missing libs commented out)
Change-Id: I333e418c9a4511b7c7e826891ae481da08fbf6f9
Native coverage is enabled by setting NATIVE_COVERAGE to true
and specifying a list of paths in the COVERAGE_PATHS
environment variable. Files are exported to a zip file in the
target out directory.
Change-Id: I66a2ddd88e849bec1cc0cdae1b51fe18a007e2c3
Remove the global linker search path, as it can cause spurious build
failures. If a library with the same name as a system library is in the
process of being written to the directory in the global search path, and
the linker may try to read the partially-written built one instead of the
system one. We already use full paths to libraries for target builds,
do the same for host builds. Also remove the normalize library
functions, they are no longer necessary.
Test: m -j checkbuild
Bug: 31393456
Change-Id: If9fc631e111f568c700fd73e103445c30d7e9d11
AUX is a new class, similar to TARGET
While TARGET defines toolchain for Application Processors
AUX is defining toolchains for arbitrary utility cores (DSPs, GPUs,
MCUs, etc). This allows building of non-android sources as part
of Android tree and avoid using prebuilts if source code is avaliable
Bug: 29635686
Change-Id: Ie755ea054b16c3e86369f5fb2ba6eb0b384af77f
Signed-off-by: Alexey Polyudov <apolyudov@google.com>
Use PRIVATE_PREFIX to tell us what is the target class
Bug: 29635686
Change-Id: Ia895e780f741b9cb00c7ee9633055b5363e675a1
Signed-off-by: Alexey Polyudov <apolyudov@google.com>
We supported de-duplicating LOCAL_INIT_RC across multiple architecture
variants in a single module definition, but that didn't work if the
module was defined with two different BUILD_PREBUILT definitions. That's
how we're exporting modules from Soong to Make.
Change-Id: Ifc93b15ef78ea3d8e78005d428a3ec57d7e414e8
Creates a build_system_stats.txt build artifact that contains statistics
on how many BUILD_* modules are defined in a build. Also writes out
information about the Soong module types sent from the Soong build.
Merged-In: Iaf0c7062f542dc6942b5349854f3d49267cac4a5
Change-Id: Iaf0c7062f542dc6942b5349854f3d49267cac4a5
Creates a build_system_stats.txt build artifact that contains statistics
on how many BUILD_* modules are defined in a build. Also writes out
information about the Soong module types sent from the Soong build.
Change-Id: Iaf0c7062f542dc6942b5349854f3d49267cac4a5
This ensures that we're not accidentally linking the wrong version of
a library with the same name thanks to -L.
Test: Still builds.
Change-Id: I22e9e28412844ff4f8bda42ebbc300ea6574e474
Split the variables that contain header directories into ones that
should be prefixed with -isystem and ones that should be prefixed with
-I in preparation for moving some headers from -isystem to -I.
Add $(wildcard) around SRC_HEADERS to match the soong behavior, and move
users of SRC_HEADERS from config.mk to binary.mk so that the exported
soong value is present.
Test: no changes to build.ninja compile rules
Change-Id: Iadecbbf4351a01e53cb57e721d31f4f836bb82d9
Refactor includes in transform-*-to-o to simplify future changes to the
default include paths.
Test: whitespace-only changes to the compile rules in build.ninja
Change-Id: I766af1f22a4838d933691b6df37530db3ba4e21d
Specifying LOCAL_MODULE_SYMLINKS will create symlinks to the installed
module in the same directory.
Change-Id: Idecb2b75f0c9999eb000eed9a79a989244ccf6c2
When Soong was optional, the make build system needed extra complexity
to ignore Android.mk files that had an associated Android.bp file. Now
that Soong is required and the Android.mk files that were obsoleted by
an associated Android.bp file have been removed, remove all of the logic
that found associated Android.bp files. Android.mk files and Android.bp
files are now handled independently.
Change-Id: Ia6643d151b920689219ca8abd59ede44d230ba35
For acp, we've been using an old prebuilt in prebuilts/sdk, but it's not
part of the SDK. Instead, we'll use a prebuilt in the build-tools
repository.
For ijar, we've been using the host libstdc++ to workaround the lack of
libc++ on some unbundled branches. Instead, use a prebuilt that can use
libc++.
For ziptime, we've been disabling it on unbundled branches, due to the
lack of libc++. Instead, use a prebuilt version of ziptime that can use
the prebuilt libc++.
Change-Id: If80f845ea06f76e3fe6765964e77c864eaf303d0
am: 18023b557b
* commit '18023b557b6d33836de380df397fce10598931a9':
Update Android.mk finder to work with Android.bp files
Change-Id: I87915d75c3bda9c41c926a7c8ad7c650ac085199
The Android.mk finder should stop traversing when it finds an Android.bp
file, and any Android.soong.mk file at the same path should be included.
Update filter-soong-makefiles to accept a mixed list of Android.bp files
and Android.mk files, convert Android.bp files to Android.soong.mk files
if they exist, and ignore Android.mk files that have an Android.bp file.
Update first-makefiles-under to use the new --dir syntax for
findleaves.py and search for both Android.bp and Android.mk files.
Update all-makefiles-under and all-named-subdir-makefiles to search for
both Android.bp and Android.mk files.
Change-Id: Iddc51bf84593d5de3add02f2b2c065da08962af4
am: 1059f37377
* commit '1059f37377fd37cc311db522b4b5689086480d17':
Add build number to apps' version name for non-platform build
Change-Id: Iad8a4f271db54561d605a3f98f59a62e97eb1614
If TARGET_BUILD_WITH_APPS_VERSION_NAME is defined, the build system
will add build number to the apps' default version name.
Bug: 28982976
Change-Id: I536f273b557fe7c935cc4ef1052c3297f8029863
Host native tests have been getting installed into
out/host/linux-x86/bin/..., but this pollutes the bin directory with a
lot of poorly named tests. Also, to support 32-bit and 64-bit tests, we
need to have different names with different suffixes. This causes
problems when tests expect to be named something specific (like gtest).
It's also convenient to store test data next to the test itself.
So with this change, native tests will be installed in
out/host/linux-x86/nativetest[64]/$(LOCAL_MODULE)/$(LOCAL_MODULE_STEM)
just like target tests get installed into /data/nativetest[64].
Implement this using a new NATIVE_TESTS class, which is like
EXECUTABLES, but sets up the install path differently, and configures
the rpath to load shared libraries with the proper relative path.
LOCAL_MODULE_RELATIVE_PATH can be used to control the directory name, it
will default to $(LOCAL_MODULE). This way multiple related tests can be
grouped together.
Target native tests also use NATIVE_TESTS now, but nothing should change
other than LOCAL_MODULE_RELATIVE_PATH can be used.
Change-Id: I535e42b1a6b21c5b8d6a580aa2f944d2be35e27d
am: 451b72438e
* commit '451b72438e974a10f3f9062ced5d455d3234e4dd':
Uncompress native libs only if they are compressed.
Change-Id: I4c680cfb228774ce93e75c644e7eee5c40988399