File: build.xml

package info (click to toggle)
jvyamlb 0.2.5-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, stretch, wheezy
  • size: 968 kB
  • ctags: 1,811
  • sloc: java: 10,098; xml: 93; sh: 44; makefile: 10
file content (110 lines) | stat: -rw-r--r-- 3,791 bytes parent folder | download
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
<?xml version="1.0" encoding="utf-8"?>

<project basedir="." default="jar" name="jvyamlb">
  <description>
    	JvYAMLb is a Java YAML 1.1 parser and emitter.
  </description>

  <!-- First try to load machine-specific properties. -->
  <property file="build.properties"/>
  
  <!-- And then load the defaults. It seems backwards to set defaults AFTER 
       setting local overrides, but that's how Ant works. -->
  <property file="default.build.properties"/>
  
  <path id="build.classpath">
    <fileset dir="${lib.dir}" includes="*.jar" excludes="jvyamlb*.jar"/>
  </path>

  <patternset id="java.src.pattern">
    <include name="**/*.java"/>
  </patternset>

  <target name="prepare" description="Creates the directories needed for building">
    <xmlproperty file="build-config.xml" keepRoot="false" collapseAttributes="true"/>
    <mkdir dir="${build.dir}"/>
    <mkdir dir="${classes.dir}"/>
    <mkdir dir="${jvyamlb.classes.dir}"/>
    <mkdir dir="${test.classes.dir}"/>
  </target>
  
  <target name="compile" depends="prepare" description="Compile the source files for the project.">
    <javac destdir="${jvyamlb.classes.dir}" debug="true" source="${javac.version}" target="${javac.version}">
      <classpath refid="build.classpath"/>
      <src path="${main.src.dir}"/>
      <patternset refid="java.src.pattern"/>
    </javac>
  </target>

  <target name="compile-tests" depends="compile" description="Compile the test source files for the project.">
    <javac destdir="${test.classes.dir}" debug="true" source="${javac.version}" target="${javac.version}">
      <classpath refid="build.classpath"/>
      <classpath>
        <pathelement location="${jvyamlb.classes.dir}"/>
      </classpath>
      <src path="${test.src.dir}"/>
    </javac>
  </target>

  <target name="test" depends="compile-tests" description="Runs all tests">
    <junit>
      <classpath refid="build.classpath"/>
      <classpath>
      	<pathelement location="${jvyamlb.classes.dir}"/>
      	<pathelement location="${test.classes.dir}"/>
      </classpath>
      <formatter type="brief" usefile="false"/>
      <batchtest>
        <fileset dir="${test.src.dir}">
          <include name="**/*Test.java"/>
        </fileset>
      </batchtest>
    </junit>
  </target>

  <target name="jar" depends="test" description="Create the jvyaml.jar file">
    <jar destfile="${lib.dir}/jvyamlb-0.2.5.jar">
      <fileset dir="${jvyamlb.classes.dir}">
        <include name="**/*.class"/>
        <include name="**/*.properties"/>
      </fileset>
      <manifest>
        <attribute name="Built-By" value="${user.name}"/>
      </manifest>
    </jar>
  </target>
	
  <target name="dist-bin" depends="jar">
    <tar destfile="${release.dir}/jvyamlb-bin-0.2.5.tar.gz" compression="gzip">
      <tarfileset dir="." prefix="jvyamlb-0.2.5">
        <include name="lib/**"/>
        <include name="docs/**"/>
        <include name="LICENSE"/>
        <include name="README"/>
        <include name="CREDITS"/>
      </tarfileset>
    </tar>
  </target>
  
  <target name="dist-src" depends="jar">
    <tar destfile="${release.dir}/jvyamlb-src-0.2.5.tar.gz" compression="gzip">
      <tarfileset dir="." prefix="jvyamlb-0.2.5">
        <include name="lib/**"/>
        <include name="docs/**"/>
        <include name="src/**"/>
        <include name="build.xml"/>
        <include name="LICENSE"/>
        <include name="README"/>
        <include name="CREDITS"/>
        <include name="default.build.properties"/>
      </tarfileset>
    </tar>
  </target>
  
  <target name="dist" depends="dist-bin,dist-src"/>

  <target name="clean" depends="prepare" description="clean almost everything">
    <delete dir="${build.dir}"/>
    <delete file="${lib.dir}/jvyamlb-0.2.5.jar" quiet="true"/>
  </target>
</project>