root/livinglogic.python.www/site/m.py @ 171:6bcbf974c8e1

Revision 171:6bcbf974c8e1, 9.8 KB (checked in by Walter Doerwald <walter@…>, 17 years ago)

Update everything to XIST 2.0 and add the XIST 2.0 download

  • Property exe set to *
Line 
1#!/usr/bin/env python
2
3from ll.xist import xsc
4
5import sys, os, os.path, ExceptHook
6
7sys.excepthook = ExceptHook.ExceptHookMono()
8
9from ll import make, url
10
11p = make.Project()
12
13print "Creating dependancies ...",
14here = url.here()
15root = url.URL("root:")
16sourcedir = url.Dirname(".")
17builddir = url.Dirname("../build")
18installdir = url.Dirname("../install")
19repositorydir = url.Dirname("~")
20pythonrootdir = url.Dirname("~/pythonroot/ll")
21try:
22    id = os.environ["MAKE_XIST_BASE"]
23except KeyError:
24    id = "../xist_src/"
25if not os.path.exists(id):
26    id = "~/LivingLogic/xist/"
27pixeldir = url.Dirname(id)
28xistnamespacesdir = url.Dirname("~/xistnamespaces")
29
30build = make.PhonyTarget(p, "build")
31install = make.PhonyTarget(p, "install")
32clean = make.PhonyTarget(p, "clean", make.CommandAction("rm -rf %s" % (here/builddir).asFilename()))
33installclean = make.PhonyTarget(p, "installclean", make.CommandAction("rm -rf %s/*" % (here/installdir).asFilename()))
34installclean.dependOn(clean)
35
36namespaces = []
37files = sourcedir.files()
38
39pixelfiles = [ file for file in pixeldir.files() if file.ext=="gif" ]
40
41extensions = {
42    "gif": make.ImageTarget,
43    "jpg": make.ImageTarget,
44    "png": make.ImageTarget,
45    "css": make.CascadingStyleSheetTarget,
46    "js": make.JavascriptTarget,
47    "xml": make.XMLTarget,
48    "html": make.HTMLTarget,
49    "phtml": make.HTMLTarget,
50    "shtml": make.HTMLTarget,
51    "jsp": make.HTMLTarget,
52    "jspp": make.HTMLTarget,
53    "xsc": make.XISTTarget,
54    "pxsc": make.XISTTarget,
55    "sxsc": make.XISTTarget,
56    "jxsc": make.XISTTarget,
57    "jxscp": make.XISTTarget,
58    "py": make.PythonTarget
59}
60
61copyaction = make.CopyAction()
62copyextensions = {"gif": 1, "jpg": 1, "css": 0, "js":0 }
63auxFiles = []
64for id in files:
65    ext = id.ext
66    try:
67        aux = copyextensions[ext]
68    except KeyError:
69        continue
70    class_ = extensions[ext]
71    f = class_(p, here/sourcedir/id)
72    if aux:
73        auxFiles.append(f)
74    f2 = class_(p, here/builddir/id, copyaction)
75    f3 = class_(p, here/installdir/id, copyaction)
76    f2.dependOn(make.MainDep, f)
77    f3.dependOn(make.MainDep, f2)
78    build.dependOn(f2)
79    install.dependOn(f3)
80
81for id in pixelfiles:
82    f = make.ImageTarget(p, here/pixeldir/id)
83    auxFiles.append(f)
84    f2 = make.ImageTarget(p, here/builddir/id, copyaction)
85    f3 = make.ImageTarget(p, here/installdir/id, copyaction)
86    f2.dependOn(make.MainDep, f)
87    f3.dependOn(make.MainDep, f2)
88    build.dependOn(f2)
89    install.dependOn(f3)
90
91def makeNamespace(id):
92    f = make.XISTNamespaceTarget(p, id)
93    f2 = make.XISTNamespaceTarget(p, here/builddir/id.path.replace("_namespace.py", ".py"), copyaction)
94    f2.dependOn(make.MainDep, f)
95    return f2
96
97pyns = makeNamespace(url.Filename("Python_namespace.py"))
98cssns = makeNamespace(url.Filename("css_namespace.py"))
99
100root = url.root()
101xistaction = make.XISTAction(encoding="iso-8859-1", xhtml=1, lang="en", targetroot=here/builddir)
102for id in files:
103    ext = id.ext
104    if ext and ext.endswith("xsc"):
105        newid = id.withExt(ext[:-3])
106        f = make.XISTTarget(p, here/sourcedir/id, base=root/newid)
107        f2 = make.HTMLTarget(p, here/builddir/newid, xistaction, base=root/newid)
108        f3 = make.HTMLTarget(p, here/installdir/newid, copyaction, base=root/newid)
109        f2.dependOn(make.MainDep, f)
110        if ext=="cssxsc":
111            f2.dependOn(cssns)
112        else:
113            f2.dependOn(pyns)
114        f2.dependOn(*auxFiles)
115        f3.dependOn(make.MainDep, f2)
116        build.dependOn(f2)
117        install.dependOn(f3)
118
119        pagesrcid = id.withFile(id.file[:-len(ext)-1] + "_page.txt")
120        f2 = make.XISTTarget(p, here/builddir/pagesrcid, copyaction)
121        f3 = make.XISTTarget(p, here/installdir/pagesrcid, copyaction)
122        f2.dependOn(make.MainDep, f)
123        f3.dependOn(make.MainDep, f2)
124        build.dependOn(f2)
125        install.dependOn(f3)
126
127mod_xist = make.PythonTarget(p, here/pythonrootdir/"xist/__init__.py")
128mod_xist_xsc = make.PythonTarget(p, here/pythonrootdir/"xist/xsc.py")
129mod_xist_ns = make.PythonTarget(p, here/pythonrootdir/"xist/ns/__init__.py")
130mod_xist_ns_html = make.PythonTarget(p, here/pythonrootdir/"xist/ns/html.py")
131mod_xist_ns_wml = make.PythonTarget(p, here/pythonrootdir/"xist/ns/wml.py")
132mod_xist_ns_ihtml = make.PythonTarget(p, here/pythonrootdir/"xist/ns/ihtml.py")
133mod_xist_ns_docbook = make.PythonTarget(p, here/pythonrootdir/"xist/ns/docbook.py")
134mod_xist_ns_abbr = make.PythonTarget(p, here/pythonrootdir/"xist/ns/abbr.py")
135mod_xist_ns_cond = make.PythonTarget(p, here/pythonrootdir/"xist/ns/cond.py")
136mod_xist_ns_form = make.PythonTarget(p, here/pythonrootdir/"xist/ns/form.py")
137mod_xist_ns_php = make.PythonTarget(p, here/pythonrootdir/"xist/ns/php.py")
138mod_xist_ns_jsp = make.PythonTarget(p, here/pythonrootdir/"xist/ns/jsp.py")
139mod_xist_ns_meta = make.PythonTarget(p, here/pythonrootdir/"xist/ns/meta.py")
140mod_xist_ns_ruby = make.PythonTarget(p, here/pythonrootdir/"xist/ns/ruby.py")
141mod_xist_ns_specials = make.PythonTarget(p, here/pythonrootdir/"xist/ns/specials.py")
142mod_xist_ns_htmlspecials = make.PythonTarget(p, here/pythonrootdir/"xist/ns/htmlspecials.py")
143mod_xist_ns_strutshtml = make.PythonTarget(p, here/pythonrootdir/"xist/ns/struts_html.py")
144mod_xist_ns_strutsconfig = make.PythonTarget(p, here/pythonrootdir/"xist/ns/struts_config.py")
145mod_xist_ns_doc = make.PythonTarget(p, here/pythonrootdir/"xist/ns/doc.py")
146mod_xist_ns_css = make.PythonTarget(p, here/pythonrootdir/"xist/ns/css.py")
147mod_xist_ns_cssspecials = make.PythonTarget(p, here/pythonrootdir/"xist/ns/cssspecials.py")
148mod_xist_sources = make.PythonTarget(p, here/pythonrootdir/"xist/sources.py")
149mod_xist_parsers = make.PythonTarget(p, here/pythonrootdir/"xist/parsers.py")
150mod_xist_converters = make.PythonTarget(p, here/pythonrootdir/"xist/converters.py")
151mod_xist_presenters = make.PythonTarget(p, here/pythonrootdir/"xist/presenters.py")
152mod_xist_publishers = make.PythonTarget(p, here/pythonrootdir/"xist/publishers.py")
153mod_url = make.PythonTarget(p, here/pythonrootdir/"url.py")
154mod_make = make.PythonTarget(p, here/pythonrootdir/"make.py")
155mod_sisyphus = make.PythonTarget(p, here/pythonrootdir/"sisyphus.py")
156mod_ansistyle = make.PythonTarget(p, here/pythonrootdir/"ansistyle.py")
157mod_fileutils = make.PythonTarget(p, here/pythonrootdir/"fileutils.py")
158mod_sql = make.PythonTarget(p, here/pythonrootdir/"sql.py")
159
160# Additional dependencies (News & Install)
161p[here/builddir/"ansistyle/History.html"].dependOn(make.XMLTarget(p, here/repositorydir/"LivingLogic/Python/ansistyle/NEWS.xml"))
162p[here/builddir/"fileutils/History.html"].dependOn(make.XMLTarget(p, here/repositorydir/"LivingLogic/Python/fileutils/NEWS.xml"))
163p[here/builddir/"fileutils/Installation.html"].dependOn(make.XMLTarget(p, here/repositorydir/"LivingLogic/Python/fileutils/INSTALL.xml"))
164p[here/builddir/"sisyphus/History.html"].dependOn(make.XMLTarget(p, here/repositorydir/"LivingLogic/Python/sisyphus/NEWS.xml"))
165p[here/builddir/"sql/History.html"].dependOn(make.XMLTarget(p, here/repositorydir/"LivingLogic/Python/sql/NEWS.xml"))
166p[here/builddir/"sql/Installation.html"].dependOn(make.XMLTarget(p, here/repositorydir/"LivingLogic/Python/sql/INSTALL.xml"))
167p[here/builddir/"xist/History.html"].dependOn(make.XMLTarget(p, here/repositorydir/"LivingLogic/xist/NEWS.xml"))
168p[here/builddir/"xist/Installation.html"].dependOn(make.XMLTarget(p, here/repositorydir/"LivingLogic/xist/INSTALL.xml"))
169p[here/builddir/"xist/Howto.html"].dependOn(make.XMLTarget(p, here/repositorydir/"LivingLogic/xist/HOWTO.xml"))
170p[here/builddir/"url/History.html"].dependOn(make.XMLTarget(p, here/repositorydir/"LivingLogic/Python/url/NEWS.xml"))
171p[here/builddir/"url/Installation.html"].dependOn(make.XMLTarget(p, here/repositorydir/"LivingLogic/Python/url/INSTALL.xml"))
172p[here/builddir/"make/History.html"].dependOn(make.XMLTarget(p, here/repositorydir/"LivingLogic/Python/make/NEWS.xml"))
173p[here/builddir/"make/Installation.html"].dependOn(make.XMLTarget(p, here/repositorydir/"LivingLogic/Python/make/INSTALL.xml"))
174
175# Docstring and module source dependencies
176params = (
177    ("xist/", (mod_xist, mod_xist_ns_doc)),
178    ("xist/xsc/", (mod_xist_xsc, mod_xist_ns_doc)),
179    ("xist/ns/", (mod_xist_ns, mod_xist_ns_doc)),
180    ("xist/ns/html/", (mod_xist_ns_html, mod_xist_ns_doc)),
181    ("xist/ns/wml/", (mod_xist_ns_wml, mod_xist_ns_doc)),
182    ("xist/ns/ihtml/", (mod_xist_ns_ihtml, mod_xist_ns_doc)),
183    ("xist/ns/docbook/", (mod_xist_ns_docbook, mod_xist_ns_doc)),
184    ("xist/ns/abbr/", (mod_xist_ns_abbr, mod_xist_ns_doc)),
185    ("xist/ns/cond/", (mod_xist_ns_cond, mod_xist_ns_doc)),
186    ("xist/ns/form/", (mod_xist_ns_form, mod_xist_ns_doc)),
187    ("xist/ns/php/", (mod_xist_ns_php, mod_xist_ns_doc)),
188    ("xist/ns/jsp/", (mod_xist_ns_jsp, mod_xist_ns_doc)),
189    ("xist/ns/meta/", (mod_xist_ns_meta, mod_xist_ns_doc)),
190    ("xist/ns/ruby/", (mod_xist_ns_ruby, mod_xist_ns_doc)),
191    ("xist/ns/specials/", (mod_xist_ns_specials, mod_xist_ns_doc)),
192    ("xist/ns/htmlspecials/", (mod_xist_ns_htmlspecials, mod_xist_ns_doc)),
193    ("xist/ns/struts_html/", (mod_xist_ns_strutshtml, mod_xist_ns_doc)),
194    ("xist/ns/struts_config/", (mod_xist_ns_strutsconfig, mod_xist_ns_doc)),
195    ("xist/ns/doc/", (mod_xist_ns_doc, )),
196    ("xist/ns/css/", (mod_xist_ns_css, mod_xist_ns_doc)),
197    ("xist/ns/cssspecials/", (mod_xist_ns_cssspecials, mod_xist_ns_doc)),
198    ("xist/sources/",  (mod_xist_sources, mod_xist_ns_doc)),
199    ("xist/parsers/",  (mod_xist_parsers, mod_xist_ns_doc)),
200    ("xist/converters/", (mod_xist_converters, mod_xist_ns_doc)),
201    ("xist/presenters/", (mod_xist_presenters, mod_xist_ns_doc)),
202    ("xist/publishers/",  (mod_xist_publishers, mod_xist_ns_doc)),
203    ("url/", (mod_url, mod_xist_ns_doc)),
204    ("make/", (mod_make, mod_xist_ns_doc)),
205    ("sisyphus/", (mod_sisyphus, mod_xist_ns_doc)),
206    ("ansistyle/", (mod_ansistyle, mod_xist_ns_doc)),
207    ("fileutils/", (mod_fileutils, mod_xist_ns_doc)),
208    ("sql/", (mod_sql, mod_xist_ns_doc)),
209)
210
211for (base, mods) in params:
212    f = p[here/builddir/(base + "index.html")]
213    f.dependOn(*mods)
214
215    f2 = make.PythonTarget(p, here/builddir/(base + "index_module.txt"), copyaction)
216    f2.dependOn(make.MainDep, mods[0])
217    build.dependOn(f2)
218    f3 = make.PythonTarget(p, here/installdir/(base + "index_module.txt"), copyaction)
219    f3.dependOn(make.MainDep, f2)
220    install.dependOn(f3)
221
222print "done"
223
224if __name__=="__main__":
225    p.buildWithArgs(sys.argv[1:])
Note: See TracBrowser for help on using the browser.