/
build.xml
150 lines (150 loc) · 4.82 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
149
150
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="demos-java" default="notask">
<property name="checkstyle.config.location" value="support/checkstyle_config.xml"/>
<!-- tasks -->
<target name="tasks">
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant">
<classpath>
<!--pathelement location="/usr/share/maven-repo/org/apache/ivy/ivy/2.5.0/ivy-2.5.0.jar"/-->
<pathelement location="/usr/share/java/ivy.jar"/>
<!--pathelement location="/home/mark/install/apache-ivy-2.5.0/ivy-2.5.0.jar" /-->
</classpath>
</taskdef>
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="/usr/share/java/ant-contrib.jar"/>
</classpath>
</taskdef>
<taskdef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="antlib:org.apache.maven.artifact.ant"
>
<classpath>
<pathelement location="out/lib/jar/maven-ant-tasks.jar"/>
</classpath>
</taskdef>
<taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties">
<!--classpath>
<pathelement location="/usr/share/java/checkstyle.jar"/>
</classpath-->
<classpath>
<pathelement location="out/lib/jar/checkstyle.jar"/>
<pathelement location="out/lib/jar/guava.jar"/>
<pathelement location="out/lib/jar/commons-beanutils.jar"/>
<pathelement location="out/lib/jar/commons-logging.jar"/>
<pathelement location="out/lib/jar/commons-collections.jar"/>
<pathelement location="out/lib/jar/antlr.jar"/>
<pathelement location="out/lib/jar/antlr4-runtime.jar"/>
</classpath>
</taskdef>
</target>
<!-- tools -->
<!-- see http://ant.apache.org/manual/Tasks/javac.html and search
for openjdk -->
<!--
<property name="patched.javac.jar" location="${my.patched.compiler}/dist/lib/javac.jar"/>
<presetdef name="patched.javac">
<javac fork="yes">
<compilerarg value="-J-Xbootclasspath/p:${patched.javac.jar}"/>
</javac>
</presetdef>
-->
<!-- paths -->
<path id="external-jars">
<fileset dir="out/lib/jar">
<include name="*.jar"/>
</fileset>
<fileset dir="static">
<include name="*.jar"/>
</fileset>
</path>
<path id="src">
<dirset
dir="src"
includes="*"
/>
</path>
<!-- targets -->
<target name="ivy_retrieve" description="retrieve dependencies with ivy">
<!-- <ivy:settings file="ivysettings.xml" /> -->
<ivy:resolve
refresh="true"
showprogress="true"
/>
<delete dir="out/lib" failonerror="no"/>
<!--
pattern="out/lib/[artifact]-[conf].[ext]"
pattern="out/lib/[type]/[artifact]-[conf]-[revision].[ext]"
pattern="out/lib/[type]/[artifact]-[conf].[ext]"
pattern="out/lib/[type]/[artifact]-[revision].[ext]"
-->
<ivy:retrieve
sync="true"
symlink="true"
pattern="out/lib/[type]/[artifact].[ext]"
/>
</target>
<target name="ivy_retrieve_local" description="retrieve dependencies with ivy from local">
<!-- <ivy:settings file="ivysettings.xml" /> -->
<ivy:resolve
useCacheOnly="false"
showprogress="true"
haltonfailure="false"
/>
<delete dir="out/lib" failonerror="no"/>
<ivy:retrieve
sync="true"
symlink="true"
pattern="out/lib/[type]/[artifact].[ext]"
/>
</target>
<target name="ivy_cleancache" depends="" description="purge ivy cache">
<!-- <ivy:settings file="ivysettings.xml" /> -->
<ivy:cleancache/>
</target>
<target name="checkstyle" description="check the style of the files">
<checkstyle config="${checkstyle.config.location}">
<fileset dir="src/main"/>
</checkstyle>
</target>
<target name="build_maven" description="build with maven">
<artifact:pom id="pom" file="pom.xml"/>
<artifact:mvn pomRefId="pom">
<arg value="compile"/>
</artifact:mvn>
</target>
<target name="build_gradle" description="build with gradle">
<exec executable="gradle" failonerror="true">
<arg value="build" />
</exec>
</target>
<target name="build_javac" description="build with javac">
<mkdir dir="out/classes"/>
<javac
srcdir="src/main"
destdir="out/classes"
includeAntRuntime="no"
deprecation="on"
fork="no"
>
<compilerarg value="-Xlint:-options"/>
<compilerarg value="-Xlint:all"/>
<!-- debug="on" verbose="on" optimize="on" failonerror="on" includeJavaRuntime="yes" -->
<!-- <compilerarg value="-Xlint:unchecked"/>
<compilerarg value="-Xlint:-options"/>
<compilerarg value="-Xlint:-processing"/>
-->
<!-- to suppress warnings about jars not being in the path
still need to investigate this -->
<!--compilerarg value="-Xlint:-path"/-->
<!-- compilerarg value="-Werror"/ -->
<!-- to suppress java6 annotation warnings -->
<!--compilerarg value="-proc:none"/-->
<!--classpath refid="external-jars"/-->
</javac>
</target>
<target name="clean" description="clean projects">
<delete dir="out"/>
</target>
<target name="notask" description="dont do anything">
<echo message="tell me what to do"/>
</target>
</project>