-
Notifications
You must be signed in to change notification settings - Fork 76
/
build.xml
147 lines (125 loc) · 4.96 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
<?xml version="1.0" encoding="utf-8"?>
<project name="cb-semantic-search-parser" default="" basedir="./">
<property name="deploy.dir" value="deploy" />
<property name="version.solr" value="releases/lucene-solr/5.1.0" />
<property name="git.solr" value="https://github.com/apache/lucene-solr" />
<property name="local.dir.solr" value="lucene-solr" />
<property name="local.dir.patches" value="patches" />
<!-- Will likely need to fork SolrTextTagger in future and modify below -->
<property name="local.dir.knowledge-graph" value="knowledge-graph" />
<!-- Make Maven Usable -->
<property name="maven.executable" value="mvn" />
<!-- Make Git Usable -->
<macrodef name = "git">
<attribute name = "command" />
<attribute name = "dir" default = "" />
<element name = "args" optional = "true" />
<sequential>
<echo message = "git @{command}" />
<exec executable = "git" dir = "@{dir}">
<arg value = "@{command}" />
<args/>
</exec>
</sequential>
</macrodef>
<target name="clean" description="Delete old deploy files.">
<echo message="Deleting old deploy files..."/>
<!-- cb semantic search parser -->
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="${deploy.dir}">
<include name="**" />
</fileset>
</delete>
<!-- Clean Solr -->
<ant antfile="build.xml" dir="${basedir}/${local.dir.solr}/solr" target="clean" />
</target>
<target name="pull">
<!-- Pull Solr -->
<git command = "clone">
<args>
<arg value = "${git.solr}" />
<arg value = "${local.dir.solr}" />
</args>
</git>
<git command = "checkout" dir = "${local.dir.solr}">
<args>
<arg value = "${version.solr}" />
</args>
</git>
</target>
<target name="patch" depends="pull">
<!-- Apply Solr Patch -->
<git command = "apply">
<args>
<arg value = "${local.dir.patches}/lucene_solr_5_1_0.patch"/>
<arg value = "--directory=${local.dir.solr}"/>
</args>
</git>
</target>
<target name="build" depends="patch" description="Builds all dependencies">
<ant antfile="build.xml" dir="${basedir}/${local.dir.solr}/solr" target="example" />
<exec executable="${maven.executable}" dir="${basedir}/${local.dir.knowledge-graph}">
<arg value="package" />
</exec>
</target>
<target name="package-nobuild" description="Bundles up pre-built artifacts into a distribution">
<echo message="Creating required directories..."/>
<mkdir dir="${deploy.dir}"/>
<echo message="Packaging up Solr..."/>
<copy todir="${deploy.dir}/solr">
<fileset dir="${basedir}/lucene-solr/solr/">
<include name="server/**"/>
</fileset>
</copy>
<copy todir="${deploy.dir}/solr">
<fileset dir="${basedir}/lucene-solr/solr/">
<include name="bin/solr"/>
</fileset>
</copy>
<copy todir="${deploy.dir}/solr/server">
<fileset dir="${basedir}/configs/" includes="solr/**" />
</copy>
<echo message="Integrating knowledge-graph..."/>
<copy todir="${deploy.dir}/solr/server/lib">
<fileset dir="${basedir}/knowledge-graph/target">
<include name="*.jar"/>
</fileset>
</copy>
<echo message="Integrating Startup Script"/>
<copy todir="${deploy.dir}">
<fileset dir="${basedir}/configs">
<include name="*.sh"/>
</fileset>
</copy>
</target>
<target name="package" depends="build" description="Bundles up pre-built artifacts into a distribution">
<echo message="Creating required directories..."/>
<mkdir dir="${deploy.dir}"/>
<echo message="Packaging up Solr..."/>
<copy todir="${deploy.dir}/solr">
<fileset dir="${basedir}/lucene-solr/solr/">
<include name="server/**"/>
</fileset>
</copy>
<copy todir="${deploy.dir}/solr">
<fileset dir="${basedir}/lucene-solr/solr/">
<include name="bin/solr"/>
</fileset>
</copy>
<copy todir="${deploy.dir}/solr/server">
<fileset dir="${basedir}/configs/" includes="solr/**" />
</copy>
<echo message="Integrating knowledge-graph..."/>
<copy todir="${deploy.dir}/solr/server/lib">
<fileset dir="${basedir}/knowledge-graph/target">
<include name="*.jar"/>
</fileset>
</copy>
<echo message="Integrating Startup Script"/>
<copy todir="${deploy.dir}">
<fileset dir="${basedir}/configs">
<include name="*.sh"/>
</fileset>
</copy>
</target>
</project>