From a8f980afe85d26774806ba9c987423185f1c11ac Mon Sep 17 00:00:00 2001 From: Clément Pit--Claudel Date: Thu, 27 Aug 2015 17:55:08 -0700 Subject: Make the packaging script Windows-compatible --- package.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'package.py') diff --git a/package.py b/package.py index 22ed232c..7fc624cf 100644 --- a/package.py +++ b/package.py @@ -101,7 +101,10 @@ class Release: flush("done!") def unpack(self): - shutil.rmtree(self.z3_directory) + try: + shutil.rmtree(self.z3_directory) + except FileNotFoundError: + pass with zipfile.ZipFile(self.z3_zip) as archive: archive.extractall(CACHE_DIRECTORY) flush("done!") @@ -165,9 +168,13 @@ def run(cmd): def build(): os.chdir(ROOT_DIRECTORY) flush(" - Building") - builder = "xbuild" if MONO else "xbuild" - run([builder, "Source/Dafny.sln", "/t:Clean"]) - run([builder, "Source/Dafny.sln", "/p:Configuration=Checked", "/t:Rebuild"]) + builder = "xbuild" if MONO else "msbuild" + try: + run([builder, "Source/Dafny.sln", "/p:Configuration=Checked", "/p:Platform=Any CPU", "/t:Clean"]) + run([builder, "Source/Dafny.sln", "/p:Configuration=Checked", "/p:Platform=Any CPU", "/t:Rebuild"]) + except FileNotFoundError: + flush("Could not find '{}'! On Windows, you need to run this from the VS native tools command prompt.".format(builder)) + sys.exit(1) def pack(releases): flush(" - Packaging {} Dafny archives".format(len(releases))) -- cgit v1.2.3