Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: b2c9203ce062cbc15b6d327df1f06fb8bdf868a7 (plain) (blame)
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="build-kernel" xmlns:ivy="antlib:org.apache.ivy.ant">

	<path id="unit.test.bundles">
		<pathelement location="../org.eclipse.virgo.kernel.shutdown"/>
		<pathelement location="../org.eclipse.virgo.kernel.authentication"/>
		<pathelement location="../org.eclipse.virgo.kernel.core"/>
		<pathelement location="../org.eclipse.virgo.kernel.artifact"/>
		<pathelement location="../org.eclipse.virgo.kernel.services"/>
		<pathelement location="../org.eclipse.virgo.kernel.osgi"/>
		<pathelement location="../org.eclipse.virgo.kernel.deployer"/>
		<pathelement location="../org.eclipse.virgo.kernel.userregion"/>
		<pathelement location="../org.eclipse.virgo.kernel.agent.dm"/>
		<pathelement location="../org.eclipse.virgo.kernel.kerneldmfragment"/>
		<pathelement location="../org.eclipse.virgo.kernel.dmfragment"/>
		<pathelement location="../org.eclipse.virgo.kernel.dm"/>
		<pathelement location="../org.eclipse.virgo.kernel.deployer.dm"/>
		<pathelement location="../org.eclipse.virgo.kernel.model"/>
		<pathelement location="../org.eclipse.virgo.kernel.shell"/>
		<pathelement location="../org.eclipse.virgo.kernel.stubs"/>
	</path>

	<path id="bundles">
		<path refid="unit.test.bundles" />
		<pathelement location="../org.eclipse.virgo.kernel"/>
		<pathelement location="../org.eclipse.virgo.kernel.test"/>
		<pathelement location="../org.eclipse.virgo.kernel.deployer.testbundle"/>
		<pathelement location="../org.eclipse.virgo.kernel.deployer.test"/>
	</path>

	<property file="${basedir}/../build.properties"/>
	<property file="${basedir}/../build.versions"/>
	<import file="${basedir}/../virgo-build/multi-bundle/default.xml"/>

	<target name="precommit" depends="clean, clean-integration, test, findbugs, package, smoke-test"
		description="Performs a CI server-like build, should be run prior to performing a Git push"/>

	<target name="package" depends="ivy.init">
		<delete dir="${package.output.dir}" quiet="true"/>
		<mkdir dir="${package.output.dir}"/>

		<ivy:resolve resolveId="copy.path" file="${basedir}/lib-ivy.xml" transitive="true"/>
		<ivy:retrieve resolveId="copy.path" pattern="${package.output.dir}/lib/[artifact]-[revision].[ext]" conf="lib" type="jar"/>

		<ivy:resolve resolveId="copy.path" file="${basedir}/kernel-ivy.xml" transitive="true"/>
		<ivy:retrieve resolveId="copy.path" pattern="${package.output.dir}/lib/kernel/[artifact]-[revision].[ext]" conf="lib-kernel" type="jar"/>
		
		<ivy:resolve resolveId="copy.path" file="${basedir}/kernel-ivy.xml" transitive="true"/>
		<ivy:retrieve resolveId="copy.path" pattern="${package.output.dir}/repository/ext/[artifact]-[revision].[ext]" conf="repository-ext" type="jar"/>

		<mkdir dir="${package.output.dir}/bin/service"/>
		<mkdir dir="${package.output.dir}/config"/>
		<mkdir dir="${package.output.dir}/work"/>

		<echo file="${package.output.dir}/lib/.version"
				message="virgo.kernel.version=${bundle.version}&#xa;"/>

		<ivy:cachepath resolveId="jsw" pathid="jsw" organisation="org.tanukisoftware"
				module="org.tanukisoftware.wrapper" revision="${org.tanukisoftware.wrapper}" conf="runtime" type="zip"
				inline="true" log="download-only"/>

		<unzip dest="${package.output.dir}">
			<path refid="jsw"/>
			<patternset>
				<include name="*/bin/wrapper-*"/>
				<include name="*/lib/libwrapper-*"/>
				<include name="*/lib/wrapper-*"/>
				<include name="*/lib/wrapper.jar"/>
			</patternset>
			<globmapper from="wrapper-delta-pack-${org.tanukisoftware.wrapper}/*" to="bin/service/*"/>
		</unzip>

		<copy todir="${package.output.dir}/bin" failonerror="false">
			<fileset dir="${basedir}/bin"/>
		</copy>

		<copy todir="${package.output.dir}/lib" failonerror="false">
			<fileset dir="${basedir}/lib"/>
			<filterset>
				<filter token="ASPECTJ.VERSION" value="${org.aspectj}"/>
				<filter token="FELIX.CONFIGADMIN.VERSION" value="${org.apache.felix}"/>
				<filter token="FELIX.EVENTADMIN.VERSION" value="${org.apache.felix.eventadmin}"/>
				<filter token="JLINE.VERSION" value="${net.sourceforge.jline}"/>
				<filter token="KERNEL.VERSION" value="${bundle.version}"/>
				<filter token="MEDIC.VERSION" value="${org.eclipse.virgo.medic}"/>
				<filter token="REPOSITORY.VERSION" value="${org.eclipse.virgo.repository}"/>
				<filter token="SLF4J.VERSION" value="${org.slf4j}"/>
				<filter token="SPRING.DM.VERSION" value="${org.springframework.osgi}"/>	
				<filter token="SPRING.VERSION" value="${org.springframework}"/>
				<filter token="UTIL.VERSION" value="${org.eclipse.virgo.util}"/>
			</filterset>
		</copy>

		<copy todir="${package.output.dir}/config" failonerror="false">
			<fileset dir="${basedir}/config" excludes="keystore"/>
			<filterset>
				<filter token="ASPECTJ.VERSION" value="${org.aspectj}"/>
				<filter token="FELIX.CONFIGADMIN.VERSION" value="${org.apache.felix}"/>
				<filter token="FELIX.EVENTADMIN.VERSION" value="${org.apache.felix.eventadmin}"/>
				<filter token="JLINE.VERSION" value="${net.sourceforge.jline}"/>
				<filter token="KERNEL.VERSION" value="${bundle.version}"/>
				<filter token="MEDIC.VERSION" value="${org.eclipse.virgo.medic}"/>
				<filter token="REPOSITORY.VERSION" value="${org.eclipse.virgo.repository}"/>
				<filter token="SLF4J.VERSION" value="${org.slf4j}"/>
				<filter token="SPRING.DM.VERSION" value="${org.springframework.osgi}"/>	
				<filter token="SPRING.VERSION" value="${org.springframework}"/>
				<filter token="UTIL.VERSION" value="${org.eclipse.virgo.util}"/>
			</filterset>
		</copy>
		
		<copy todir="${package.output.dir}/repository/ext" failonerror="false">
			<fileset dir="${basedir}/repository/ext"/>
		</copy>
		
		<copy todir="${package.output.dir}/repository/ext" failonerror="false">
			<fileset dir="${package.output.dir}/lib/kernel">
				<include name="org.eclipse.virgo.kernel.agent.dm-*.jar"/>
			</fileset>
		</copy>
		
		<move todir="${package.output.dir}/repository/ext" failonerror="false">
			<fileset dir="${package.output.dir}/lib/kernel">
				<include name="org.eclipse.virgo.kernel.dmfragment-*.jar"/>
				<include name="org.eclipse.virgo.kernel.deployer.dm-*.jar"/>
			</fileset>
		</move>
		
		<mkdir dir="${package.output.dir}/repository/usr"/>
		
		<copy file="${basedir}/config/keystore" todir="${package.output.dir}/config" failonerror="false"/>

		<chmod perm="600">
			<fileset dir="${package.output.dir}/config">
				<include name="org.eclipse.virgo.kernel.jmxremote.access.properties"/>
			</fileset>
		</chmod>

		<chmod perm="755">
			<fileset dir="${package.output.dir}/bin">
				<include name="*.sh"/>
			</fileset>
			<fileset dir="${package.output.dir}/bin/service">
				<include name="*.sh"/>
			</fileset>
			<fileset dir="${package.output.dir}/bin/service/bin">
				<exclude name="*.exe"/>
			</fileset>
		</chmod>

		<copy todir="${package.output.dir}" failonerror="false">
			<fileset dir="${basedir}/resources"/>
		</copy>

		<mkdir dir="${artifacts.dir}"/>
		<zip destfile="${package.output.file}">
			<zipfileset dir="${package.dir}" includes="${package.basename}/bin/*.sh" filemode="755"/>
			<zipfileset dir="${package.dir}" includes="${package.basename}/bin/service/*.sh" filemode="755"/>
			<zipfileset dir="${package.dir}" includes="${package.basename}/bin/service/bin/*" filemode="755"/>
			<zipfileset dir="${package.dir}" includes="${package.basename}/config/org.eclipse.virgo.kernel.jmxremote.access.properties" filemode="600"/>
			<zipfileset dir="${package.dir}">
				<exclude name="${package.basename}/bin/*.sh"/>
				<exclude name="${package.basename}/bin/service/*.sh"/>
				<exclude name="${package.basename}/bin/service/bin/*"/>
				<exclude name="${package.basename}/config/org.eclipse.virgo.kernel.jmxremote.access.properties"/>
			</zipfileset>
		</zip>
	</target>

<!--publish-package, -->

	<target name="publish" depends="publish-package, publish-multi-bundle.publish"/>

	<target name="smoke-test" description="Runs a smoke test on the kernel packaged build">
		<path id="smoke.test.bundles">
			<pathelement location="${basedir}/../org.eclipse.virgo.kernel.smoketest" />
		</path>
		<antcall target="test.pre"/>
		<all-bundles target="test-package" buildpathRef="smoke.test.bundles">
			<property name="package.output.file" value="${package.output.file}"/>
			<property name="package.basename" value="${package.basename}"/>
		</all-bundles>
		<antcall target="test.post"/>
	</target>

</project>

Back to the top