File: build.xml

package info (click to toggle)
morfologik-stemming 1.2.2-1.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 876 kB
  • sloc: java: 1,815; xml: 153; makefile: 23
file content (210 lines) | stat: -rw-r--r-- 5,837 bytes parent folder | download | duplicates (2)
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<project name="Stempelator" default="build">
	<property name="build.name" value="morfologik-stemming" />
	<property name="build.ver" value="1.2.2" />

	<property name="tmp.dir" value="tmp" />
	<property name="build.dir" value="${tmp.dir}/build" />
	<property name="build.test.dir" value="${tmp.dir}/test" />
	<property name="dist.dir" value="dist" />

	<property name="jarfile-nodict" value="${tmp.dir}/bin/${build.name}-nodict-${build.ver}.jar" />
	<property name="jarfile" value="${tmp.dir}/bin/${build.name}-${build.ver}.jar" />

	<property name="srczip" value="${dist.dir}/${build.name}-${build.ver}-src.zip" />
	<property name="binzip" value="${dist.dir}/${build.name}-${build.ver}.zip" />


	<path id="compile.classpath">
		<fileset dir="lib">
			<include name="**/*.jar" />
		</fileset>
	</path>

	<fileset dir="lib" id="runtime.dependencies">
		<include name="**/*.jar" />
		<exclude name="junit*.jar" />
	</fileset>


	<target name="init">
		<tstamp />
		<mkdir dir="${build.dir}" />
		<mkdir dir="${build.test.dir}" />
		<mkdir dir="${dist.dir}" />
	</target>



	<target name="clean">
		<delete dir="${build.dir}" failonerror="false" />
		<delete dir="${dist.dir}" failonerror="false" />
		<delete dir="${tmp.dir}" failonerror="false">
		        <exclude name="eclipse/**" />
		    </delete>
	</target>



	<target name="compile" depends="init">
		<javac classpath="${classpath}" destdir="${build.dir}" encoding="UTF-8" 
				source="1.5" target="1.5">
			<classpath refid="compile.classpath" />
			<include name="**/*.java" />
			<src location="src" />
		</javac>

		<!-- Copy additional resources to the build folder. -->
		<copy todir="${build.dir}">
			<fileset dir="src">
				<exclude name="**/*.java" />
			</fileset>
		</copy>
	</target>



	<target name="compile.test" depends="init,compile">
		<javac classpath="${classpath}" destdir="${build.test.dir}" encoding="UTF-8">
			<classpath refid="compile.classpath" />
			<classpath location="${build.dir}" />

			<src location="src-test" />
		</javac>

		<!-- Copy additional resources to the build folder. -->
		<copy todir="${build.test.dir}">
			<fileset dir="src-test">
				<exclude name="**/*.java" />
			</fileset>
		</copy>
	</target>



	<target name="test" depends="compile, compile.test">
		<mkdir dir="${tmp.dir}/tests" />
		<junit printsummary="yes" haltonfailure="yes">
			<classpath refid="compile.classpath" />
			<classpath location="${build.dir}" />
			<classpath location="${build.test.dir}" />

			<formatter type="plain" />

			<batchtest todir="${tmp.dir}/tests">
				<fileset dir="src-test">
					<include name="**/*Test.java" />
				</fileset>
			</batchtest>
		</junit>
	</target>



	<target name="javadoc" depends="init">
		<javadoc sourcepath="src" packagenames="morfologik.*" destdir="${tmp.dir}/javadoc">
			<classpath refid="compile.classpath" />
		</javadoc>
	</target>



	<target name="jar" depends="clean, compile">
		<mkdir dir="${tmp.dir}/bin" />

		<property name="main.class" value="morfologik.tools.Launcher" />
		
		<pathconvert property="manifest.classpath" pathsep=" ">
			<flattenmapper />
			<path>
				<fileset refid="runtime.dependencies" />
			</path>
		</pathconvert>

		<jar jarfile="${jarfile}">
			<fileset dir="${build.dir}" />
			<zipfileset file="LICENSE" fullpath="META-INF/Morfologik.LICENSE" />
			<manifest>
				<attribute name="Main-Class" value="${main.class}" />
				<attribute name="Class-Path" value="${manifest.classpath}" />
			</manifest>
		</jar>

		<jar jarfile="${jarfile-nodict}">
			<fileset dir="${build.dir}">
				<exclude name="morfologik/dictionaries/**" />
			</fileset>
			<zipfileset file="LICENSE" fullpath="META-INF/Morfologik.LICENSE" />
			<manifest>
				<attribute name="Main-Class" value="${main.class}" />
				<attribute name="Class-Path" value="${manifest.classpath}" />
			</manifest>
		</jar>
	</target>



	<target name="build" depends="jar">
		<copy todir="${tmp.dir}/bin">
			<fileset refid="runtime.dependencies" />
			<fileset dir=".">
				<include name="LICENSE*.txt" />
				<include name="README.txt" />
				<include name="version.txt" />
			</fileset>
		</copy>
	</target>



	<target name="dist" depends="clean, test, build, javadoc, licenses">
		<!-- Package source distribution -->
		<fileset dir="." id="srcdistfiles">
			<exclude name="tmp/**" />
			<exclude name="dist/**" />
			<exclude name=".settings/**" />
			<exclude name="${srczip}" />
		</fileset>

		<zip destfile="${srczip}">
			<fileset refid="srcdistfiles" />
			<zipfileset prefix="doc/api" dir="${tmp.dir}/javadoc" />
		</zip>

		<zip destfile="${binzip}">
			<fileset dir="${tmp.dir}/bin" />
			<zipfileset prefix="api" dir="${tmp.dir}/javadoc" />

            <!-- Include licenses. -->
            <zipfileset dir="${tmp.dir}/licenses" />
		</zip>
	</target>
    
    
    
    <target name="licenses"> 
        <delete dir="${tmp.dir}/licenses" />
        <mkdir dir="${tmp.dir}/licenses" />

        <echo file="${tmp.dir}/licenses/delim">

---

</echo>

        <concat append="false" destfile="${tmp.dir}/licenses/morfologik-stemming-nodict.LICENSE">
            <path>
                <pathelement location="LICENSE" />
            </path>
        </concat>

        <concat append="false" destfile="${tmp.dir}/licenses/morfologik-stemming.LICENSE">
            <path>
                <pathelement location="LICENSE" />
                <pathelement location="${tmp.dir}/licenses/delim" />
                <pathelement location="src/morfologik/dictionaries/pl.LICENSE" />
            </path>
        </concat>

        <delete file="${tmp.dir}/licenses/delim" />
    </target>
</project>