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
|
<project name="ivy-java" basedir="." default="main">
<property name="version" value="1.2.17"/>
<property name="defaultbus" value="-DIVYBUS=224.5.6.7:8910" />
<property name="src.dir" value="src"/>
<property name="testsrc.dir" value="tests"/>
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="testclasses.dir" value="${build.dir}/testclasses"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<property name="main-class" value="fr.dgac.ivy.tools.Probe"/>
<property name="lib.dir" value="lib"/>
<property name="tgz.dir" value="${build.dir}/${ant.project.name}-${version}" />
<!--
LOCAL SETTINGS
should be overriden to reflect your installation. This is a MacOSX /
Macports setup
-->
<property name="docbook-xsl" value="/opt/local/share/xsl/docbook-xsl" />
<property name="jars.home" value="/opt/local/share/java/"/>
<property name="fop.home" value="${jars.home}/fop/1.0/"/>
<property name="xslt.jar" value="${jars.home}/xalan.jar"/>
<property name="jsch.jar" value="${jars.home}/jsch.jar"/>
<property name="servlet.jar" value="servlet25-api.jar "/>
<path id="classpath">
<fileset dir="${jar.dir}" includes="**/*.jar"/>
<fileset dir="${jars.home}" includes="**/${servlet.jar}"/>
</path>
<path id="myjar">
<fileset dir="${jar.dir}" includes="**/*.jar"/>
</path>
<target name="init">
<mkdir dir="${build.dir}"/>
<mkdir dir="${classes.dir}"/>
<mkdir dir="${testclasses.dir}"/>
<mkdir dir="${jar.dir}"/>
<mkdir dir="${build.dir}/doc/api"/>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="compile" depends="init">
<javac includeantruntime="true" srcdir="${src.dir}" destdir="${classes.dir}"
deprecation="on"
classpathref="classpath"/>
</target>
<target name="tests" depends="jar">
<javac includeantruntime="true" srcdir="${testsrc.dir}" destdir="${testclasses.dir}" classpathref="myjar"/>
</target>
<target name="style">
<java fork="true" classname="com.puppycrawl.tools.checkstyle.Main">
<arg value="-c"/>
<arg value="sun_checks.xml"/>
<arg value="src/Ivy.java"/>
<classpath>
<path refid="classpath"/> <!-- si ça n'est pas déjà dans le classpath -->
<path location="../checkstyle-5.5/checkstyle-5.5.jar"/>
</classpath>
</java>
</target>
<target name="jar" depends="compile">
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
<archives>
<zips><fileset dir="lib" includes="**/java-getopt-1.0.13.jar"/></zips>
</archives>
<fileset dir="." includes="README,COPYING.LIB,BUGS,Changelog"/>
<fileset dir="src" includes="**/*.java"/>
</jar>
</target>
<target name="dist" depends="compile,doc" >
<jar destfile="${jar.dir}/${ant.project.name}-${version}.jar" basedir="${classes.dir}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
<archives>
<zips><fileset dir="lib" includes="**/java-getopt-1.0.13.jar"/></zips>
</archives>
<fileset dir="." includes="build.xml,Makefile,java.mk,manifest,README,COPYING.LIB,Changelog,BUGS" />
<fileset dir="src" includes="**/*.java" />
<fileset dir="tests" includes="tests/*.java" />
<fileset dir="examples" includes="tests/*.java, tests/*.xml, tests/*.txt" />
<fileset dir="doc" includes="doc/html/api/*" />
</jar>
</target>
<target name="doc" depends="init">
<!-- JAVADOC -->
<javadoc packagenames="fr.dgac.ivy.*" sourcepath="${src.dir}"
destdir="${build.dir}/doc/api/" defaultexcludes="yes" classpathref="classpath"
public="true" use="true" windowtitle="Ivy Java API">
<fileset dir="src" includes="**/*.java" />
</javadoc>
<!-- library guide HTML ONE BIG CHUNK -->
<xslt basedir="doc" destdir="${build.dir}/doc/html" extension=".html"
in="doc/ivy-java.sgml"
out="${build.dir}/doc/html/ivy-java.html"
style="${docbook-xsl}/xhtml/chunk.xsl">
<classpath location="${xslt.jar}" />
</xslt>
<!-- library guide HTML MULTIPLE FILES -->
<xslt basedir="doc" destdir="${build.dir}/doc/html" extension=".html"
in="doc/ivy-java.sgml"
out="${build.dir}/doc/html/"
style="${docbook-xsl}/xhtml/docbook.xsl">
<classpath location="${xslt.jar}" />
</xslt>
<!-- library guide PDF -->
<xslt basedir="doc" destdir="${build.dir}/doc/" extension=".fo" classpathref="classpath"
includes="ivy-java.sgml"
style="${docbook-xsl}/fo/docbook.xsl">
<classpath location="${xslt.jar}" />
</xslt>
<fop format="application/pdf" fofile="${build.dir}/doc/ivy-java.fo" outfile="${build.dir}/doc/ivy-java.pdf" />
</target>
<taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop">
<classpath>
<fileset dir="${fop.home}/lib"><include name="*.jar"/></fileset>
<fileset dir="${fop.home}/build"><include name="fop.jar"/>
<include name="fop-hyph.jar" /></fileset>
</classpath>
</taskdef>
<target name="tar">
<delete file="${tgz.dir}.tar.gz" />
<tar destfile="${tgz.dir}.tar.gz" compression="gzip">
<tarfileset dir="." includes="${src.dir}/*.java" />
<tarfileset dir="." includes="${testsrc.dir}/*.java" />
<tarfileset dir="." includes="${testsrc.dir}/Makefile" />
<tarfileset dir="." includes="examples/*.java" />
<tarfileset dir="." includes="examples/*.xml" />
<tarfileset dir="." includes="examples/*.txt" />
<tarfileset dir="." includes="examples/*.java" />
<tarfileset dir="." includes="doc/*.dgml" />
<tarfileset dir="." includes="doc/*.1" />
<tarfileset dir="." includes="doc/Makefile" />
<fileset dir="." includes="build.xml,Makefile,java.mk,manifest,README,COPYING.LIB,Changelog,BUGS" />
</tar>
</target>
<target name="run" depends="jar">
<java fork="true" classname="${main-class}">
<jvmarg value="${defaultbus}"/>
<arg value="(.*)"/>
<classpath>
<path refid="classpath"/>
<path location="${jar.dir}/${ant.project.name}.jar"/>
</classpath>
</java>
</target>
<target name="clean-build" depends="clean,jar"/>
<target name="main" depends="clean,run"/>
</project>
|