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
This changes the build system to uncompress native libraries in
preinstalled APKs only if the libraries are actually compressed.
Previously, any preinstalled APK containing native libraries was
modified by having all native libraries removed from the APK and then
re-added to the APK in uncompressed form.
Bug: 27887819
Change-Id: I3db172133e141bb6282bf3ed7070b068a826724e
Instead, use the libgcc/libatomic/libgcov from the static libraries dir,
which is provided by Soong. Copy the libraries using the Soong script if
Soong is disabled - this can be removed once USE_SOONG is removed.
Change-Id: Iad2ad20ad5c3cfc48bf1e46e594a482609098d7a
If Soong is enabled, and we're skipping an Android.mk because there is
an Android.bp file, check for an Android.soong.mk file and read that
instead. This will allow us to temporarily define modules or recurse
into subdirectories that soong does not yet support.
Change-Id: Ifdb2f0204a38a5069e53527f66ffcfb8008c11a4
am: f59ad14c1f
* commit 'f59ad14c1f7cb07a4669741f8b0bb1e938398eca':
Fix handling of version codes in minSdkVersion when signing.
Change-Id: Ie53be2528b32bc2eaa70645000ad66473422e06f
The APK signing tool, build/tools/signapk, needs to know the API Level
of the oldest platform supported by the APK. The APK's minSdkVersion
may reference that using a number (API Level) or a version code. To
handle the version code case, the existing logic was to see if it
matches $PLATFORM_VERSION_CODENAME and then substitute it with
$PLATFORM_SDK_VERSION.
However, some platforms support multiple version codes. To handle this
scenario, this commit changes the logic for computing the min API
Level for signing purposes to treat any non-numeric minSdkVersion as
$PLATFORM_SDK_VERSION.
Bug: 28715556
Change-Id: I292c96e8928b7e2f8d9716ef2be33a23a87764c4
Previously if a library has custom generated headers in
LOCAL_GENERATED_SOURCES and export its include path with
LOCAL_EXPORT_C_INCLUDE_DIRS, there is almost no way for the users of the
library to set up dependency of their object files on the generated
headers.
This change makes the generated sources dependency of the library's
export_includes, which is guaranteed generated before client code gets
compiled.
Also we added proto-generated cpp files to my_generated_sources so that
we can deal solely with $(my_generated_sources). Because many
Android.mks assume the generted .pb.hs are in $(generated_sources_dir)
instead of $(intermediates), we have to generate the source files in
$(generated_sources_dir) and make a copy in $(intermediates).
Bug: 28622149
Change-Id: I73b21443fa706f3735faf16356ed8c08fbfecca6
Bootclasspath libraries are already added in LOCAL_JAVA_LIBRARIES by
java.mk and host_dalvik_java_library.mk meaning that bootclasspath
handling was just doing a duplicate work and adding duplicated entries
to the classpath.
Also fix order of bootclasspath libraries for host.
Bug: 28307907
Change-Id: I6e98fc651a127435c029de65285dbf2cb04844af
* Call clang-tidy before every C/C++ compilation if
(1) clang-tidy is found at $(PATH_TO_CLANG_TIDY)
(2) $(my_clang) is true
(3) LOCAL_TIDY is 1 or true, or
LOCAL_TIDY is undefined and WITH_TIDY is 1 or true.
* clang-tidy is called with -checks=$(my_tidy_checks),
which has default '-*,google*,-google-readability*'
and can be overwritten by WITH_TIDY_CHECKS.
* LOCAL_TIDY_CHECKS is appended to $(my_tidy_checks)
* Extra flags are passed to clang-tidy through
WITH_TIDY_FLAGS or LOCAL_TIDY_FLAGS.
* To quickly find and fix clang-tidy warnings, set $(WITH_TIDY_ONLY)
to 1 or true to skip compilation of C/C++ files.
* Add a PHONY tidy_only target,
which includes all $(cpp_objects) and $(c_objects).
* The 'mm' and 'mmm' functions are changed to call make with
the 'tidy_only' target when WITH_TIDY_ONLY is true or 1.
In that case, only clang-tidy is called for C and C++ files.
Bug: http://b/27779618
Change-Id: I8adcfff217d68af49849b79aacee7d7654cafb1b
Those libraries are already imported (or added to the classpath in the
case of the check command) meaning that they were all duplicated.
In addition to complicating the build this was also slowing down the
compilation.
Bug: 28307907
Change-Id: Ia8665e7c5ad8b567bd02de7839fa62e67a5668f7
Mini-debug-info strip mode strips most debug information, but
maintains minimal debugging information similar to
https://sourceware.org/gdb/onlinedocs/gdb/MiniDebugInfo.html.
Bug: 27923447
Change-Id: I0405f0b3c33cb3cadeafbd22ce94d645c4dbe7b9
We removed code and variables related to running dx on classes.jar in
this change. Also removed target emma rules (but kept the emma rules for
host java libraries), for it's now done by Jack.
We still support to build classes.jar (and javalib.jar for static Java
libraries) using javac, because tools like javadoc need class files as
input.
Removed the obsolete install-dex-debug.
Bug: 27400061
Change-Id: If0bcdfe62cb181a98754fb0dbe1c12c92e38d3e8
There was a typo in binary.mk. compile-dotdot-XXX-file in
definitions.mk was also using -include.
Bug: 26839129
Bug: 27886012
Change-Id: I4a0145fb70413998cc65d30d2efcd68af07b4800
(cherry picked from commit 72904774a3)
Also specify "-d keepdepfile" to ninja so .P files won't be
deleted by ninja.
-include for .s files are removed because GCC doesn't
generate .d files for .s files.
Bug: 26839129
Bug: 27886012
Change-Id: If00e93c7a33449ec314a5cdba438475a32979f4e
(cherry picked from commit 4037c4225a)
To rebuild odex files of Java libraries and apps,
we store the jars/apks without stripping the classes.dex inside the
platform.zip. We also save the build variables that may affect how we
rebuild an odex in pdk_dexpreopt_config.mk in the platform.zip.
We store the files and configuration only for libraries/apps that get
installed to the system.img (or vendor.img).
In PDK fusion build, we auto-generate prebuilt module definitions for
the javalib.jar and package.dex.apk carried in the platform.zip, using
configuration stored in pdk_dexpreopt_config.mk.
With the prebult modules, we override the implicit rule that directly
copies the odex from the platform.zip.
To rebuild odex of javalib.jar, we added support for prebuilt shared Java
library to prebiult_internal.mk. An installable prebuilt Java library is
treated as shared Java library, i.e. with classes.dex in the jar instead
of a set of .class files.
For apks in the platform.zip, we install the stripped version from
platform files inside platform.zip, instead of the package.dex.apk,
using a new variable LOCAL_REPLACE_PREBUILT_APK_INSTALLED. We can't
strip package.dex.apk because we can't re-sign the stripped apk at this
point.
We generate prebuilt module only if it's not already defined in the
source tree.
Bug: 27543283
Change-Id: I9e146f8b713d6f57c397fd28d88c9ab700757ca1
(cherry-pick from commit 3a61eeb6cb)
When USE_SOONG=true, ignore any Android.mk file that has an Android.bp
file in the same directory.
Change-Id: Id79bd90c2aed5dafc2f8ad2c5b7eb0aa6e81dc18
(cherry picked from commit 861ab99536)
We don't need to run rmtypedefs in javac compilation now, because the
runtime libraries are compiled by only jack, which takes care of
rmtypedefs by itself.
Bug: 27828139
Change-Id: Ie480ae5aead8f3f58f956978fc4a05c28a35dec6
On Darwin ar would fail if there is no object file to add.
We work around by adding a dummy.o to the .a and then deleting it.
Bug: 27800477
Change-Id: I68bbebea2726058c25863d7026a645a520d05167
This is just to ensure no dex file is built with dx any more, cleaning
of the build rules from Jack optionality is still to be done.
Bug: 27218410
(cherry picked from commit 22313f2b2a)
Change-Id: I1e7f2f5dcc7f95a44f5ebf2e4ba99931ff3ba014
After adding java.util.stream, doc-comment-check target
started to fail due to "Too many words" while
generating out/target/common/docs/doc-comment-check-timestamp.rsp
This change extends number of dumped words to 5400.
Bug: 27692239
Change-Id: Ifa75cada7b90c5737fc7a1d10325f3a49a2238ac
Set Jack min sdk according to LOCAL_SDK_VERSION. Gives Jack current
version when LOCAL_SDK_VERSION is not available.
Bug: 27371864
(cherry picked from commit c6383d6ec6)
Change-Id: Ieba0219494f29d2737d2ca234317c3af7e5e72c8
Set Jack min sdk according to LOCAL_SDK_VERSION. Gives Jack current
version when LOCAL_SDK_VERSION is not available.
Bug: 27371864
Change-Id: I5db233fe09aed0fae37fe9a92658bc8f24b86cdf
This is just to ensure no dex file is built with dx any more, cleaning
of the build rules from Jack optionality is still to be done.
Bug: 27218410
Change-Id: Iea2c66802b6c64c52690ad9d6d487bdce5f50b79
* When my_global_santitize is set and requires ASAN,
link with ASAN library even when local module is not
instrumented with ASAN, unless the local module is
the ASAN library itself.
* Add -Wl,--as-needed to my_ldflags for shared libraries
so that unneeded ASAN library would not become
a dependent of the built .so file.
* Change shared file and executable file link argument order
so that -Wl flags will have effect on linked-in libraries.
* Remove unused ADDRESS_SANITIZER_CONFIG_EXTRA_SHARED_LIBRARIES.
BUG: 27614834
Change-Id: I4eda6003f1f24e498cba91c043dbe1fabe522686
There was a typo in binary.mk. compile-dotdot-XXX-file in
definitions.mk was also using -include.
Bug: 26839129
Change-Id: I4a0145fb70413998cc65d30d2efcd68af07b4800
To rebuild odex files of Java libraries and apps,
we store the jars/apks without stripping the classes.dex inside the
platform.zip. We also save the build variables that may affect how we
rebuild an odex in pdk_dexpreopt_config.mk in the platform.zip.
We store the files and configuration only for libraries/apps that get
installed to the system.img (or vendor.img).
In PDK fusion build, we auto-generate prebuilt module definitions for
the javalib.jar and package.dex.apk carried in the platform.zip, using
configuration stored in pdk_dexpreopt_config.mk.
With the prebult modules, we override the implicit rule that directly
copies the odex from the platform.zip.
To rebuild odex of javalib.jar, we added support for prebuilt shared Java
library to prebiult_internal.mk. An installable prebuilt Java library is
treated as shared Java library, i.e. with classes.dex in the jar instead
of a set of .class files.
For apks in the platform.zip, we install the stripped version from
platform files inside platform.zip, instead of the package.dex.apk,
using a new variable LOCAL_REPLACE_PREBUILT_APK_INSTALLED. We can't
strip package.dex.apk because we can't re-sign the stripped apk at this
point.
We generate prebuilt module only if it's not already defined in the
source tree.
Bug: 27543283
Change-Id: I9e146f8b713d6f57c397fd28d88c9ab700757ca1
Set Jack min sdk according to LOCAL_SDK_VERSION. Gives Jack current
version when LOCAL_SDK_VERSION is not available.
Bug: 27371864
Change-Id: Ieba0219494f29d2737d2ca234317c3af7e5e72c8
- For host Java libraries, java-lib-files should return javalib.jar.
- Host dalvik Java libraries are special: factor out
host-dex-java-lib-files.
- Be explict that jack-lib-deps equals jack-lib-files.
Bug: 27451686
Change-Id: I9235384354e119ef7ebbf29b7e525d1ceea242e0
(cherry-pick from commit 063d0455e0)
- For host Java libraries, java-lib-files should return javalib.jar.
- Host dalvik Java libraries are special: factor out
host-dex-java-lib-files.
- Be explict that jack-lib-deps equals jack-lib-files.
Bug: 27451686
Change-Id: I9235384354e119ef7ebbf29b7e525d1ceea242e0
Also specify "-d keepdepfile" to ninja so .P files won't be
deleted by ninja.
-include for .s files are removed because GCC doesn't
generate .d files for .s files.
Bug: 26839129
Change-Id: If00e93c7a33449ec314a5cdba438475a32979f4e
* changes:
Remove debug statement
Tell Soong about HOST_CROSS_*
Update to use the latest clang-2629532.
Use newest clang static analyzers.
Add 64-bit windows cross-compiles
ACP was originally created to overcome differences with cp between
Linux, Darwin, and Windows. We've since dropped Windows as a build host,
and don't use features like '-u' anymore.
For most of our current usecases, 'acp' is identical to 'cp' except that
it splits 'cp -p' into 'acp -p' for mode and ownership, and 'acp -t' for
timestamps. On Linux, this could be specified using
'--preserve=mode,ownership', but Darwin doesn't have this.
Since we're removing the destination file before copying, 'cp' already
preserves the mode (modulated by the umask). So the only extra thing
that gets preserved with 'acp -p' is ownership, which we should not care
about in the build system. (In many cases we shouldn't be preserving
mode either, so that readonly source trees can actually be marked
readonly, but that will be a future change)
Change-Id: Ied96fdc303ac5c774347c07363daec8b6dfb22e4
Run jack with no outputs as a quick check for compilation errors and use
a timestamp to store that check was made.
Bug: 19069325
(cherry picked from commit 43084d9f49)
Change-Id: I9b84b503b28cfdfa245f91da0061ee3a79386b28
Run jack with no outputs as a quick check for compilation errors and use
a timestamp to store that check was made.
Bug: 19069325
(cherry picked from commit 43084d9f49)
Change-Id: I9b84b503b28cfdfa245f91da0061ee3a79386b28
If there's a symlink as the destination to one of these macros,
currently we'll write to the destination of that symlink instead of
overwriting the symlink. We've run into this a few times when a module
is added to replace a symlink that used to exist via
LOCAL_POST_INSTALL_CMD. These have required manual discovery, and
additions to CleanSpec.mk files:
http://android-review.googlesource.com/143334
Use `rm -f` for single-file targets to remove the destination before
copying. On Linux, `cp --remove-destination` can work, but is not
supported by Darwin or acp.
There may still be problems with dependencies when symlinks are
involved, since ninja will use the destination of the symlink to check
whether it is up to date. But at least with this change, if any
dependency gets regenerated, we'll properly reset the file.
Change-Id: I6d3ac0bd9ced5e21a0ff9dad0eaff012a7bc9c75
And everything special-cased on that. Add a warning if USE_NINJA is
set to let users know that it no longer changes anything.
Change-Id: Ib8739151fe26ea6bf8f76b7ac2b8f4097dab0b47
This is mostly the same as the existing 2ND_HOST / HOST_CROSS support.
The interesting thing I did here was make x86 the 'first' architecture,
and x86_64 the second. This way LOCAL_MULTILIB := first defaults to
32-bit windows modules.
windows-x86/bin <- defaults to 32-bit executables
windows-x86/lib <- 32-bit libraries, like before
windows-x86/lib64 <- 64-bit libraries
windows-x86/obj <- 32-bit intermediates
windows-x86/obj64 <- 64-bit intermediates
Then modules are registered with the names:
host_cross_liblog <- 32-bit, like before
host_cross_liblog_64 <- 64-bit
Bug: 26957718
(cherry picked from commit 9ecbf83259)
Change-Id: Iab2d36e20d7002568c3534e7781e9ac8ab21a4a9
- Restore old ordering of resource files to match AAPT behavior
- Change the order in which overlays are processed.
Change-Id: I9da88f6b4124e7f89a70eb485b4591d5c4c87d38
- Switch to static library's package-res.apk as the link artifact.
- For prebuilt AAR file, build package-res.apk using aapt2's "--dir"
option.
- New LOCAL variables:
LOCAL_USE_AAPT2: a module can opt-in with "LOCAL_USE_AAPT2 := true".
LOCAL_STATIC_ANDROID_LIBRARIES: static Java libraries with compiled
resources.
LOCAL_SHARED_ANDROID_LIBRARIES: shared Java libraries with compiled
resources.
Bug: 25958912
Change-Id: I4be2d1e8137555986338c2583cb39b0c97391751
These have been using SHARED_LIBRARIES, but aren't elf shared libraries.
Continue installing them to /system/lib[64], but do not apply any other
normal shared library logic to them.
(cherry picked from commit c6e194ffad)
Change-Id: I0041650af92cd8063ca33215010d5eff514a89bc
These have been using SHARED_LIBRARIES, but aren't elf shared libraries.
Continue installing them to /system/lib[64], but do not apply any other
normal shared library logic to them.
Change-Id: I3055ff86bb7b116c7107c41578ed6f0f304b1cf1
This changes the build system to provide the signapk tool with the
minSdkVersion of the APK being signed. signapk in turn will then use
SHA-256 instead of SHA-1 if minSdkVersion is 18 (JB MR2) or higher
(see c2c49ed0c1).
To avoid increasing incremental OTA update package sizes for already
released platforms, release build scripts disable the above logic when
signing target files ZIPs for pre-N platforms.
Bug: 25643280
(cherry picked from commit 2cfd1d108c)
Change-Id: I38450d07ddc05c705de40313f843beada8db7d98
This changes the build system to provide the signapk tool with the
minSdkVersion of the APK being signed. signapk in turn will then use
SHA-256 instead of SHA-1 if minSdkVersion is 18 (JB MR2) or higher
(see c2c49ed0c1).
To avoid increasing incremental OTA update package sizes for already
released platforms, release build scripts disable the above logic when
signing target files ZIPs for pre-N platforms.
Bug: 25643280
Change-Id: I3f2faaf49c6fa392ffbf1ee9f30de476f9f73231
This is mostly the same as the existing 2ND_HOST / HOST_CROSS support.
The interesting thing I did here was make x86 the 'first' architecture,
and x86_64 the second. This way LOCAL_MULTILIB := first defaults to
32-bit windows modules.
windows-x86/bin <- defaults to 32-bit executables
windows-x86/lib <- 32-bit libraries, like before
windows-x86/lib64 <- 64-bit libraries
windows-x86/obj <- 32-bit intermediates
windows-x86/obj64 <- 64-bit intermediates
Then modules are registered with the names:
host_cross_liblog <- 32-bit, like before
host_cross_liblog_64 <- 64-bit
Bug: 26957718
Change-Id: I9f119411acb43e973ec1e6bca3c1dc291c91556c
This is a reland of 4c474617d4
This time, we use awk instead of sed, and the script works
on Mac.
For C++ code llvm-rs-cc defines two targets but it defines
three targets for Java. The sed script was updated to handle
both cases appropriately.
Bug: 26839129
Change-Id: I1bca7d253764554d552950e03deedabaa9b7f17e