From ce1c2de044c91624370411e23acab13b0381949b Mon Sep 17 00:00:00 2001 From: mikebarnett Date: Wed, 15 Jul 2009 21:03:41 +0000 Subject: Initial set of files. --- Chalice/make.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Chalice/make.py (limited to 'Chalice/make.py') diff --git a/Chalice/make.py b/Chalice/make.py new file mode 100644 index 00000000..e3ba1ab9 --- /dev/null +++ b/Chalice/make.py @@ -0,0 +1,35 @@ +import os +import glob +import sys +import datetime + +bindir = "bin" + +srcspecs = ["src\\*.scala"] +srcfiles = [file for spec in srcspecs for file in glob.glob(spec)] + +buildstamp = "makestamp" + +lastbuild = None +if os.path.exists(buildstamp): + lastbuild = os.path.getmtime(buildstamp) + +changedfiles = [file for file in srcfiles if not lastbuild or lastbuild <= os.path.getmtime(file)] + +if not changedfiles: + print "Build is up-to-date." + sys.exit(0) + +def printtime(): + print datetime.datetime.now().strftime("%H:%M:%S") + +printtime() +cmd = "scalac -d bin -unchecked -deprecation " + " ".join(changedfiles) + " & if errorlevel 1 exit 1" +print cmd +result = os.system(cmd) +printtime() + +if result == 0: + open(buildstamp, "w").close() +else: + print "Build failed." -- cgit v1.2.3