diff options
author | Gaurav Shah <gauravsh@google.com> | 2015-11-02 22:22:40 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-11-02 22:22:40 +0000 |
commit | aed6805380810f51bb0d8b93fc5eac005a6de364 (patch) | |
tree | 988af46b809503390196d37e1a29227c0ac55698 | |
parent | a80f1e32575db5d66f4b4e6efdf79dd10dd2295e (diff) | |
parent | 67c2ed390fbb41b81002e93e3c6de62c585c6d4c (diff) | |
download | build-aed6805380810f51bb0d8b93fc5eac005a6de364.tar.gz |
Merge "Support build targets with no installable apps/packages"
-rw-r--r-- | core/Makefile | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/core/Makefile b/core/Makefile index 3a323d1a8f..2f8e8a774b 100644 --- a/core/Makefile +++ b/core/Makefile @@ -320,7 +320,12 @@ $(PACKAGE_STATS_FILE): $(PACKAGES_TO_STAT) @echo Package stats: $@ @mkdir -p $(dir $@) $(hide) rm -f $@ +ifeq ($(PACKAGES_TO_STAT),) +# Create empty package stats file if target builds no jar(s) or apk(s). + $(hide) touch $@ +else $(hide) build/tools/dump-package-stats $^ > $@ +endif .PHONY: package-stats package-stats: $(PACKAGE_STATS_FILE) @@ -1742,8 +1747,13 @@ $(APPS_ZIP): $(INSTALLED_SYSTEMIMAGE) @echo "Package apps: $@" $(hide) rm -rf $@ $(hide) mkdir -p $(dir $@) - $(hide) zip -qj $@ $(TARGET_OUT_APPS)/*/*.apk $(TARGET_OUT_APPS_PRIVILEGED)/*/*.apk - + $(hide) apps_to_zip=`find $(TARGET_OUT_APPS) $(TARGET_OUT_APPS_PRIVILEGED) -mindepth 2 -maxdepth 3 -name "*.apk"`; \ + if [ -z "$$apps_to_zip" ]; then \ + echo "No apps to zip up. Generating empty apps archive." ; \ + a=$$(mktemp /tmp/XXXXXXX) && touch $$a && zip $@ $$a && zip -d $@ $$a; \ + else \ + zip -qj $@ $$apps_to_zip; \ + fi #------------------------------------------------------------------ # A zip of emma code coverage meta files. Generated for fully emma |