-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
137 lines (120 loc) · 3.84 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
127
128
129
130
131
132
133
134
135
136
137
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE project>
<project name="AltapayJavaSDK" default="jar">
<import file="build-common.xml"/>
<property name="testUrl" value="https://testgateway.pensio.com/" />
<property name="xsdUrl" value="https://testgateway.pensio.com/" />
<property name="outputdirs" value="build,devbuild,output,dependencylib,generated" />
<property name="local_dependencies" value="" />
<property name="altapay.release" value="1.0.22" />
<path id="CompileSource_classpath">
<fileset dir="lib/" includes="*.jar" />
<fileset dir="dependencylib/" includes="*.jar" />
</path>
<path id="CompileSource_source">
<path path="src/"/>
<path path="generated/"/>
</path>
<path id="CompileSourceDev_classpath">
<fileset dir="devlib/" includes="*.jar" />
</path>
<path id="CompileSourceDev_source">
<path path="test/integration/"/>
</path>
<path id="CompileSourceDevUnit_source">
<path path="test/unit/"/>
</path>
<target name="CopyMetaInf">
<copy todir="build/">
<fileset dir="src/" includes="**/*.version" />
</copy>
</target>
<target name="GenerateSource">
<exec command="xjc" failifexecutionfails="true">
<arg value="-d"/>
<arg value="generated/"/>
<arg value="-p"/>
<arg value="com.pensio.api.generated"/>
<arg value="APIResponse.xsd"/>
</exec>
</target>
<target name="sdkVersion" depends="CopyMetaInf">
<echo file="build/META-INF/sdk.version">sdk-java/${altapay.release}</echo>
</target>
<target name="jar" depends="sdkVersion,GenerateSource,CompileSource">
<jar destfile="output/javaSDK_${altapay.release}.jar">
<fileset dir="build">
<include name="**/*"/>
</fileset>
<fileset dir="src">
<include name="**/*.java"/>
</fileset>
<fileset dir="generated">
<include name="**/*.java"/>
</fileset>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</jar>
<copy todir="output/">
<fileset dir="lib/" includes="*.jar" />
</copy>
</target>
<target name="-EnsureDist">
<delete dir="dist" />
<mkdir dir="dist" />
</target>
<target name="-EnsureGenerated">
<delete dir="generated" />
<mkdir dir="generated" />
</target>
<target name="DistZip" depends="-EnsureDist,-EnsureGenerated,jar">
<zip destfile="dist/${ant.project.name}_${altapay.release}.zip">
<zipfileset dir="output" includes="javaSDK_${altapay.release}.jar" prefix="lib/" />
<zipfileset dir=".">
<filename name="lib/*.jar"/>
</zipfileset>
<zipfileset dir="dependencylib/" prefix="lib/">
<filename name="*.jar"/>
</zipfileset>
<zipfileset dir=".">
<filename name="src/**/*.java"/>
</zipfileset>
</zip>
</target>
<target name="UnitTests" depends="sdkVersion,GenerateSource,CompileSource">
<delete dir="output/unit_tests" />
<mkdir dir="output/unit_tests" />
<junit fork="true">
<classpath>
<pathelement path="build" />
<pathelement path="devbuild" />
<fileset dir="lib/" includes="*.jar" />
<fileset dir="dependencylib/" includes="*.jar" />
<fileset dir="devlib/" includes="*.jar" />
</classpath>
<formatter type="xml" />
<batchtest todir="output/unit_tests">
<fileset dir="test/unit/" includes="**/*Tests.java" />
</batchtest>
</junit>
</target>
<target name="IntegrationTests" depends="sdkVersion,GenerateSource,CompileSource">
<delete dir="output/integration_tests" />
<mkdir dir="output/integration_tests" />
<junit fork="true">
<sysproperty key="pensio.TestUrl" value="${testUrl}" />
<classpath>
<pathelement path="build" />
<pathelement path="devbuild" />
<fileset dir="lib/" includes="*.jar" />
<fileset dir="dependencylib/" includes="*.jar" />
<fileset dir="devlib/" includes="*.jar" />
</classpath>
<formatter type="xml" />
<batchtest todir="output/integration_tests">
<fileset dir="test/integration/" includes="**/*Test.java" />
</batchtest>
</junit>
</target>
</project>