From 77de883dd706b6357105cd304a01570af517f013 Mon Sep 17 00:00:00 2001 From: Nick Alexander Date: Fri, 30 Oct 2015 12:39:46 -0700 Subject: [PATCH] Bug 1216817 - Part 3: Add files from artifacts to $OBJDIR/_build_manifests/install/dist_bin. r=glandium This allows to run |mach artifact install| immediately after |mach configure| and not have a subsequent |mach build| delete the files that |mach artifact install| copied into dist/bin. --HG-- extra : commitid : DUlkhNNPeFt extra : rebase_source : 0bebba8f16f5496fda762f2ec5402d9c5ea83448 --- mobile/android/mach_commands.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/mobile/android/mach_commands.py b/mobile/android/mach_commands.py index 1a277b1df4d3..175fbd2e6459 100644 --- a/mobile/android/mach_commands.py +++ b/mobile/android/mach_commands.py @@ -10,6 +10,10 @@ import os import mozpack.path as mozpath +from mozpack.manifests import ( + InstallManifest, +) + from mozbuild.base import ( MachCommandBase, MachCommandConditions as conditions, @@ -168,7 +172,20 @@ class PackageFrontend(MachCommandBase): self._set_log_level(verbose) tree, job = self._compute_defaults(tree, job) artifacts = self._make_artifacts(tree=tree, job=job) - return artifacts.install_from(source, self.bindir) + + manifest_path = mozpath.join(self.topobjdir, '_build_manifests', 'install', 'dist_bin') + manifest = InstallManifest(manifest_path) + + def install_callback(path, file_existed, file_updated): + if path not in manifest: + manifest.add_optional_exists(path) + + retcode = artifacts.install_from(source, self.bindir, install_callback=install_callback) + + if retcode == 0: + manifest.write(manifest_path) + + return retcode @ArtifactSubCommand('artifact', 'last', 'Print the last pre-built artifact installed.')