aboutsummaryrefslogtreecommitdiff
blob: 07fe6e0ad549b2547aceea0abd282d569dd8f5b6 (plain)
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
<?xml version="1.0"?>
<project name="Joda convert" default="all" basedir=".">
  <target name="init" description="Sets build properties">
    <!-- package configuration -->
    <property name="package.version" value="devel"/>
    <!-- directory locations -->
    <property name="src" value="${basedir}/src"/>
    <property name="src.lib" value="${src}/main/java"/>
    <property name="src.test" value="${src}/test/java"/>
    <property name="build" value="${basedir}/build"/>
    <property name="build.lib" value="${build}/lib"/>
    <property name="build.test" value="${build}/test"/>
    <property name="doc" value="${basedir}/doc"/>
    <property name="doc.api" value="${doc}/api"/>
    <!-- external dependencies -->
    <property name="junit.jar" value="junit.jar"/>
    <!-- classpaths -->
    <path id="project.class.path">
    </path>
    <path id="test.class.path">
      <!--pathelement location="${junit.jar}"/--> <!-- handled by Gentoo's ANT_TASKS -->
    </path>
    <path id="build.lib.class.path">
      <pathelement location="${build.lib}"/>
    </path>
    <path id="build.test.class.path">
      <pathelement location="${build.test}"/>
    </path>
  </target>
  <target name="all" depends="jar,javadoc"
          description="Pseudo-target that builds JAR and Javadoc"/>
  <target name="build-lib" depends="init"
          description="Compiles the library classes">
    <mkdir dir="${build.lib}"/>
    <javac destdir="${build.lib}" srcdir="${src.lib}" debug="true"
           deprecation="true" includeantruntime="false">
      <classpath refid="project.class.path"/>
      <classpath refid="build.lib.class.path"/>
      <!--compilerarg line="-Xlint:unchecked"/-->
    </javac>
    <!--copy todir="${build}">
      <mappedresources>
        <fileset dir="${src}" includes="**/test/test.fits*"/>
        <globmapper from="*" to="*"/>
      </mappedresources>
    </copy-->
  </target>
  <target name="build-tests" depends="build-lib"
          description="Compiles the test classes">
    <mkdir dir="${build.test}"/>
    <javac destdir="${build.test}" srcdir="${src.test}" debug="true"
           deprecation="true" includeantruntime="false">
      <classpath refid="project.class.path"/>
      <classpath refid="test.class.path"/>
      <classpath refid="build.lib.class.path"/>
    </javac>
  </target>
  <target name="build" depends="build-lib"
          description="Alias for build-lib"/>
  <target name="test" depends="build-tests">
    <junit>
      <classpath refid="project.class.path"/>
      <classpath refid="test.class.path"/>
      <classpath refid="build.lib.class.path"/>
      <classpath refid="build.test.class.path"/>
      <formatter type="brief" usefile="false" />
      <batchtest>
        <fileset dir="${build.test}">
          <include name="**/*.class" />
          <exclude name="**/*$*.class" />
        </fileset>
      </batchtest>
    </junit>
  </target>
  <target name="javadoc" depends="init"
          description="Generates Javadoc API documentation">
    <mkdir dir="${doc.api}"/>
    <javadoc packagenames="*"
             sourcepath="${src.lib}" destdir="${doc.api}"
             author="true"       version="true"
             use="true"          private="true"/>
  </target>
  <target name="jar" depends="build-lib"
          description="Builds a project JAR file">
    <jar basedir="${build.lib}" jarfile="${build}/joda-convert.jar">
      <manifest>
        <attribute name="Version" value="${package.version}"/>
      </manifest>
    </jar>
  </target>
  <target name="clean" depends="init"
          description="Erase all generated files and dirs">
    <delete dir="${build}" verbose="true"/>
    <delete dir="${doc}" verbose="true"/>
    <delete verbose="true">
        <fileset dir="${basedir}" includes="*.jar"/>
    </delete>
  </target>
</project>