~vcs-imports/jeuclid/trunk

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
<project default="jar" basedir="." name="jeuclid-core">
  <property name="build.directory" value="target"/>
  <property name="build.output" value="${build.directory}/classes"/>
  <property environment="env"/>


  <path id="libs-build-classpath">
    <fileset dir="${basedir}/lib">
      <include name="*.jar"/>
    </fileset>
  </path>


  <target name="init" description="Init dependencies">
    <echo message="------------------- ${ant.project.name} ----------------"/>
    <echo message="${ant.version}"/>
    <echo message="VM: ${java.vm.version}, ${java.vm.vendor}"/>
    <echo message="JAVA_HOME: ${env.JAVA_HOME}"/>

    <available property="ant.present" classname="org.apache.tools.ant.BuildException" classpathref="libs-build-classpath"/>
    <condition property="ant.message" value="ANT Support PRESENT">
      <equals arg1="${ant.present}" arg2="true"/>
    </condition>
    <condition property="ant.message" value="ANT Support NOT Present">
      <not>
        <equals arg1="${ant.present}" arg2="true"/>
      </not>
    </condition>
    <echo message="${ant.message}"/>

    <available property="batik.present" classname="org.apache.batik.dom.AbstractNode" classpathref="libs-build-classpath"/>
    <condition property="batik.message" value="Batik Support PRESENT">
      <equals arg1="${batik.present}" arg2="true"/>
    </condition>
    <condition property="batik.message" value="Batik Support NOT Present">
      <not>
        <equals arg1="${batik.present}" arg2="true"/>
      </not>
    </condition>
    <echo message="${batik.message}"/>

    <available property="jcip.present" classname="net.jcip.annotations.ThreadSafe" classpathref="libs-build-classpath"/>
    <condition property="jcip.message" value="jcip-annotations Support PRESENT">
      <equals arg1="${jcip.present}" arg2="true"/>
    </condition>
    <condition property="jcip.message" value="jcip-annotations Support NOT Present">
      <not>
        <equals arg1="${jcip.present}" arg2="true"/>
      </not>
    </condition>
    <echo message="${jcip.message}"/>

    <available property="logging.present" classname="org.apache.commons.logging.LogFactory" classpathref="libs-build-classpath"/>
    <condition property="logging.message" value="commons-logging Support PRESENT">
      <equals arg1="${logging.present}" arg2="true"/>
    </condition>
    <condition property="logging.message" value="commons-logging Support NOT Present">
      <not>
        <equals arg1="${logging.present}" arg2="true"/>
      </not>
    </condition>
    <echo message="${logging.message}"/>

    <available property="freeheputil.present" classname="org.freehep.util.export.ExportFileType" classpathref="libs-build-classpath"/>
    <condition property="freeheputil.message" value="FreeHep Util Support PRESENT">
      <equals arg1="${freeheputil.present}" arg2="true"/>
    </condition>
    <condition property="freeheputil.message" value="FreeHep Util Support NOT Present">
      <not>
        <equals arg1="${freeheputil.present}" arg2="true"/>
      </not>
    </condition>
    <echo message="${freeheputil.message}"/>

    <available property="freehepgraph.present" classname="org.freehep.graphics2d.VectorGraphics" classpathref="libs-build-classpath"/>
    <condition property="freehepgraph.message" value="FreeHep Graphics2D Support PRESENT">
      <equals arg1="${freehepgraph.present}" arg2="true"/>
    </condition>
    <condition property="freehepgraph.message" value="FreeHep Graphics2D Support NOT Present">
      <not>
        <equals arg1="${freehepgraph.present}" arg2="true"/>
      </not>
    </condition>
    <echo message="${freehepgraph.message}"/>

    <available property="xmlext.present" classname="org.xml.sax.InputSource" classpathref="libs-build-classpath"/>
    <condition property="xmlext.message" value="xml-commons-external Support PRESENT">
      <equals arg1="${xmlext.present}" arg2="true"/>
    </condition>
    <condition property="xmlext.message" value="xml-commons-external Support NOT Present">
      <not>
        <equals arg1="${xmlext.present}" arg2="true"/>
      </not>
    </condition>
    <echo message="${xmlext.message}"/>

    <available property="xmlgraphics.present" classname="org.apache.xmlgraphics.util.ClasspathResource" classpathref="libs-build-classpath"/>
    <condition property="xmlgraphics.message" value="xmlgraphics-commons Support PRESENT">
      <equals arg1="${xmlgraphics.present}" arg2="true"/>
    </condition>
    <condition property="xmlgraphics.message" value="xmlgraphics-commons Support NOT Present">
      <not>
        <equals arg1="${xmlgraphics.present}" arg2="true"/>
      </not>
    </condition>
    <echo message="${xmlgraphics.message}"/>
  </target>


  <target name="compile" depends="init" description="Compile the code">
    <mkdir dir="${build.output}"/>
    <javac destdir="${build.output}" debug="true" deprecation="true" optimize="false">
      <src>
        <pathelement location="src/main/java"/>
      </src>
      <classpath refid="libs-build-classpath"/>
    </javac>
    <copy todir="${build.output}">
      <fileset dir="src/main/resources"/>
    </copy>
  </target>


  <target name="jar" depends="compile" description="Create the JAR">
    <jar jarfile="${build.directory}/${ant.project.name}.jar" basedir="${build.output}"/>
  </target>
</project>