Don't build svg.idlx with new build scripts, and use publish/*.js as dependencies.
authorCameron McCormack <cam@mcc.id.au>
Thu, 02 Aug 2012 10:03:00 +1000
changeset 38 9eb7b7eae83f
parent 37 1f03f431517b
child 39 142d7a6c5f51
Don't build svg.idlx with new build scripts, and use publish/*.js as dependencies.
build.py
--- a/build.py	Wed Aug 01 20:21:21 2012 +1000
+++ b/build.py	Thu Aug 02 10:03:00 2012 +1000
@@ -88,6 +88,7 @@
 build_dir = join(repo_dir, 'build')
 publish_dir = join(build_dir, 'publish')
 tools_dir = normpath(join(repo_dir, '..', 'svg2-tools'))
+publishjs_dir = join(tools_dir, 'publish')
 
 if not exists(master_dir):
   exit(1, 'FAIL: build.py must be run from the root of the \'svg2\' repository')
@@ -151,7 +152,7 @@
 svg_idl = join(master_dir, "svg.idl")
 svg_idlx = join(build_dir, "svg.idlx")
 
-if not isfile(svg_idlx) or getmtime(svg_idl) > getmtime(svg_idlx):
+if not new_build and (not isfile(svg_idlx) or getmtime(svg_idl) > getmtime(svg_idlx)):
   toremove = [svg_idlx]
   run("java -classpath \"" + native_path(str(join(tools_dir, "idlparser", "idlparser.jar"))) +
       "\" au.id.mcc.idlparser.IDLToXML \"" + native_path(svg_idl) + "\" > " + svg_idlx)
@@ -160,11 +161,17 @@
 # Build chapters as required:
 
 deps = [
-  svg_idlx,
   join(master_dir, "publish.xml"),
   join(master_dir, "definitions.xml"),
+]
+if new_build:
+  for filename in os.listdir(publishjs_dir):
+    path = join(publishjs_dir, filename)
+    if os.path.isfile(path):
+      deps.append(path)
+else:
+  deps.append(svg_idlx)
   join(tools_dir, "publish.xsl")
-]
 deptimes = [getmtime(file) for file in deps]
 tobuild = []
 tobuild_names = []