-
Notifications
You must be signed in to change notification settings - Fork 115
/
build.xml
126 lines (108 loc) · 4.68 KB
/
build.xml
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
<?xml version="1.0"?>
<project name="anet-java-sdk" default="compile" basedir=".">
<property name="version" value="1.9.3" />
<property name="dirs.base" value="${basedir}" />
<property name="src.dir" value="${basedir}/src/main/java" />
<property name="javadocs.dir" value="${basedir}/docs/javadocs" />
<property name="build.dir" value="${basedir}/target" />
<property name="classes.dir" value="${basedir}/target/classes" />
<property name="lib.dir" value="${basedir}/target/lib" />
<property name="src.tests" value="${basedir}/src/test/java" />
<property name="resources.dir" value="${basedir}/resources" />
<property name="reports.tests" value="${basedir}/target/reports" />
<property name="javac.version" value="1.5" />
<property file="${user.home}/${ant.project.name}.properties" />
<property name="prop.message" value="must be defined in ${user.home}/${ant.project.name}.properties" />
<fail message="api.login.id ${prop.message}" unless="api.login.id" />
<fail message="transaction.key ${prop.message}" unless="transaction.key" />
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar" />
<pathelement path="${resources.dir}" />
</path>
<path id="junit-classpath">
<fileset dir="${lib.dir}" includes="**/*.jar" />
<pathelement path="${classes.dir}" />
<pathelement path="${resources.dir}" />
</path>
<target name="clean">
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${classes.dir}" includes="**/*.*" />
<fileset dir="${build.dir}" includes="**/*.jar" />
</delete>
</target>
<target name="compile">
<mkdir dir="${classes.dir}" />
<javac srcdir="${src.dir}" destdir="${classes.dir}" debug="true" optimize="true" includes="**/*.java" classpathref="classpath" includeantruntime="false" source="${javac.version}" target="${javac.version}">
<compilerarg value="-Xlint" />
</javac>
</target>
<target name="compile-test" depends="compile">
<mkdir dir="${classes.dir}" />
<javac srcdir="${src.tests}" destdir="${classes.dir}" debug="true" optimize="false" includes="**/*.java" classpathref="classpath" includeantruntime="false" source="${javac.version}" target="${javac.version}">
<compilerarg value="-Xlint" />
</javac>
</target>
<target name="jar" depends="compile, compile-test">
<mkdir dir="${classes.dir}" />
<jar jarfile="${build.dir}/${ant.project.name}-${version}.jar">
<fileset dir="${classes.dir}">
<include name="**/*.class" />
<exclude name="**/*Test*.class" />
</fileset>
</jar>
<jar jarfile="${build.dir}/${ant.project.name}-test-${version}.jar">
<fileset dir="${classes.dir}">
<include name="**/*Test*.class" />
</fileset>
</jar>
<jar jarfile="${build.dir}/${ant.project.name}-src-${version}.jar">
<fileset dir="${src.dir}">
<include name="**/*.java" />
</fileset>
<fileset dir="${src.tests}">
<include name="**/*.java" />
</fileset>
</jar>
<!-- Make VeraCode happy by giving same binary file name to verify -->
<copy file="${build.dir}/${ant.project.name}-${version}.jar" tofile="${build.dir}/${ant.project.name}.jar"/>
<copy file="${build.dir}/${ant.project.name}-test-${version}.jar" tofile="${build.dir}/${ant.project.name}-test.jar"/>
</target>
<target name="unit-test" depends="jar">
<delete dir="${reports.tests}" />
<mkdir dir="${reports.tests}" />
<junit printsummary="yes" failureProperty="test.failure" showoutput="true">
<classpath>
<path refid="junit-classpath" />
</classpath>
<sysproperty key="API_LOGIN_ID" value="${api.login.id}" />
<sysproperty key="TRANSACTION_KEY" value="${transaction.key}" />
<formatter type="plain" />
<batchtest fork="yes" todir="${reports.tests}">
<fileset dir="${classes.dir}">
<include name="**/*Test*.class" />
<exclude name="**/UnitTestData.class, **/MyTest.class" />
</fileset>
</batchtest>
</junit>
<fail message="test failed" if="test.failure" />
</target>
<target name="test" depends="unit-test" />
<target name="javadoc" description="Create javadocs for all files">
<delete dir="${javadocs.dir}" />
<mkdir dir="${javadocs.dir}" />
<javadoc destdir="${javadocs.dir}" author="true" version="true" encoding="UTF-8" use="true" windowtitle="Authorize.Net Java SDK" verbose="off" serialwarn="off">
<classpath>
<fileset id="libFiles" dir="target/lib">
<include name="**/**/*.jar" />
</fileset>
</classpath>
<fileset dir="${src.dir}">
<include name="**" />
<exclude name="**Test**" />
<exclude name="**/README" />
</fileset>
<doctitle>
<![CDATA[<h1>Authorize.Net Java SDK</h1>]]></doctitle>
</javadoc>
</target>
</project>