-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.xml
84 lines (71 loc) · 3.5 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
<?xml version="1.0"?>
<project name="PolicyFeed" default="help">
<description>
PolicyFeed Government news aggregator.
</description>
<property name="data" location="data" />
<property name="lib" location="lib" />
<property name="config" location="config" />
<property name="modules" location="modules" />
<property name="test" location="test" />
<property name="uploads" location="static/uploads" />
<property name="search.log" location="${data}/log/solr" />
<property name="pf.src" location="src/policyfeed" />
<property name="search.src" location="src/search" />
<property name="search.ant" location="${search.src}/build.xml" />
<property name="url.db" value="urls.sqlite3" />
<property name="user.db" value="users.sqlite3" />
<property name="query.db" value="queries.sqlite3" />
<property name="tag.db" value="tags.sqlite3" />
<property name="alert.db" value="alerts.sqlite3" />
<property name="failures.db" value="failures.sqlite3" />
<property name="run.jar" location="${lib}/run.jar" />
<property name="run.ringo.home" value="-D ringo.home='${lib}/ringo.jar'" />
<property name="run.req.paths" value="-e require.paths.push('${config}', '${modules}')" />
<target name="init" description="Create needed dirs and files.">
<mkdir dir="${data}"/>
<mkdir dir="${search.log}" />
<chmod dir="${data}" type="both" perm="a+rw"/>
<mkdir dir="${uploads}"/>
<chmod dir="${uploads}" type="both" perm="a+rw"/>
<copy file="${pf.src}/${url.db}" tofile="${data}/${url.db}" />
<copy file="${pf.src}/${user.db}" tofile="${data}/${user.db}" />
<copy file="${pf.src}/${query.db}" tofile="${data}/${query.db}" />
<copy file="${pf.src}/${tag.db}" tofile="${data}/${tag.db}" />
<copy file="${pf.src}/${alert.db}" tofile="${data}/${alert.db}" />
<copy file="${pf.src}/${failures.db}" tofile="${data}/${failures.db}" />
<symlink link="${config}/log4j.properties" resource="${config}/config/log4j.properties" />
</target>
<target name="install-search" description="Build and install libs related to Solr search.">
<ant antfile="${search.ant}" dir="${search.src}" target="dist" />
</target>
<target name="install" depends="init, install-search" description="Build and prepare the application parts.">
</target>
<target name="help" description="Display main targets list.">
<exec executable="ant">
<arg value="-p" />
</exec>
</target>
<target name="test" description="Test JavaScript modules (this should be done after full install).">
<java jar="${run.jar}" fork="true">
<sysproperty key="ringo.classpath" value="./**" />
<arg value="${run.ringo.home}" />
<arg value="${run.req.paths}" />
<arg value="${test}/all.js" />
</java>
</target>
<target name="wipe" description="Return to the pre-installed state. WARNING: files created after install will be lost.">
<input message="All new data is going to be deleted. Continue? (y/n)" addproperty="do.delete" />
<condition property="do.abort">
<equals arg1="n" arg2="${do.delete}" />
</condition>
<fail if="do.abort">Aborted by user.</fail>
<delete dir="${data}"/>
<delete dir="${uploads}" />
<symlink action="delete" link="${config}/log4j.properties" />
</target>
<!--
include / import
http://ant.apache.org/manual/
-->
</project>