forked from char-com-ua/temenos-ofs-jdbc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
192 lines (166 loc) · 6.8 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<project name="pojo" basedir="." default="build">
<property environment="env" />
<property name="dest.dir" value="build" />
<property name="dest.dir.classes" value="${dest.dir}/classes" />
<property name="dest.dir.lib" value="${dest.dir}" />
<property name="artefact.name" value="t24jdbc" />
<property name="artefact" value="${artefact.name}.jar" />
<target name="clean">
<delete dir="${dest.dir}" />
<delete dir="./log" />
</target>
<target name="init" depends="svn-version,get-tchome">
<mkdir dir="${dest.dir}" />
<mkdir dir="${dest.dir.classes}" />
<mkdir dir="${dest.dir.classes}/META-INF"/>
<path id="build.classpath">
<fileset dir="${tcclient.home}/lib" >
<include name="*.jar"/>
</fileset>
<fileset dir="${dest.dir}" >
<include name="*.jar"/>
</fileset>
</path>
</target>
<target name="build" depends="clean,init">
<javac srcdir="src" destdir="${dest.dir.classes}" includes="**" debug="true" debuglevel="lines,vars,source">
<classpath refid="build.classpath" />
</javac>
<!--TEST RESOURCES-->
<copy todir="${dest.dir.classes}">
<fileset dir="src" >
<include name="**/*.txt"/>
</fileset>
</copy>
<!--MANIFEST-->
<tstamp><format property="built.date" pattern="yyyy-MM-dd HH:mm" /></tstamp>
<manifest file="${dest.dir.classes}/META-INF/manifest.mf">
<attribute name="Built-Date" value="${built.date}"/>
<section name="SVN">
<attribute name="URL" value="${svn.url}"/>
<attribute name="Revision" value="${svn.revision}"/>
<attribute name="Version" value="${svn.version}"/>
</section>
</manifest>
<!--JAR-->
<jar basedir="${dest.dir.classes}" destfile="${dest.dir.lib}/${artefact}" manifest="${dest.dir.classes}/META-INF/manifest.mf"/>
</target>
<target name="test" depends="init" >
<java classname="org.t24.driver.test.Test" dir="." fork="true" output="out.txt" failonerror="true">
<classpath refid="build.classpath" />
<jvmarg value="-Dfile.encoding=utf-8"/>
<sysproperty key="tc.home" value="${tcclient.home}"/>
</java>
</target>
<target name="release" depends="clean,init,build" >
<copy file="readme.txt" todir="${dest.dir}">
<filterchain>
<expandproperties/>
</filterchain>
</copy>
<zip zipfile="${dest.dir}/${artefact.name}-${svn.version}.zip">
<zipfileset dir="${dest.dir}" includes="readme.txt"/>
<zipfileset dir="${dest.dir}" includes="*.jar"/>
<zipfileset dir="." includes="conf/**.*"/>
<zipfileset dir="." includes="example/**/**.*"/>
</zip>
</target>
<target name="deploy" >
<!--specific target to deploy this driver to my WSAS server-->
<echo message="initialize..."/>
<property name="scp.local.file" value="${dest.dir.lib}/${artefact}" />
<property name="scp.wsas.home" value="/esb/wso2wsas-3.1.0" />
<input message ="select deploy type [ test, prod ]" addproperty="deploy.type"/>
<fail unless="deploy.type" message="Error usage: ant -Ddeploy.type=type"/>
<property name="scp.host" value="${deploy.type}" />
<property name="scp.login" value="flink" />
<input message ="password for ${scp.login}@${scp.host}" addproperty="scp.pass"/>
<echo message="put new version to server..."/>
<scp file="${scp.local.file}" todir="${scp.login}:${scp.pass}@${scp.host}:${scp.wsas.home}/repository/components/lib/" trust="true"/>
<sshexec host="${scp.host}" username="${scp.login}" password="${scp.pass}" trust="true" command="source /home/flink/.bash_profile && ${scp.wsas.home}/bin/wso2server.sh restart"/>
</target>
<target name="depends" >
<!--specific target to get depends into .tools directory-->
<exec executable="svn">
<arg value="export"/>
<arg value="https://github.com/dlukyanov/temenos-ofs-jdbc/branches/depends/.tools"/>
<arg value=".tools"/>
</exec>
</target>
<target name="svn-version" >
<!-- GET SVN REVISION INFORMATION -->
<tempfile property="svn.temp" deleteonexit="true"/>
<exec executable="svn" output="${svn.temp}">
<arg value="info"/>
<arg value="."/>
</exec>
<!--GENERATE VERSION FROM SVN INFO-->
<loadproperties srcfile="${svn.temp}" >
<filterchain>
<tokenfilter>
<containsregex pattern="^Last Changed Rev:\s*(\d+).*$" replace="svn.revision=\1"/>
</tokenfilter>
</filterchain>
</loadproperties>
<loadproperties srcfile="${svn.temp}" >
<filterchain>
<tokenfilter>
<containsregex pattern="^URL:\s*(.*)$" replace="svn.url=\1"/>
</tokenfilter>
</filterchain>
</loadproperties>
<loadproperties srcfile="${svn.temp}" >
<filterchain>
<tokenfilter>
<containsregex pattern="^URL:\s*.*" />
<replaceregex pattern="^.*/trunk$" replace="svn.version=trunk.r${svn.revision}" flags="g"/>
<replaceregex pattern="^.*/tags/(.*)$" replace="svn.version=\1" flags="g"/>
<replaceregex pattern="^.*/branches/(.*)$" replace="svn.version=\1.r${svn.revision}b" flags="g"/>
</tokenfilter>
</filterchain>
</loadproperties>
<echo message="version=${svn.version}" />
</target>
<target name="get-tchome" depends="get-tchome-check-local,get-tchome-local" unless="local.tchome.present">
<property name="tcclient.home" value="${env.TC.HOME}" />
</target>
<target name="get-tchome-check-local" >
<available file="./.tools/tcclient/lib" type="dir" property="local.tchome.present"/>
</target>
<target name="get-tchome-local" if="local.tchome.present">
<property name="tcclient.home" value="./.tools/tcclient" />
</target>
<target name="groovy" description="start groovy console with tcclibs" >
<!--
"C:\Work\Java\jdk1.6.0_06\bin\java.exe"
"-Xmx128m"
-Dprogram.name=""
-Dgroovy.home="C:\11\svn\mw\projects\services\ESB-Int\trunk\.tools\groovy\bin\.."
-Dtools.jar="C:\Work\Java\jdk1.6.0_06\lib\tools.jar"
-Dgroovy.starter.conf="C:\11\svn\mw\projects\services\ESB-Int\trunk\.tools\groovy\bin\..\conf\groovy-starter.conf"
-Dscript.name=""
-Dfile.encoding=windows-1251
-classpath "C:\11\svn\mw\projects\services\ESB-Int\trunk\.tools\groovy\bin\..\lib\groovy-1.7.5.jar"
org.codehaus.groovy.tools.GroovyStarter
- -main groovy.ui.Console
- -conf "C:\11\svn\mw\projects\services\ESB-Int\trunk\.tools\groovy\bin\..\conf\groovy-starter.conf"
- -classpath "."
-->
<java classname="org.codehaus.groovy.tools.GroovyStarter" fork="true" jvm="javaw" spawn="true">
<!--classpath refid="groovy.classpath"/-->
<classpath>
<pathelement location="./.tools/groovy/lib/groovy-all-2.4.4.jar"/>
</classpath>
<jvmarg value="-Dfile.encoding=windows-1251"/>
<jvmarg value="-Xmx128m"/>
<jvmarg value='-Dprogram.name=""'/>
<jvmarg value='-Dscript.name=""'/>
<jvmarg value='-Dgroovy.home=".tools/groovy"'/>
<jvmarg value='-Dgroovy.starter.conf=".tools/groovy/conf/groovy-starter.conf"'/>
<arg value='--main'/>
<arg value='groovy.ui.Console'/>
<arg value='--calsspath'/>
<arg value='"."'/>
</java>
</target>
</project>