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
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