forked from wocommunity/wolips
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
154 lines (138 loc) · 6.14 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?xml version="1.0"?>
<!-- ======================================================== -->
<!-- Main WOProject Ant build file -->
<!-- Serves as a facade for different helper build files. -->
<!-- ======================================================== -->
<project name="woproject" default="all" basedir=".">
<path id="classpath">
<fileset dir="${ant.home}">
<!-- In the ant dist the ant.jar is under ant.home/lib. Within Eclipse and the buildserver its under ant.home.-->
<include name="ant.jar"/>
<include name="../ant.jar"/>
</fileset>
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
<fileset dir="../lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${wo.dir.library.frameworks}">
<include name="JavaEOAccess.framework/Resources/Java/*.jar"/>
<include name="JavaEOControl.framework/Resources/Java/*.jar"/>
<include name="JavaFoundation.framework/Resources/Java/*.jar"/>
<include name="JavaWebObjects.framework/Resources/Java/*.jar"/>
<include name="JavaJDBCAdaptor.framework/Resources/Java/*.jar"/>
</fileset>
<pathelement path="${build.output.java.dir}"/>
</path>
<!-- ========================================== -->
<!-- Build copy.resources. -->
<!-- ========================================== -->
<target name="copy.resources">
<mkdir dir="../${build.output.build.dir}/woproject_${build.version}"/>
<mkdir dir="../${build.output.build.dir}/woproject_${build.version}/examples"/>
<copy todir="../${build.output.build.dir}/woproject_${build.version}/examples">
<fileset dir="tests/wo"/>
</copy>
<mkdir dir="../${build.output.build.dir}/woproject_${build.version}/doc"/>
<copy todir="../${build.output.homepage.dir}/">
<fileset dir="../${build.output.homepage.dir}/"/>
</copy>
</target>
<!-- ========================================== -->
<!-- Build java. -->
<!-- ========================================== -->
<target name="java">
<ant dir="." antfile="../${project.buildscripts.dir}/ant-style-project.xml" target="java">
<property name="param.src.dir" value="src/java"/>
<property name="param.dest.dir" value="../${build.output.java.dir}"/>
<reference refid="classpath"/>
</ant>
</target>
<!-- ========================================== -->
<!-- Build jar. -->
<!-- ========================================== -->
<target name="jar">
<mkdir dir="../${build.output.build.dir}/woproject_${build.version}/lib"/>
<patternset id="param.classes.patternset.refid">
<include name="**/org/objectstyle/woenvironment/**"/>
<include name="**/org/objectstyle/woproject/**"/>
<include name="**/org/objectstyle/cayenne/**"/>
<exclude name="**/*Test.class"/>
</patternset>
<ant dir="." antfile="../${project.buildscripts.dir}/ant-style-project.xml" target="jar.with.resources">
<property name="param.classes.dir" value="../${build.output.java.dir}"/>
<property name="param.resources.dir" value="src/resources"/>
<property name="param.jar.file" value="../${build.output.build.dir}/woproject_${build.version}/lib/woproject.jar"/>
<reference refid="param.classes.patternset.refid"/>
</ant>
</target>
<!-- ========================================== -->
<!-- Build copy jars. -->
<!-- ========================================== -->
<target name="lib">
<mkdir dir="../${build.output.build.dir}/woproject_${build.version}/lib"/>
<copy todir="../${build.output.build.dir}/woproject_${build.version}/lib">
<fileset dir="../lib">
<include name="${lib.cayenne}"/>
<include name="${lib.log4j}"/>
</fileset>
</copy>
</target>
<!-- ========================================== -->
<!-- Build all. -->
<!-- ========================================== -->
<target name="all" depends="copy.resources,java,jar,lib">
</target>
<!-- ============================================= -->
<!-- Run tests. -->
<!-- ============================================= -->
<target name="test">
<property environment="env"/>
<path id="classpath-tests-run">
<fileset dir="../${build.output.build.dir}/woproject_${build.version}/lib">
<include name="*.jar"/>
</fileset>
<!-- This is important, since java.home can point to -->
<!-- JRE that has no compiler. -->
<fileset dir="${env.JAVA_HOME}/lib">
<include name="*.jar" />
</fileset>
<fileset dir="${wo.woroot}/Library/Frameworks">
<include name="JavaFoundation.framework/Resources/Java/*.jar"/>
</fileset>
</path>
<path id="classpath-tests">
<path refid="classpath"/>
<pathelement path="../${build.output.build.dir}/woproject_${build.version}/lib/woproject.jar"/>
</path>
<mkdir dir="../${build.output.java.test.dir}"/>
<ant dir="." antfile="../${project.buildscripts.dir}/ant-style-project.xml" target="java.tests">
<property name="param.src.dir" value="tests/java"/>
<property name="param.dest.dir" value="../${build.output.java.test.dir}"/>
<reference refid="classpath-tests"/>
</ant>
<ant antfile="build-test.xml">
<property name="test.results" value="../${build.output.test.dir}/results"/>
<property name="test.classes" value="../${build.output.java.test.dir}"/>
<reference refid="classpath-tests"/>
<reference refid="classpath-tests-run"/>
</ant>
</target>
<!-- ========================================== -->
<!-- Build dist. -->
<!-- ========================================== -->
<target name="dist">
<mkdir dir="../${build.output.dist.targz.dir}"/>
<tar tarfile="../${build.output.dist.targz.dir}/woproject_${build.version}.tar">
<tarfileset dir="../${build.output.build.dir}/woproject_${build.version}">
<exclude name="**/examples/**"/>
<exclude name="**/lib/ant.jar"/>
<exclude name="**/lib/${lib.junit}"/>
</tarfileset>
</tar>
<gzip src="../${build.output.dist.targz.dir}/woproject_${build.version}.tar"
zipfile="../${build.output.dist.targz.dir}/woproject_${build.version}.tar.gz"/>
<delete file="../${build.output.dist.targz.dir}/woproject_${build.version}.tar"/>
</target>
</project>