|
1 | 1 | <?xml version="1.0"?> |
2 | 2 | <project name="SampleJavaProject" default="jar" |
3 | | - xmlns:ivy="antlib:org.apache.ivy.ant"> |
| 3 | + xmlns:ivy="antlib:org.apache.ivy.ant"> |
4 | 4 |
|
5 | 5 | <!-- Project-specific configuration --> |
6 | | - <loadproperties srcfile="project.properties" /> |
| 6 | + <loadproperties srcfile="project.properties"/> |
7 | 7 | <property name="main.class" value="${package.main}.${ant.project.name}"/> |
8 | 8 | <property name="base.name" value="${artifactId}-${version}"/> |
9 | 9 |
|
|
32 | 32 | </target> |
33 | 33 |
|
34 | 34 | <target name="resolve" unless="lib.present" |
35 | | - description="Retrieve dependencies with ivy."> |
| 35 | + description="Retrieve dependencies with ivy."> |
36 | 36 | <ivy:retrieve type="jar,bundle"/> |
37 | 37 | </target> |
38 | 38 |
|
39 | 39 | <target name="compile" depends="init,resolve" |
40 | | - description="Compile all source files."> |
| 40 | + description="Compile all source files."> |
41 | 41 | <javac srcdir="${src.dir}" destdir="${build.classes.dir}" |
42 | | - optimize="on" debug="on" deprecation="on" |
43 | | - includeantruntime="false"> |
| 42 | + optimize="on" debug="on" deprecation="on" |
| 43 | + includeantruntime="false"> |
44 | 44 | <compilerarg value="-Xlint"/> |
45 | 45 | <classpath refid="build.classpath"/> |
46 | 46 | </javac> |
|
50 | 50 | </target> |
51 | 51 |
|
52 | 52 | <target name="jar" depends="compile" |
53 | | - description="Generate the jarfile distributable."> |
| 53 | + description="Generate the jarfile distributable."> |
54 | 54 | <jar destfile="${dist.dir}/${base.name}.jar" |
55 | | - basedir="${build.classes.dir}"> |
| 55 | + basedir="${build.classes.dir}"> |
56 | 56 | <manifest> |
57 | 57 | <attribute name="Main-Class" value="${main.class}"/> |
58 | 58 | </manifest> |
59 | 59 | </jar> |
60 | 60 | <jar destfile="${dist.dir}/${base.name}-all.jar" |
61 | | - basedir="${build.classes.dir}"> |
| 61 | + basedir="${build.classes.dir}"> |
62 | 62 | <zipgroupfileset dir="${lib.dir}" includes="*.jar"/> |
63 | 63 | <manifest> |
64 | 64 | <attribute name="Main-Class" value="${main.class}"/> |
|
75 | 75 | </target> |
76 | 76 |
|
77 | 77 | <target name="run-hotswap" depends="compile" |
78 | | - description="Run the application in hotswap mode."> |
| 78 | + description="Run the application in hotswap mode."> |
79 | 79 | <java classname="${main.class}" classpath="${build.classes.dir}" |
80 | | - fork="true"> |
| 80 | + fork="true"> |
81 | 81 | <classpath refid="build.classpath"/> |
82 | 82 | <jvmarg line="-Xdebug -Xrunjdwp:transport=dt_socket,address=9000,server=y,suspend=n"/> |
83 | 83 | <arg value="--loop"/> |
|
90 | 90 | <taskdef name="hotswap" classname="dak.ant.taskdefs.Hotswap"/> |
91 | 91 | <hotswap verbose="true" port="9000"> |
92 | 92 | <fileset dir="${build.classes.dir}" includes="**/*.class"> |
93 | | - <modified/> |
| 93 | + <modified/> |
94 | 94 | </fileset> |
95 | 95 | </hotswap> |
96 | 96 | </target> |
|
104 | 104 |
|
105 | 105 | <target name="javadoc" description="Generate Javadoc HTML."> |
106 | 106 | <javadoc destdir="${dist.dir}/javadoc" |
107 | | - link="http://download.oracle.com/javase/6/docs/api/" |
108 | | - sourcepath="${src.dir}"/> |
| 107 | + link="http://download.oracle.com/javase/6/docs/api/" |
| 108 | + sourcepath="${src.dir}"/> |
109 | 109 | </target> |
110 | 110 |
|
111 | 111 | <target name="format" description="Run the indenter on all source files."> |
|
136 | 136 | <!-- Unit testing (JUnit) --> |
137 | 137 |
|
138 | 138 | <target name="test-compile" depends="compile" |
139 | | - description="Compile all of the unit tests."> |
| 139 | + description="Compile all of the unit tests."> |
140 | 140 | <mkdir dir="${test.classes.dir}"/> |
141 | 141 | <javac srcdir="${test.dir}" destdir="${test.classes.dir}" |
142 | | - optimize="on" debug="on" deprecation="on" |
143 | | - classpath="${build.classes.dir}" includeantruntime="yes"> |
| 142 | + optimize="on" debug="on" deprecation="on" |
| 143 | + classpath="${build.classes.dir}" includeantruntime="yes"> |
144 | 144 | <compilerarg value="-Xlint"/> |
145 | 145 | <classpath refid="build.classpath"/> |
146 | 146 | </javac> |
|
150 | 150 | </target> |
151 | 151 |
|
152 | 152 | <target name="test" depends="test-compile" |
153 | | - description="Run all of the unit tests."> |
| 153 | + description="Run all of the unit tests."> |
154 | 154 | <junit> |
155 | 155 | <classpath> |
156 | | - <pathelement path="${build.classes.dir}"/> |
157 | | - <pathelement path="${test.classes.dir}"/> |
158 | | - <path refid="build.classpath"/> |
| 156 | + <pathelement path="${build.classes.dir}"/> |
| 157 | + <pathelement path="${test.classes.dir}"/> |
| 158 | + <path refid="build.classpath"/> |
159 | 159 | </classpath> |
160 | 160 | <batchtest> |
161 | | - <formatter type="brief" usefile="false"/> |
162 | | - <fileset dir="${test.classes.dir}"/> |
| 161 | + <formatter type="brief" usefile="false"/> |
| 162 | + <fileset dir="${test.classes.dir}"/> |
163 | 163 | </batchtest> |
164 | 164 | </junit> |
165 | 165 | </target> |
166 | 166 |
|
167 | 167 | <!-- Maven repository support --> |
168 | 168 |
|
169 | 169 | <target name="bundle" depends="jar,javadoc" |
170 | | - description="Stage a Maven repository bundle."> |
| 170 | + description="Stage a Maven repository bundle."> |
171 | 171 | <!-- Pack up the artifacts --> |
172 | 172 | <filter filtersfile="project.properties"/> |
173 | 173 | <filter token="ant.project.name" value="${ant.project.name}"/> |
174 | 174 | <copy file="pom.xml" filtering="true" |
175 | | - tofile="${dist.dir}/bundle/${base.name}.pom"/> |
| 175 | + tofile="${dist.dir}/bundle/${base.name}.pom"/> |
176 | 176 | <copy file="${dist.dir}/${base.name}.jar" todir="${dist.dir}/bundle/"/> |
177 | 177 | <jar jarfile="${dist.dir}/bundle/${base.name}-javadoc.jar"> |
178 | 178 | <fileset dir="${dist.dir}/javadoc"/> |
|
0 commit comments