forked from IKS/rdfQuery
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
129 lines (111 loc) · 5.67 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?xml version="1.0"?>
<project name="rdfquery" basedir="." default="all">
<loadfile property="VERSION" srcfile="version.txt" description="Version to build" >
<filterchain>
<striplinebreaks/>
</filterchain>
</loadfile>
<property name="DOCS_DIR" value="./docs" description="API documentation"/>
<property name="DIST_DIR" value="./dist"/>
<property name="LIB_DIR" value="./lib"/>
<property name="JSDOC_TOOLKIT_DIR" value="${LIB_DIR}/jsdoc-toolkit/"/>
<property name="YUI" value="${LIB_DIR}/yui-compressor/yuicompressor-2.4.2.jar" />
<!-- Names for output -->
<property name="JS" value="${DIST_DIR}/js/" />
<property name="JS_MIN" value="${DIST_DIR}/minimised/" />
<target name="all" depends="init, doc, dist"/>
<target name="doc" description="generates documentation for core rdfQuery">
<!-- jsdoc-toolkit ant taks is currently broken, so we directly run -->
<echo message="Generating Documentation:"/>
<java jar="${JSDOC_TOOLKIT_DIR}/jsrun.jar" fork="true" failonerror="true">
<arg value="${JSDOC_TOOLKIT_DIR}/app/run.js"/>
<arg value="-t=${JSDOC_TOOLKIT_DIR}/templates/jsdoc"/>
<arg value="-d=${DOCS_DIR}"/>
<arg value="jquery.uri.js"/>
<arg value="jquery.xmlns.js"/>
<arg value="jquery.datatype.js"/>
<arg value="jquery.curie.js"/>
<arg value="jquery.rdf.js"/>
<arg value="jquery.rdfa.js"/>
<arg value="jquery.microdata.js"/>
<arg value="jquery.rules.js"/>
</java>
</target>
<target name="dist">
<antcall target="combine" />
<antcall target="minimise" />
<zip destfile="${DIST_DIR}/jquery.rdfquery-${VERSION}.zip">
<zipfileset dir="${JS}" includes="*.js" prefix="${JS}"/>
<zipfileset dir="${JS_MIN}" includes="*.js" prefix="${JS_MIN}"/>
<zipfileset dir="${DOCS_DIR}" includes="**/**" prefix="${DOCS_DIR}"/>
</zip>
</target>
<target name="combine" description="combines js files into three different files representing the three different packages for distribution">
<echo message="Building rdfQuery Core Distribution" />
<concat destfile="${JS}/jquery.rdfquery.core-${VERSION}.js">
<fileset dir="." includes="jquery.uri.js" />
<fileset dir="." includes="jquery.xmlns.js" />
<fileset dir="." includes="jquery.datatype.js" />
<fileset dir="." includes="jquery.curie.js" />
<fileset dir="." includes="jquery.rdf.js" />
<fileset dir="." includes="jquery.rdf.json.js" />
<fileset dir="." includes="jquery.rdf.turtle.js" />
<fileset dir="." includes="jquery.rdf.xml.js" />
</concat>
<echo message="Building rdfQuery RDFa Distribution" />
<concat destfile="${JS}/jquery.rdfquery.rdfa-${VERSION}.js">
<fileset dir="${JS}/" includes="jquery.rdfquery.core-${VERSION}.js" />
<fileset dir="." includes="jquery.rdfa.js" />
</concat>
<echo message="Building rdfQuery Microdata Distribution" />
<concat destfile="${JS}/jquery.rdfquery.microdata-${VERSION}.js">
<fileset dir="${JS}/" includes="jquery.rdfquery.rdfa-${VERSION}.js" />
<fileset dir="." includes="jquery.microdata.js" />
</concat>
<echo message="Building rdfQuery Rules Distribution" />
<concat destfile="${JS}/jquery.rdfquery.rules-${VERSION}.js">
<fileset dir="${JS}/" includes="jquery.rdfquery.microdata-${VERSION}.js" />
<fileset dir="." includes="jquery.rules.js" />
</concat>
</target>
<target name="minimise">
<echo message="Minimising rdfQuery Core Distribution" />
<echo message="Minimising rdfQuery RDFa Distribution" />
<echo message="Minimising rdfQuery Microdata Distribution" />
<echo message="Minimising rdfQuery Rules Distribution" />
<antcall target="minimiseJSFile">
<param name="inputFile" value="${JS}/jquery.rdfquery.core-${VERSION}.js" />
<param name="outputFile" value="${JS_MIN}/jquery.rdfquery.core.min-${VERSION}.js" />
</antcall>
<antcall target="minimiseJSFile">
<param name="inputFile" value="${JS}/jquery.rdfquery.rdfa-${VERSION}.js" />
<param name="outputFile" value="${JS_MIN}/jquery.rdfquery.rdfa.min-${VERSION}.js" />
</antcall>
<antcall target="minimiseJSFile">
<param name="inputFile" value="${JS}/jquery.rdfquery.microdata-${VERSION}.js" />
<param name="outputFile" value="${JS_MIN}/jquery.rdfquery.microdata.min-${VERSION}.js" />
</antcall>
<antcall target="minimiseJSFile">
<param name="inputFile" value="${JS}/jquery.rdfquery.rules-${VERSION}.js" />
<param name="outputFile" value="${JS_MIN}/jquery.rdfquery.rules.min-${VERSION}.js" />
</antcall>
</target>
<target name="minimiseJSFile">
<java jar="${YUI}" fork="true" failonerror="true">
<arg line="--type js" />
<arg line="-o ${outputFile}" />
<arg value="${inputFile}" />
</java>
</target>
<target name="clean" description="">
<echo message="Deleting distribution and API documentation"/>
<delete dir="${DIST_DIR}"/>
<delete dir="${DOCS_DIR}"/>
</target>
<target name="init" depends="clean">
<mkdir dir="${DIST_DIR}" />
<mkdir dir="${DIST_DIR}/js" />
<mkdir dir="${DIST_DIR}/minimised" />
<mkdir dir="${DOCS_DIR}" />
</target>
</project>