forked from efistasija/SampleNGRepo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
157 lines (135 loc) · 6.6 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
<?xml version="1.0"?>
<project name="test_runner" default="unzip" basedir=".">
<target name="load_properties">
<property file="test_runner.properties"/>
</target>
<target name="export_war_solutions" depends="load_properties, clean">
<export-solutions-as-war solutionNames="${solutions_to_export_as_war_tests}" outputDir="${servoy.test.target-exports.war}"/>
<loadfile property="eclipselog" srcFile=".metadata/.log"/>
<echo message="${eclipselog}" />
</target>
<target name="unzip" depends="export_war_solutions">
<echo level="info" message="Trying to unzip war: ${servoy.test.target-exports.war}/${solutions_to_export_as_war_tests}.war"/>
<unzip src="${servoy.test.target-exports.war}/${solutions_to_export_as_war_tests}.war" dest="${servoy.test.target-exports-unpacked.war}/${solutions_to_export_as_war_tests}" />
<echo level="info" message="Path to new unziped war: ${servoy.test.target-exports-unpacked.war}/${solutions_to_export_as_war_tests}"/>
</target>
<target name="prepare_export_log">
<move file="servoy_log.txt" tofile="${log.dir}/workspace_exporter_app_server_log.txt" failonerror="false"/>
<move file="${test.workspace.dir}/.metadata/.log" tofile="${log.dir}/workspace_exporter_workspace_log.txt" failonerror="false"/>
</target>
<target name="prepare_test_run_log">
<move file="${servoy_install.app_server_dir}/servoy_log.txt" tofile="${log.dir}/import_test_client_log.txt" failonerror="false"/>
</target>
<macrodef name="export-solutions-as-war">
<attribute name="solutionNames"/>
<attribute name="outputDir"/>
<sequential>
<!-- store path to newest Eclipse launcher JAR in path id 'newest.equinox.launcher.path.id' -->
<!-- and turn the path into a property -->
<latest_jar pathName="equinox.launcher.jar.location" dir="${servoy_install.developer}/plugins" includes="**/org.eclipse.equinox.launcher_*.jar"/>
<!-- now we are ready to start the workspace exporter -->
<echo level="info" message="Using application_server dir: ${servoy_install.app_server_dir}"/>
<echo level="info" message="Using developer dir: ${servoy_install.developer}"/>
<echo level="info" message="Using equinox launcher jar: ${equinox.launcher.jar.location_property}" />
<echo level="info" message="Using pluginLocations dir: ${servoy_install.developer}/plugins/" />
<!-- <echo level="info" message="Using workspace dir: ${test.workspace.dir}" /> -->
<echo level="info" message="Using workspace dir: ${test.workspace.dir}" />
<java classname="org.eclipse.equinox.launcher.Main"
classpathref="equinox.launcher.jar.location"
failonerror="true"
fork="true">
<jvmarg value="-Xms40m" />
<jvmarg value="-Xmx512m" />
<jvmarg value="-XX:MaxPermSize=256M" />
<jvmarg value="-Dosgi.configuration.cascaded=false" />
<jvmarg value="-Dservoy.application_server.dir=${servoy_install.app_server_dir}" />
<!--jvmarg value="-Xdebug" />
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=1000,server=y,suspend=y" /-->
<arg value="-application" />
<arg value="com.servoy.eclipse.exporter.war.application" />
<arg value="-data" />
<arg value="${test.workspace.dir}" />
<arg value="-s" />
<arg value="@{solutionNames}" />
<arg value="-o" />
<arg value="@{outputDir}" />
<arg value="-as" />
<arg value="${servoy_install.app_server_dir}" />
<arg value="-pluginLocations" />
<arg value="./plugins/" />
<arg value="-p" />
<arg value="${servoy_properties}" />
<!-- add here any of the optional arguments supported by the exporter; see 'export -help' for more info; for example: -->
<!--<arg value="-help" />-->
<arg value="-verbose" />
<arg value="-verbose" />
<arg value="-sw" />
<arg value="-pl" />
<arg value="-dbd" />
<arg value="-dbi" />
<arg value="-md" />
<arg value="ws" />
<arg value="-i18n" />
<arg value="-users" />
<arg value="-tables" />
<arg value="-modules" />
<arg value="-consoleLog" />
<!--<arg value="-ie" /> -->
</java>
</sequential>
</macrodef>
<macrodef name="make-clean-dir">
<attribute name="dir"/>
<sequential>
<delete dir="@{dir}" quiet="true"/>
<mkdir dir="@{dir}"/>
</sequential>
</macrodef>
<target name="clean">
<!-- clean exports -->
<echo level="verbose">
*** Cleaning exports ***
</echo>
<make-clean-dir dir="${servoy.test.target-exports.war}" />
<delete file="servoy_log.txt" quiet="true"/> <!-- exporter produces this -->
<!-- also delete the workspace log file -->
<delete failonerror="false" file="${test.workspace.dir}/.metadata/.log" quiet="true"/>
<!-- clean test results -->
<make-clean-dir dir="${log.dir}" />
<delete includeemptydirs="true" failonerror="no">
<fileset file="junit*.properties"/>
</delete>
<!-- also delete the log file as it is published as an artifact after each jenkins build -->
<delete file="${servoy_install.app_server_dir}/servoy_log.txt" quiet="true"/>
</target>
<macrodef name="echotimestamp">
<sequential>
<local name="timestamp" />
<tstamp>
<format property="timestamp" pattern="yyyy-MM-dd HH:mm:ss" />
</tstamp>
<echo message="${timestamp}" />
</sequential>
</macrodef>
<macrodef name="latest_jar">
<attribute name="pathName"/>
<attribute name="propertyName" default="@{pathName}_property"/>
<attribute name="dir"/>
<attribute name="includes"/>
<sequential>
<!-- store path to newest JAR -->
<path id="@{pathName}">
<first count="1">
<sort>
<fileset dir="@{dir}" includes="@{includes}" />
<reverse xmlns="antlib:org.apache.tools.ant.types.resources.comparators">
<date />
</reverse>
</sort>
</first>
</path>
<!-- create a property as well -->
<property name="@{propertyName}" refid="@{pathName}" />
</sequential>
</macrodef>
</project>