Commit graph

57 commits

Author SHA1 Message Date
Colin Cross
63fe36abbe Use ifndef or ifeq () instead of ifeq ""
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
2017-02-21 17:29:10 -08:00
Dan Willemsen
f61e80b739 Improve installclean to catch more installed files
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
2017-02-13 13:05:02 -08:00
Dan Willemsen
c99f688971 Merge "Only update previous product config when changed" am: 2fcacb5a22 am: 5f381cfcb2
am: 8e77f86d58

Change-Id: Id86be7706a190b3264ba1aba4ce462cb785f15fa
2016-09-17 02:41:50 +00:00
Dan Willemsen
274d041107 Merge "Remove objclean" am: 1d4b79dde2 am: beaa6df59f
am: b4773ae479

Change-Id: Ic4333c9a139afc6625408142549cec834b1f1c9a
2016-09-16 22:11:31 +00:00
Dan Willemsen
2cfbdf460d Only update previous product config when changed
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
2016-09-16 13:17:08 -07:00
Dan Willemsen
da7d25f2d1 Remove objclean
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
2016-09-16 12:53:20 -07:00
Dan Willemsen
87e0ce4b8f Merge changes I9c735fe2,Ib918b2ed am: b51df6d171 am: 6d037230b8
am: a5b030a6f1

Change-Id: I1aed481e5746c411d3be7ca6417eee085fbefe31
2016-08-01 23:31:56 +00:00
Dan Willemsen
84f4f3b7df Don't clean obj/{APPS,JAVA_LIBRARIES} during installclean
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
2016-07-31 16:45:32 -07:00
Dan Willemsen
832932f835 Disable auto installclean for AAPT config change
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
2016-07-31 15:47:17 -07:00
Alex Light
a3e8e9c6f3 resolve merge conflicts of 3f7c348 to nyc-mr1-dev-plus-aosp
Bug: 29278988

Change-Id: Icffb9a280311c7d3c45f096243ddf18f7ebecd9d
2016-06-29 15:43:54 -07:00
Alex Light
4e358ab2c3 Add system_other partition, install odex files
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
2016-06-24 11:07:15 -07:00
Dan Willemsen
7574cb582d Remove special cases in installclean
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
2016-02-29 15:15:16 -08:00
Nick Kralevich
133e1e1f16 delete recovery policy on changing build types
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
2016-02-29 08:45:31 -08:00
Nick Kralevich
3cb10bbd3b delete recovery policy on changing build types
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
2016-02-27 10:41:41 -08:00
Sami Tolvanen
e018f608e8 Clear logd intermediates
Needed by changes from
  Idcdc5bff133f13c1267f0ec0a75cc8cf1ddbda0d

Bug: 26902605
Change-Id: Id3ca7889ede30b54b7af73dd50653ca1a20d59aa
(cherry picked from commit d7da0ffb20)
2016-02-22 13:58:56 -08:00
Sami Tolvanen
d7da0ffb20 Clear logd intermediates
Needed by changes from
  Idcdc5bff133f13c1267f0ec0a75cc8cf1ddbda0d

Bug: 26902605
Change-Id: Id3ca7889ede30b54b7af73dd50653ca1a20d59aa
2016-02-10 15:41:03 -08:00
Shinichiro Hamaji
1326f65c2f Write clean_steps.mk with multiple commands
$(INTERNAL_CLEAN_STEPS) could be too big to be fit in a single
command line.

Bug: 26707439
Change-Id: Ieed6c772980d06c2418a9246b025bca7a6f568aa
2016-01-27 14:59:56 +09:00
Ying Wang
a79e1324a0 Remove the prebuilt tools cleanstep logic.
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
2015-12-15 12:39:02 -08:00
Ying Wang
eadaa954ce Fix writing clean_steps.mk in the first build.
Change-Id: Ieddc799f38e5d1522e329e8300bd9f49c26c70ae
2015-08-04 12:11:54 -07:00
Shinichiro Hamaji
14da1424e0 Do not update previous_XXX.mk when there is no change
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
2015-07-21 09:40:02 +09:00
Ying Wang
d37b540a39 Auto-clean host tools when switching between apps_only and platform build.
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)
2015-07-20 17:31:08 -07:00
Evgenii Stepanov
a36223e7e0 Clean intermediate files if SANITIZE_TARGET has changed.
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
2015-06-19 11:15:50 -07:00
Yohann Roussel
f09e59eb52 [DO NOT MERGE] Compile using Jack.
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:
b4c49cba57
22c3fa6d73
138768c1bb
5dd3e1d312
83d5d04047
8bc90fd2d6
140274707e
0fbc9ff2a2
833b427d72
f9a27f45b4
2809666941
37822c443d
c6b44d43c3
d2a76c14bf
06744f60fc
95573d5036
b821391614
2794e7b582
801f2c44d0
c76d99dca1
f528e132d6
76a5e0bd1a
e25b3984ff Partially, only Jack related parts werekept
ec46a3b71f
abee3a9f41
77cbe10fd9
daf07db4cd
b6bfb5893a

Ie all Jack related changes untill
b6bfb5893a
except
a96cc59ab5 "Use Jack by default"

Change-Id: If9d47ef1c4fd1e6765ad2a47d816c1ad3cfab0e3
2015-05-19 18:31:05 +02:00
Ying Wang
961096fada Remove ancient SDK cleanbuild rule
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
2015-01-06 16:49:20 -08:00
Paul Lawrence
a6a0435770 fs_mgr is now different on different build types
This is to enable compile time selection of disable-verity behavior

See https://googleplex-android-review.git.corp.google.com/#/c/563402/

Bug: 17691572
Change-Id: I6d77e39f070f2a753e09e5634cc3d9ebfceccada
2014-10-08 15:05:21 -07:00
Ying Wang
4221873693 Delete vendor and oem staging directory in "make installclean".
Change-Id: If3211772ea37d4c249c2dc5cc69bd9f48a39b6e3
2014-07-18 09:56:13 -07:00
Ying Wang
451dbd7c00 am cc2e90e6: am 0f1ca830: Merge "Rewrite the clean steps for TARGET_2ND_ARCH."
* commit 'cc2e90e653c55724f20410347d709b70b1eaf105':
  Rewrite the clean steps for TARGET_2ND_ARCH.
2014-06-18 22:58:30 +00:00
Ying Wang
f6268b8ed9 Rewrite the clean steps for TARGET_2ND_ARCH.
Convert clean rules from TARGET_ARCH to TARGET_2ND_ARCH and vice versa.

Change-Id: I5711b38cd834272d26d78e5cf847e97f27139c5b
2014-06-18 14:17:13 -07:00
Ji-Hwan Lee
cd18df970e am eaf4c758: am a7748859: Merge "Clear *.ini and skin directory on installclean"
* commit 'eaf4c7581f3c736ada725f75bb1b6218be26c361':
  Clear *.ini and skin directory on installclean
2014-05-16 02:00:37 +00:00
Ji-Hwan Lee
0a5b178fc3 Clear *.ini and skin directory on installclean
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
2014-05-15 20:59:01 +09:00
Adam Hampson
57afaa5373 Add init.environ.rc to installclean
BOOTCLASSPATH needs to be rebuilt when switching between build
targets.

Bug: 13282187

Change-Id: I16816abb4246878a60e1aa8c91b6b38c7339950e
Signed-off-by: Adam Hampson <ahampson@google.com>
2014-03-07 15:55:18 -08:00
Ying Wang
ad7fd29b31 Don't bother going through the source tree
Don't bother going through the source tree in more circumstances:
all cleaning goals, helping goals, no-deps goals.

Bug: 10244578
Change-Id: Id53a249085c62838e4193962a85e0ac34f46954f
2013-08-09 10:08:30 -07:00
Ying Wang
949c4eb073 Delete the kernel file when build config is changed
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
2013-08-01 15:46:25 -07:00
repo sync
d3e01c1577 Merge commit 'e8c9e82d' into manualmerge
Change-Id: Iaf02a0ab32918064248410aab95facac6a2b9675
2013-03-26 17:21:01 -07:00
William Roberts
a8b3d54101 Add sepolicy and mac_perms to installclean
Remove the output files for SELinux policy
and mac_permissions.xml mapping for changes
between user and eng build.

Change-Id: Ie27dcedde0c22ce917d90466a763698c86919530
2013-03-26 14:54:51 -07:00
Ying Wang
50e52fa11e Don't run cleanspecs if you are using mm/mmm.
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
2013-02-22 18:15:29 -08:00
Ying Wang
4a2f173339 Dont' write out the clean_steps.mk if
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
2013-02-13 11:57:45 -08:00
Ying Wang
9cb3731a77 Run clean steps in only given paths when using mm/mmm
To speed up mm/mmm start time.
At the same time, we should copy over the other clean steps.

Bug: 7186768
Change-Id: I250e64256343afe788d79817af36eafaadb47028
2012-09-28 10:23:52 -07:00
Ying Wang
6ea58cb3dc Run clean steps in only given paths when using mm/mmm
To speed up mm/mmm start time.
At the same time, we should copy over the other clean steps.

Bug: 7186768
Change-Id: I250e64256343afe788d79817af36eafaadb47028
2012-09-26 16:00:54 -07:00
Ying Wang
fab760549c Clean up intermediate files for adbd and init in installclean.
They are really exceptions and we shouldn't do that in general.
Bug: 7170444

Change-Id: I7163181e495c52db9aa62a360309d8973df1985f
2012-09-21 14:11:41 -07:00
Dianne Hackborn
a0f464a8e7 New PRODUCT_AAPT_PREF_CONFIG.
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
2011-10-14 19:37:57 -07:00
Dima Zavin
854233e9b2 core: remove the built fake packages (not installed) on installclean
Change-Id: I1ff3754132a48c545d0a3215ae23d204aba50637
Signed-off-by: Dima Zavin <dima@android.com>
2011-10-12 13:34:32 -07:00
Dima Zavin
7dac5909d2 core: remove fake package timestamps on installclean
Change-Id: Ic07af1f751b301b69fa5cbbb7bf51ad718d54d52
Signed-off-by: Dima Zavin <dima@android.com>
2011-10-11 15:54:10 -07:00
Ying Wang
4f1ab92aac Move screen density config from PRODUCT_LOCALES to PRODUCT_AAPT_CONFIG
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
2011-03-15 13:19:30 -07:00
Ying Wang
096bb3dd00 Don't prepend ./ before the dirs to be removed
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
2011-01-04 17:11:59 -08:00
Ying Wang
a83940fa78 Move odex related files to product-specific dir.
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
2010-10-01 14:41:43 -07:00
Ying Wang
e7874c4308 Integrate dexpreopt into the build system.
Change-Id: Id67f85d0f5c8674f5bc22e431114ca73625811ef
2010-09-22 16:51:53 -07:00
Joe Onorato
53b3cadbba The ICU data is no longer compiled directly into the shared library.
Change-Id: I79accedc16d6e62a95c0ec6f08ad2538013cd0b3
2010-07-13 19:05:37 -07:00
Ying Wang
fa9ae7bbbe Decentralizes cleanspecs.
After this change, you should add-clean-step at the end of CleanSpec.mk
in your project, instead of the centralized cleanspecs.mk in build/core.
2010-03-03 13:08:28 -08:00
Eric Fischer
7bbec3ab97 Automated import from //branches/master/...@142758,142758 2009-03-25 16:12:29 -07:00