Write into a temp file, then use `cmp` to determine whether to update
the actual file. This means that we'll only run Kati twice on a clean
build, since we'll omit the redundant write during the regeneration
check.
Simplify writing using $(file >) instead of $(shell), which doesn't have
character count limitations.
Bug: 35970961
Test: m clean; m -j nothing; m -j nothing; m -j nothing
Test: Ensure clean_steps.mk is equivalent before/after
Change-Id: Id574f416647434ab8d11ed3481da21b55e8797b7
This can be a little faster, but also means that we don't need to call
kati/ninja twice when we need to handle the automatic installclean.
Test: m -j installclean
Test: m -j dataclean
Change-Id: I8f5e5544bcf30c58bf9abee30a37256cb18436ac
This way kati doesn't need to keep state for which build got run last,
and we have to run kati less often. This was forcing another kati run
for an empty out directory, and a kati run (or two) every time you
switched products that shared a device.
Bug: 35970961
Test: m clean; m -j blueprint_tools; m -j blueprint_tools; m -j blueprint_tools
Test: lunch aosp_arm-eng; m -j blueprint_tools; lunch full-eng; m -j blueprint_tools; <repeat>
Change-Id: I825a0868fb7059016a940c76244527432e3e7cff
This is only intended for testing purposes -- so that we can run build
system tests and verify that kati only gets run once for each
configuration. CleanSpecs necessarily write state that require us to
re-run kati twice.
Test: export NO_ANDROID_CLEANSPEC=true; rm -rf out; m -j; m -j
Change-Id: I635a8d8b6754dff82fbc7f20c500d06d7cf6c4f2
ifeq with quotes is technically correct make syntax, but rarely used.
Replace it with the simpler ifndef when comparing against empty, or
with parenthesis for consistency.
Test: builds
Change-Id: Idcbe0586c4626c67d560694596b0bd9f5f93484a
Remove more installation directories. This gets called in between each
incremental build on our build servers.
Bug: 35267243
Test: (m -j; m -j installclean; m -j) ensure no large recompiles
Change-Id: Ied6bea5cad05c1f5e98b1bd1a30fb28ff09df23b
I'm working on removing the --ignore_dirty=$(OUT_DIR)/% argument from
Kati. If we're always writing to a file that we're also reading, then
with that flag removed, we'll always reparse all the makefiles.
So instead, use the method from the generated java file cleanup where we
read from a "previous" file, write to a "current" file, then use a
cmp || mv to overwrite the "previous" file if necessary. When the flag
is removed, this will cause Kati to need to run twice any time this
changes, but it's better than forever.
Bug: 30947985
Test: Switch between aosp_arm-eng and full-eng
Change-Id: Id2d1445809b60ce26700bb2aca765df3b5c2b360
We don't need to manually remove objects when switching SANITIZE_TARGET
-- that will be handled by Ninja noticing that the command lines are
different.
Bug: 30947985
Test: None
Change-Id: I83c15981cf6ea258bb7fa85490b0b1ede1058aa6
Anything product specific in here should be caught by an explicit
dependency, or the command line changing. This drastically reduces the
build time after an installclean.
Before this change, we were re-running all dex2oat commands after each
installclean, even if nothing changed.
Change-Id: I9c735fe2c5d82109d56996021502319179e43671
PRODUCT_AAPT_CONFIG and PRODUCT_AAPT_PREF_CONFIG don't affect the
installed file list, they only affect how some files are built. The
changing command line is already noticed by ninja, so we'll only re-run
the necessary commands instead of a full installclean.
Change-Id: Ib918b2edeefc539b7f88cb22a1d751c397973b1d
For AB devices, support flashing two system partitions for factory use.
The normal system image on one partition, but without dex preopt. And a
system_other image that just contains the odex files. The dex files will
not be stripped out of the system image, in case the second system
partition is wiped.
Setting BOARD_USES_SYSTEM_OTHER_ODEX := true in the BoardConfig.mk
enables this behavior.
One can control which directories are placed in system_other by the
SYSTEM_OTHER_ODEX_FILTER configuration variable. Currently we default
to only copying only app and priv-app odexs.
Bug: 29278988
Change-Id: I7f4e87da919e7dc6a89fd8c668193cd4e98631bc
When switch build types or products, it's no longer necessary to special
case these projects that change their command line based on the build
type or product. Ninja keeps track of the command line last used to
create a file, and will mark it as dirty if the new command line is
different.
Change-Id: I905ff9599eae2952bddc05e7328f77f0849be20a
When the build type changes (for example, from "shamu-userdebug"
to "shamu-user"), the build system doesn't delete all files
and start over. Rather, build artifacts from the old build type
are reused for the new build type.
This is problematic for the recovery SELinux policy, which differs
between build types. Reusing a userdebug policy on a user build
is inappropriate and could lead to security bugs.
Force the deletion of the recovery SELinux policy when changing
build types, so it can be properly regenerated. This is consistent
with how we treat the normal SELinux policy (see commit
a8b3d54101).
(cherry picked from commit 3cb10bbd3b)
Change-Id: I1d8ad7e06112777c66abed4546dadb85d35e33e1
When the build type changes (for example, from "shamu-userdebug"
to "shamu-user"), the build system doesn't delete all files
and start over. Rather, build artifacts from the old build type
are reused for the new build type.
This is problematic for the recovery SELinux policy, which differs
between build types. Reusing a userdebug policy on a user build
is inappropriate and could lead to security bugs.
Force the deletion of the recovery SELinux policy when changing
build types, so it can be properly regenerated. This is consistent
with how we treat the normal SELinux policy (see commit
a8b3d54101).
Change-Id: I4ebafe3712dc121644828f6538865061aad58cc0
Needed by changes from
Idcdc5bff133f13c1267f0ec0a75cc8cf1ddbda0d
Bug: 26902605
Change-Id: Id3ca7889ede30b54b7af73dd50653ca1a20d59aa
(cherry picked from commit d7da0ffb20)
We switched to running prebuilt host tools in place in
prebuilts/sdk/tools in TARGET_BUILD_APPS build. This logic is no longer
needed.
Change-Id: Ibf88b3c0a09fb3a1a04b25403457c48851ecc6f4
I'm adding a rule which regenerates ninja files to kati:
8666cfba20
With this regeneration rule, unnecessary re-generation will happen
when these .mk files are updated even if there are no changes in
their contents. With this patch, these .mk files are updated only
when the contents will be actually changed.
Change-Id: I4c796f9454502f6bb25019b3806ca577ea5258c1
For apps_only (also PDK build) we use prebuilt host tools in
prebuilts/sdk/tools; For platform build we use tools built from source.
Auto-clean intermediate files of these tools when build type change is
detected.
Bug: 20213206
Change-Id: I9173af322684c017fdb91a3abfbe39ecfe5650e9
(cherry-pick from commit 036b53b6de)
Do not clean installed files, only intermediate files. This way, two
consequitive builds first without, then with SANITIZE_TARGET will
produce a frankenbuild with both sets of shared libraries.
Bug: 21785137
Change-Id: I231868b15331be942c783458cf36233c2e7740d3
This allows to compile dex targeted java sources using Jack and Jill.
Default is still to compile with the legacy toolchain. Default can be
switched to the new toolchain by setting environement variable:
export ANDROID_COMPILE_WITH_JACK=true
Toolchain can also be forced for one module by defining
LOCAL_JACK_ENABLED:=full # disabled, full, incremental
in the mk portion defining the module.
Jack execution environement can be controlled with:
Global variable ANDROID_JACK_VM allow to change the jvm executing Jack.
Global variable ANDROID_JACK_VM_ARGS allows to change default args given
to the jvm.
Global variable ANDROID_JACK_EXTRA_ARGS allows to define some default args
to give to Jack
LOCAL_JACK_VM_ARGS allows to override default args given to the jvm for
the module.
LOCAL_JACK_EXTRA_ARGS allows to override default args passed to Jack.
This includes cherry-picks of the following changes:
b4c49cba5722c3fa6d73138768c1bb5dd3e1d31283d5d040478bc90fd2d6140274707e0fbc9ff2a2833b427d72f9a27f45b4280966694137822c443dc6b44d43c3d2a76c14bf06744f60fc95573d5036b8213916142794e7b582801f2c44d0c76d99dca1f528e132d676a5e0bd1ae25b3984ff Partially, only Jack related parts werekept
ec46a3b71fabee3a9f4177cbe10fd9daf07db4cdb6bfb5893a
Ie all Jack related changes untill
b6bfb5893a
except
a96cc59ab5 "Use Jack by default"
Change-Id: If9d47ef1c4fd1e6765ad2a47d816c1ad3cfab0e3
In anceint time we didn't have an "sdk" product so that we had to run
"make sdk" in a device product configuration.
Now we have SDK specific product configuration and we don't do "make
sdk" in device product configuration.
Change-Id: I40d58d51261498017bbe7e574c8128afc77e9b96
Currently, skin directory remains across different emulator targets, and
need manual removal. Also, clear hardware-qemu.ini and config.ini.
(See https://android-review.googlesource.com/94692 for config.ini)
Change-Id: Iaa5849ad043ed3f317325ba1d6df287953636f7a
BOOTCLASSPATH needs to be rebuilt when switching between build
targets.
Bug: 13282187
Change-Id: I16816abb4246878a60e1aa8c91b6b38c7339950e
Signed-off-by: Adam Hampson <ahampson@google.com>
Don't bother going through the source tree in more circumstances:
all cleaning goals, helping goals, no-deps goals.
Bug: 10244578
Change-Id: Id53a249085c62838e4193962a85e0ac34f46954f
Now we have products of the same device type but with different kernel,
and we want to do incremental build on them.
Bug: 10133257
Change-Id: Iff4aae11e474d2822f02c62822bd028a5ba5b47a
Remove the output files for SELinux policy
and mac_permissions.xml mapping for changes
between user and eng build.
Change-Id: Ie27dcedde0c22ce917d90466a763698c86919530
There is lurky bug in the previous logic I believe:
in rare cases, people saw almost all cleansteps rerun.
Anyway, it's very rare that you need to run cleansteps when you run mm/mmm.
Change-Id: I42e84b3bf01590712ba1b167fe9a500f4ae1ddde
If this is mm/mmm and there is no pre-existing clean_steps.mk.
Otherwise, the build system will run almost all the clean steps in the
sourcet tree if you do a full build next.
Change-Id: I5fe1e99c4f09629e4455319ea664cfba4ac634ea
To speed up mm/mmm start time.
At the same time, we should copy over the other clean steps.
Bug: 7186768
Change-Id: I250e64256343afe788d79817af36eafaadb47028
To speed up mm/mmm start time.
At the same time, we should copy over the other clean steps.
Bug: 7186768
Change-Id: I250e64256343afe788d79817af36eafaadb47028
To use the new aapt --preferred-configurations option. For use with Prime
to be able to strip everything but xhdpi density bitmaps selectively,
not stripping when this would result in no data for the resource.
Change-Id: I4e1012929b8f9b0b1e79c06496647f69661ba1f2
With this change, PRODUCT_LOCALES will contain only locales.
Other aapt config flags, such as *dpi, small/normal/large/xlarge,
should go to PRODUCT_AAPT_CONFIGS.
Bug: 4086309
Change-Id: I922f153d79777a9522c542a3907111193b40e7b7
So that installclean can be done properly when OUT_DIR is set to an
obsolute path, such as /buildbot/out_dirs/git_gingerbread.
Bug: 3321625
Change-Id: I87667355aa03f31613a8f6a5e17d7e469bf5335f
For target Java libraries, now the LOCAL_BUILT_MODULE includes both javalib.jar
and the .odex file, if dexpreopt is enabled.
These 2 files are moved to a product-specific dir in this change.
For target Java Libraries, $(intermediates) now points to the product-specific dir.
There is still a javalib.jar in the $(intermediates.COMMON) dir, which is used as dependency.
Nothing is changed for host Java libraries.
Change-Id: I2546dbb940c74537864ca002d1acb49bb731fbbc