-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubfloor-pkg.xml
More file actions
179 lines (151 loc) · 8 KB
/
subfloor-pkg.xml
File metadata and controls
179 lines (151 loc) · 8 KB
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
<!--===========================================================================
Copyright (c) 2009, Pentaho Engineering Team
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Pentaho Corporation nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY Pentaho Engineering Team ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
============================================================================-->
<!--===========================================================================
== SUBFLOOR-PKG ==
$Rev: 100 $
$Date: 2009-12-09 11:43:26 -0500 (Wed, 09 Dec 2009) $
Project Home: http://code.google.com/p/subfloor/
Provides default targets for creating application archives such as zip and tar.gzip
files.
============================================================================-->
<project name="subfloor-pkg" basedir="." default="default" xmlns:ivy="antlib:org.apache.ivy.ant">
<!-- Define the default location of the common build file -->
<property name="subfloor.file"
value="./subfloor.xml"
description="This is the location of the standardized subfloor.xml file" />
<!-- Import the common_build.xml file which contains all the default tasks -->
<import file="${subfloor.file}" />
<property name="stage.dir" value="${bin.dir}/stage" description="Package staging" />
<property name="package.root.dir"
value="${ivy.artifact.id}"
description="Root directory of final zip or tar package" />
<property name="approot.stage.dir"
value="${stage.dir}/${package.root.dir}"
description="Stage application root dir" />
<property name="package.id" value="${ivy.artifact.id}" />
<property name="package.basename" value="${package.id}-${project.revision}" />
<property name="package.resdir" value="${basedir}/package-res" />
<property name="package.artifact.ivyfile"
value="package-ivy.xml"
description="The ivy file defining dependencies of the package" />
<property name="package.artifact.pomfile"
value="package-pom.xml"
description="The Maven pom file defining dependencies of the package" />
<target name="clean-stage" extensionOf="clean-dist">
<delete dir="${dist.dir}" />
<delete dir="${stage.dir}" />
</target>
<!-- override of jar target.. this definitely should be moved into common build... looks like this is already done -->
<!--<target name="jar"-->
<!--depends="compile,set-build.id,create-version-file"-->
<!--description="Jars up the bin directory after a compile">-->
<!--<jar destfile="${dist.dir}/${ivy.artifact.id}-${project.revision}.jar">-->
<!--<manifest>-->
<!--<attribute name="Implementation-Title" value="${impl.title}" />-->
<!--<attribute name="Implementation-Version" value="${project.revision}.${build.id}" />-->
<!--<attribute name="Implementation-Vendor" value="${impl.vendor}" />-->
<!--<attribute name="Implementation-ProductID" value="${impl.productID}" />-->
<!--</manifest>-->
<!--<fileset dir="${classes.dir}" />-->
<!--</jar>-->
<!--</target>-->
<target name="create-version-file">
<propertyfile file="${classes.dir}/version.properties" comment="${impl.title} build information">
<entry key="version" value="${project.revision}.${build.id}" />
<entry key="builddate" type="date" value="now" />
</propertyfile>
</target>
<target name="assemble.init">
<mkdir dir="${approot.stage.dir}" />
</target>
<extension-point name="assemble" depends="assemble.init,assemble.copy-libs, assemble.copy-resources"/>
<target name="assemble.copy-resources">
<copy todir="${approot.stage.dir}" overwrite="true">
<fileset dir="${package.resdir}" />
</copy>
<chmod perm="a+x" dir="${stage.dir}" includes="**/*.sh" />
</target>
<target name="assemble.copy-libs">
<copy todir="${approot.stage.dir}/lib">
<fileset dir="${lib.dir}" />
<fileset file="${dist.dir}/${ivy.artifact.id}-${project.revision}.jar" />
</copy>
</target>
<target name="package"
depends="assemble,package-zip,package-targz"
description="Creates packaged distributable artifacts" />
<target name="package-zip">
<zip destfile="${dist.dir}/${package.basename}.zip">
<zipfileset dir="${stage.dir}" />
</zip>
</target>
<target name="package-targz">
<tar destfile="${dist.dir}/${package.basename}.tar.gz" longfile="gnu" compression="gzip">
<tarfileset dir="${stage.dir}" mode="755">
<include name="**/*.sh" />
</tarfileset>
<tarfileset dir="${stage.dir}">
<exclude name="**/*.sh" />
</tarfileset>
</tar>
</target>
<!--=======================================================================
create-pom (override)
Creates the POM files for publishing the jar and gwt zip package to the Maven repository
====================================================================-->
<target name="create-pom"
depends="install-ivy,subfloor.create-pom,create-package-pom"
description="Creates a POM file based on the ivy dependencies" />
<!--=======================================================================
create-package-pom
Creates a POM file for the package
====================================================================-->
<target name="create-package-pom"
depends="install-ivy"
description="Creates a POM file based on the ivy dependencies for a separate package">
<ivy:makepom ivyfile="${package.artifact.ivyfile}" pomfile="${package.artifact.pomfile}" />
<replace file="${package.artifact.pomfile}" token="jar" value="zip" />
</target>
<!--=======================================================================
publish-nojar (override)
Publishes the jar and zip package to the Maven repository
====================================================================-->
<target name="pkg.publish-nojar" extensionOf="publish-nojar">
<antcall target="maven-publish-artifact">
<param name="publish.pomFile" value="${package.artifact.pomfile}" />
<param name="publish.file" value="${dist.dir}/${package.basename}.zip" />
</antcall>
</target>
<!--=======================================================================
publish-local-nojar (override)
Publishes jar and zip package locally
====================================================================-->
<target name="pkgpublish-local-nojar" extensionOf="publish-local-nojar">
<ivy:resolve file="${package.artifact.ivyfile}" />
<ivy:publish resolver="local" pubrevision="${project.revision}" overwrite="true" forcedeliver="true">
<artifacts pattern="${dist.dir}/[artifact]-[revision].[ext]" />
</ivy:publish>
</target>
</project>