-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
149 lines (131 loc) · 6.65 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?xml version="1.0" encoding="UTF-8"?>
<project name="data.younglives.org.uk" default="dev-build">
<property name="builddir" value="build" />
<property name="ontowiki_repos"
value="https://ontowiki.googlecode.com/hg/"/>
<property name="default_kb" value="http://data.younglives.org.uk"/>
<target name="clean">
<echo msg="Cleaning..." />
<delete includeemptydirs="true">
<fileset dir="${builddir}"
defaultexcludes="false"
casesensitive="false">
<include name="**/**" />
</fileset>
</delete>
<delete dir="${builddir}" includeemptydirs="true" />
</target>
<target name="get_sources">
<echo msg="creating source directory" />
<exec command="mkdir -p src/Tar" />
<echo msg="downloading ontowiki src if needed" />
<exec command="if [ ! -f src/Tar/ontowiki-0.9.6-pre2.zip ]; then curl http://ontowiki.googlecode.com/files/ontowiki-0.9.6-pre2.zip > ./src/Tar/ontowiki-0.9.6-pre2.zip; fi" />
</target>
<target name="dev-build">
<phingcall target="get_sources" />
<echo msg="unpacking ontowiki" />
<exec command="unzip ./src/Tar/ontowiki-0.9.6-pre2.zip -d ./; mv ontowiki-0.9.6/ build/" />
<input propertyname="owConfigFile"
validargs="younglives-mysql,virtuoso"
defaultValue="younglives-mysql"
>
Choose a config file to match your backend
</input>
<copy file="./conf/config.ini.${owConfigFile}"
tofile="./${builddir}/config.ini" overwrite="true" />
<phingcall target="jsonrpc_bug_fix_overwrite"/>
<phingcall target="overwrite-sysont"/>
<phingcall target="dev-csvimport"/>
</target>
<target name="setup">
<phingcall target="create-kb"/>
<phingcall target="load-general-triples"/>
<phingcall target="load-studystructure-triples"/>
<phingcall target="load-test_country_summary_stats"/>
<phingcall target="copy_theme" />
</target>
<target name="jsonrpc_bug_fix_overwrite">
<echo msg="changing default export format to rdf/json in jsonrpc. copying new modelJsonrpcAdapter.php over current one" />
<copy file="./ow_extensions/jsonrpc/modelJsonrpcAdapter.php"
tofile="./${builddir}/extensions/jsonrpc/modelJsonrpcAdapter.php"
overwrite="true" />
</target>
<target name="overwrite-sysont">
<echo msg="Installing Overriden SysOnt in order to establish Admin password" />
<copy file="./conf/SysOntLocal.rdf"
tofile="./${builddir}/libraries/Erfurt/Erfurt/include/SysOntLocal.rdf"
overwrite="true" />
</target>
<target name="dev-csvimport">
<echo msg="Performing setup for CSVImport extension"/>
<echo msg="Remove existing CSVImport installation"/>
<delete includeemptydirs="true">
<fileset dir="${builddir}/extensions/csvimport"
defaultexcludes="false"
casesensitive="false">
<include name="**/**" />
</fileset>
</delete>
<delete dir="${builddir}/extensions/csvimport"
includeemptydirs="true" />
<echo msg="Link in our own version" />
<exec command="ln -s ${application.startdir}/ow_extensions/csvimport ${builddir}/extensions"/>
<exec command="ln -s ${application.startdir}/ow_extensions/younglives ${builddir}/extensions"/>
<exec command="ln -s ${application.startdir}/ow_extensions/yl_navigation ${builddir}/extensions"/>
<exec command="rm -f ${builddir}/extensions/navigation/navigation.css;ln -s ${application.startdir}/ow_extensions/yl_navigation/navigation.css ${builddir}/extensions/navigation/"/>
<exec command="cp -f ${application.startdir}/ow_extensions/front_page_override/IndexController.php ${builddir}/application/controllers/"/>
<exec command="cp -f ${application.startdir}/ow_extensions/front_page_override/news.phtml ${builddir}/application/views/templates/index/"/>
<exec command="cp -f ${application.startdir}/htaccess ${builddir}/.htaccess"/>
<exec command="cp -f ${application.startdir}/ow_extensions/default.css ${builddir}/extensions/themes/silverblue/styles/"/>
<mkdir dir="${builddir}/extensions/csvimport/logs"/>
<chmod file="${builddir}/extensions/csvimport/logs" mode="0777"/>
<mkdir dir="${builddir}/extensions/csvimport/configs"/>
<chmod file="${builddir}/extensions/csvimport/configs" mode="0777"/>
</target>
<target name="create-kb">
<echo msg="Creating default Knowlege Base ${default_kb}" />
<exec command="owcli -c conf/owcli -m ${default_kb} -e model:create"
logoutput="true"/>
</target>
<target name="load-rdf">
<echo msg="Loading${absname} into ${default_kb}"/>
<exec command="owcli -c conf/owcli -m ${default_kb} -e model:add -i ${absname}"
logoutput="true" />
</target>
<target name="load-general-triples">
<echo msg="Loading all Triples from RDF files in initial_data/general" />
<foreach param="name" absparam="absname" target="load-rdf" >
<fileset dir="initial_data/general">
<include name="*.rdf" />
</fileset>
</foreach>
</target>
<target name="load-statistics-triples">
<echo msg="Loading all Triples from RDF files in initial_data/statistics" />
<foreach param="name" absparam="absname" target="load-rdf" >
<fileset dir="initial_data/statistics">
<include name="*.rdf" />
</fileset>
</foreach>
</target>
<target name="load-studystructure-triples">
<echo msg="Loading all Triples from RDF files in initial_data/studystructure" />
<foreach param="name" absparam="absname" target="load-rdf" >
<fileset dir="initial_data/studystructure">
<include name="*.rdf" />
</fileset>
</foreach>
</target>
<target name="load-test_country_summary_stats">
<echo msg="Loading triples for example country summary stats" />
<foreach param="name" absparam="absname" target="load-rdf" >
<fileset dir="initial_data/">
<include name="export2011-08-24_1442.n3" />
</fileset>
</foreach>
</target>
<target name="copy_theme" >
<echo msg="copying theme files into place" />
<exec command="cp theme/layout.phtml ${builddir}/application/views/templates/layouts/; rm -rf ${builddir}/extensions/themes/silverblue; cp -r theme/silverblue ${builddir}/extensions/themes/" />
</target>
</project>