forked from Canteen/CanteenHTML5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
77 lines (72 loc) · 2.64 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?xml version="1.0"?>
<project name="CanteenHTML5" default="docs" basedir="./">
<property file="${os.name}.build.properties"/>
<property file="build.properties"/>
<target name="docs" description="Use YUIDoc to build the documentation for this library.">
<copy file="${docs.config}" tofile="temp.json" overwrite="true" />
<replaceregexp file="temp.json" match="\$\{docs\.description\}" replace="${docs.description}" flags="g" />
<replaceregexp file="temp.json" match="\$\{docs\.name\}" replace="${docs.name}" flags="g" />
<replaceregexp file="temp.json" match="\$\{version\}" replace="${version}" flags="g" />
<replaceregexp file="temp.json" match="\$\{docs\.outdir\}" replace="${docs.outdir}" flags="g" />
<replaceregexp file="temp.json" match="\$\{docs\.logo\}" replace="${docs.logo}" flags="g" />
<replaceregexp file="temp.json" match="\$\{docs\.helpers\}" replace="${docs.helpers}" flags="g" />
<replaceregexp file="temp.json" match="\$\{docs\.themedir\}" replace="${docs.themedir}" flags="g" />
<exec executable="${docs}">
<arg line="${source.dir}" />
<arg line="--extension .php" />
<arg line="--no-code" />
<arg line="--quiet" />
<arg line="--config temp.json" />
</exec>
<delete file="temp.json" />
</target>
<target name="docsToGit" description="Auto-sync the docs to the Git docs branch">
<antcall target="docs" />
<delete dir="../${docs.outdir}" />
<copy todir="../${docs.outdir}">
<fileset dir="${docs.outdir}"/>
</copy>
<!-- Switch the branch -->
<exec executable="${git}" failonerror="true">
<arg line="checkout" />
<arg line="${git.docs}" />
</exec>
<delete includeEmptyDirs="true">
<fileset dir="." />
</delete>
<copy todir="./" overwrite="true">
<fileset dir="../${docs.outdir}" includes="**/*">
<depth max="3" />
</fileset>
</copy>
<delete dir="../${docs.outdir}" />
<!-- Add the files -->
<exec executable="${git}" failonerror="true">
<arg line="add" />
<arg line="-A" />
<arg line="." />
</exec>
<!-- Commit the files -->
<exec executable="${git}" failonerror="true">
<arg line="commit" />
<arg line="-m" />
<arg line='"Auto updated docs"' />
</exec>
<!-- Sync the files -->
<exec executable="${git}" failonerror="true">
<arg line="push" />
<arg line="origin" />
<arg line="${git.docs}" />
</exec>
<!-- Switch the branch back -->
<exec executable="${git}" failonerror="true">
<arg line="checkout" />
<arg line="${git.master}" />
</exec>
</target>
<target name="clean" description="Remove all the YUIDocs">
<delete includeemptydirs="true">
<fileset dir="${docs.outdir}" includes="**/*" />
</delete>
</target>
</project>