forked from liferay/liferay-portal
/
build-test-plugins.xml
146 lines (115 loc) · 4.73 KB
/
build-test-plugins.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
<?xml version="1.0"?>
<project name="portal-test-plugins" basedir="." default="test" xmlns:antelope="antlib:ise.antelope.tasks">
<import file="build-test.xml" />
<target name="deploy-simple-server-plugins">
<if>
<not>
<equals arg1="${plugins.deployed}" arg2="true" />
</not>
<then>
<delete dir="${liferay.home}/data" />
<delete dir="${liferay.home}/deploy" />
</then>
</if>
<exec dir="${lp.plugins.dir}" executable="cmd.exe">
<arg line="/c svn --username ${svn.username} --password ${svn.password} update" />
</exec>
<echo file="${lp.plugins.dir}/build.${user.name}.properties">app.server.dir=${simple.server.dir}
app.server.lib.global.dir=${simple.server.lib.global.dir}
app.server.portal.dir=${simple.server.portal.dir}
plugins.includes=${plugins.includes}</echo>
<ant dir="${lp.plugins.dir}/${plugin.types}" inheritAll="false">
<target name="clean" />
<target name="deploy" />
</ant>
<delete dir="${lp.plugins.dir}/dist" />
<mkdir dir="${lp.plugins.dir}/dist" />
</target>
<target name="deploy-upgrade-simple-server-plugins">
<exec dir="${lp.plugins.dir}" executable="cmd.exe">
<arg line="/c svn --username ${svn.username} --password ${svn.password} update" />
</exec>
<echo file="${lp.plugins.dir}/build.${user.name}.properties">app.server.dir=${simple.server.dir}
app.server.lib.global.dir=${simple.server.lib.global.dir}
app.server.portal.dir=${simple.server.portal.dir}
auto.deploy.dir=$${user.home}/liferay/deploy
plugins.includes=${plugins.includes}</echo>
<ant dir="${lp.plugins.dir}/${plugin.types}" inheritAll="false">
<target name="clean" />
<target name="deploy" />
</ant>
<delete dir="${lp.plugins.dir}/dist" />
<mkdir dir="${lp.plugins.dir}/dist" />
</target>
<target name="deploy-versioned-simple-server-plugins">
<if>
<or>
<equals arg1="${lp.version}" arg2="5.2.3" />
<equals arg1="${lp.version}" arg2="5.2.4" />
</or>
<then>
<copy todir="${user.home}/liferay/deploy">
<fileset
dir="${hudson.plugin.dependencies.dir}/5.2.2"
includes="${plugins.includes}"
/>
</copy>
</then>
<else>
<copy todir="${user.home}/liferay/deploy">
<fileset
dir="${hudson.plugin.dependencies.dir}/${lp.version}"
includes="${plugins.includes}"
/>
</copy>
</else>
</if>
</target>
<target name="test-create">
<echo file="${lp.plugins.dir}/build.${user.name}.properties">app.server.dir=${app.server.tomcat.dir}</echo>
<for list="ext,hooks,layouttpl,portlets,themes" param="plugin.type">
<sequential>
<var name="plugin.type" value="@{plugin.type}" />
<script classpathref="project.classpath" language="beanshell">
String pluginTypeSingular = project.getProperty("plugin.type");
if (pluginTypeSingular.endsWith("s")) {
pluginTypeSingular = pluginTypeSingular.substring(0, pluginTypeSingular.length() - 1);
}
project.setProperty("plugin.type.singular", pluginTypeSingular);
</script>
<delete dir="${lp.plugins.dir}/${plugin.type}/test-${plugin.type.singular}" />
<exec dir="${lp.plugins.dir}/${plugin.type}" executable="create${file.suffix.bat}" outputproperty="create.output" resolveexecutable="true">
<arg line="test test" />
</exec>
<echo>${create.output}</echo>
<if>
<or>
<contains string="${create.output}" substring="BUILD FAILED" />
<not>
<available file="${lp.plugins.dir}/${plugin.type}/test-${plugin.type.singular}" />
</not>
</or>
<then>
<fail>Unable to create ${plugin.type}.</fail>
</then>
</if>
<var name="create.output" unset="true" />
<delete dir="${lp.plugins.dir}/${plugin.type}/test-${plugin.type.singular}" />
</sequential>
</for>
</target>
<target name="test-service-builder">
<echo file="${lp.plugins.dir}/build.${user.name}.properties">app.server.dir=${app.server.tomcat.dir}</echo>
<delete dir="${lp.plugins.dir}/portlets/sample-service-builder-portlet/docroot/WEB-INF/service" />
<delete dir="${lp.plugins.dir}/portlets/sample-service-builder-portlet/docroot/WEB-INF/src/META-INF" />
<ant antfile="${lp.plugins.dir}/portlets/sample-service-builder-portlet/build.xml" target="build-service" inheritAll="false" />
<delete dir="${lp.plugins.dir}/portlets/sample-service-builder-portlet/docroot/WEB-INF/service" />
<delete dir="${lp.plugins.dir}/portlets/sample-service-builder-portlet/docroot/WEB-INF/src/META-INF" />
<exec executable="cmd.exe">
<arg line="/c svn --username ${svn.username} --password ${svn.password} update ${lp.plugins.dir}/portlets/sample-service-builder-portlet/docroot/WEB-INF" />
</exec>
<exec executable="cmd.exe">
<arg line="/c svn revert --recursive ${lp.plugins.dir}/portlets/sample-service-builder-portlet" />
</exec>
</target>
</project>