forked from mapstruct/mapstruct-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
113 lines (98 loc) · 4.42 KB
/
Copy pathbuild.xml
File metadata and controls
113 lines (98 loc) · 4.42 KB
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
<?xml version="1.0"?>
<!--
Copyright 2012-2017 Gunnar Morling (http://www.gunnarmorling.de/)
and/or other contributors as indicated by the @authors tag. See the
copyright.txt file in the distribution for a full listing of all
contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="mapstruct-on-ant" default="build" basedir=".">
<property name="mapstruct.version" value="1.3.0.Final" />
<property name="src.main.dir" location="src/main/java" />
<property name="src.test.dir" location="src/test/java" />
<property name="build.dir" location="target" />
<property name="classes.dir" location="${build.dir}/classes" />
<property name="generatedsources.dir" location="${build.dir}/generated-sources" />
<property name="test.classes.dir" location="${build.dir}/test-classes" />
<property name="test.report.dir" location="${build.dir}/junit-reports" />
<property name="lib.dir" location="${user.home}/.m2/repository" />
<path id="main.classpath">
<fileset dir="${lib.dir}">
<include name="org/mapstruct/mapstruct/${mapstruct.version}/mapstruct-${mapstruct.version}.jar" />
</fileset>
</path>
<path id="processor.path">
<fileset dir="${lib.dir}">
<include name="org/mapstruct/mapstruct-processor/${mapstruct.version}/mapstruct-processor-${mapstruct.version}.jar" />
</fileset>
</path>
<pathconvert property="processorpath" refid="processor.path"/>
<path id="test.classpath">
<fileset dir="${lib.dir}">
<include name="junit/junit/4.12/junit-4.12.jar" />
<include name="org/easytesting/fest-assert/1.4/fest-assert-1.4.jar" />
<include name="org/easytesting/fest-util/1.1.6/fest-util-1.1.6.jar" />
<include name="org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar" />
<include name="org/mapstruct/mapstruct/${mapstruct.version}/mapstruct-${mapstruct.version}.jar" />
</fileset>
<pathelement location="${classes.dir}" />
<pathelement location="${test.classes.dir}" />
</path>
<target name="clean">
<delete dir="${build.dir}" />
</target>
<target name="create-directories">
<mkdir dir="${build.dir}" />
<mkdir dir="${classes.dir}" />
<mkdir dir="${generatedsources.dir}" />
<mkdir dir="${test.classes.dir}" />
<mkdir dir="${test.report.dir}" />
</target>
<target name="compile" depends="clean, create-directories">
<javac
srcdir="${src.main.dir}"
destdir="${classes.dir}"
classpathref="main.classpath"
includeantruntime="false">
<compilerarg line="-processorpath ${processorpath}"/>
<!-- Specify the processor name explicitly if there are several ones around and you only want to execute MapStruct -->
<!--
<compilerarg line="-processor org.mapstruct.ap.MappingProcessor"/>
-->
<compilerarg line="-s ${generatedsources.dir}"/>
</javac>
</target>
<target name="compile-test" depends="compile">
<javac
srcdir="${src.test.dir}"
destdir="${test.classes.dir}"
classpathref="test.classpath"
includeantruntime="false">
</javac>
</target>
<target name="test" depends="compile-test">
<junit printsummary="on" fork="true" haltonfailure="yes">
<classpath refid="test.classpath" />
<formatter type="xml" />
<batchtest todir="${test.report.dir}">
<fileset dir="${src.test.dir}">
<include name="**/*Test*.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="jar" depends="compile">
<jar destfile="${build.dir}/mapstruct-on-ant.jar" basedir="${classes.dir}">
</jar>
</target>
<target name="build" depends="test, jar">
</target>
</project>