Skip to content

Commit fcc2379

Browse files
author
Howard Lewis Ship
committed
TAPESTRY-2164: The Tapestry binary distribution should include appropriate third party dependencies
git-svn-id: https://svn.apache.org/repos/asf/tapestry/tapestry5/trunk@635362 13f79535-47bb-0310-9956-ffa450edef68
1 parent d7f570b commit fcc2379

File tree

5 files changed

+83
-542
lines changed

5 files changed

+83
-542
lines changed

LICENSE-2.0.txt LICENSE.txt

File renamed without changes.

build.xml

+81-38
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<!--
3-
Copyright 2007 The Apache Software Foundation
3+
Copyright 2007, 2008 The Apache Software Foundation
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
@@ -15,13 +15,17 @@
1515
limitations under the License.
1616
-->
1717

18-
<project default="generate">
18+
<project default="generate" xmlns:mvn="urn:maven-artifact-ant">
1919

2020
<!-- Requires Ant 1.7.0 to execute! -->
2121

2222
<property name="target.dir" value="target"/>
2323
<!-- Binary and source distributions, in .zip and .tar.gz formats, go here. -->
2424
<property name="dists.dir" value="${target.dir}/dist"/>
25+
<!-- Directory that contains the image for the binary distro. -->
26+
<property name="binimage.dir" value="${target.dir}/bin-image"/>
27+
28+
<property name="group" value="org.apache.tapestry"/>
2529

2630

2731
<!-- Read the Maven POM ... -->
@@ -36,61 +40,87 @@
3640
<property name="bin.zip" value="${dists.dir}/tapestry-bin-${version}.zip"/>
3741
<property name="src.zip" value="${dists.dir}/tapestry-src-${version}.zip"/>
3842

39-
<!-- This has to be kept synchronized with the modules, as they change. We include just the "runtime" modules,
40-
no the ones used only within a Maven build; if the user is using Maven, they know how to (let Maven) get
41-
the code. -->
43+
<macrodef name="copyto">
44+
<attribute name="dir"/>
45+
<attribute name="filesetid"/>
4246

43-
<target name="assemble" description="Build distribution files.">
44-
<mkdir dir="${dists.dir}"/>
47+
<sequential>
48+
<mkdir dir="@{dir}"/>
49+
<copy todir="@{dir}" flatten="true">
50+
<fileset refid="@{filesetid}"/>
51+
</copy>
52+
</sequential>
53+
</macrodef>
4554

46-
<echo>*** Building distribution for project version ${version} ***</echo>
55+
<macrodef name="copy-licenses">
56+
<attribute name="module"/>
4757

48-
<echo>Building binary distribution</echo>
58+
<sequential>
59+
<copy todir="${binimage.dir}" flatten="true">
60+
<fileset dir="@{module}" includes="${licenses}"/>
61+
<globmapper from="*" to="@{module}-*"/>
62+
</copy>
63+
</sequential>
4964

50-
<zip destfile="${bin.zip}">
51-
<fileset dir="." includes="LICENSE*,*.txt"/>
5265

53-
<!-- Folds the licences and the JARs into the subfolder. Repetitive but such is life. -->
66+
</macrodef>
5467

55-
<zipfileset prefix="tapestry-annotations" dir="tapestry-annotations" includes="${licenses}"/>
56-
<zipfileset prefix="tapestry-annotations" dir="tapestry-annotations/target" includes="*.jar"/>
5768

58-
<zipfileset prefix="tapestry-core" dir="tapestry-core" includes="${licenses}"/>
59-
<zipfileset prefix="tapestry-core" dir="tapestry-core/target" includes="*.jar"/>
69+
<target name="-maven-setup" unless="maven-ant-tasks.classpath">
70+
<path id="maven-ant-tasks.classpath" path="support/maven-ant-tasks-2.0.8.jar"/>
6071

61-
<zipfileset prefix="tapestry-hibernate" dir="tapestry-hibernate" includes="${licenses}"/>
62-
<zipfileset prefix="tapestry-hibernate" dir="tapestry-hibernate/target" includes="*.jar"/>
72+
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant"
73+
classpathref="maven-ant-tasks.classpath"/>
6374

64-
<zipfileset prefix="tapestry-ioc" dir="tapestry-ioc" includes="${licenses}"/>
65-
<zipfileset prefix="tapestry-ioc" dir="tapestry-ioc/target" includes="*.jar"/>
75+
<echo>Maven Ant Tasks loaded.</echo>
76+
</target>
6677

67-
<zipfileset prefix="tapestry-spring" dir="tapestry-spring" includes="${licenses}"/>
68-
<zipfileset prefix="tapestry-spring" dir="tapestry-spring/target" includes="*.jar"/>
6978

70-
<zipfileset prefix="tapestry-test" dir="tapestry-test" includes="${licenses}"/>
71-
<zipfileset prefix="tapestry-test" dir="tapestry-test/target" includes="*.jar"/>
79+
<target name="assemble-bin" depends="-maven-setup">
80+
<echo>Building binary distribution</echo>
7281

73-
<zipfileset prefix="tapestry-upload" dir="tapestry-upload" includes="${licenses}"/>
74-
<zipfileset prefix="tapestry-upload" dir="tapestry-upload/target" includes="*.jar"/>
82+
<mvn:dependencies filesetid="bin.dependency.fileset" sourcesfilesetid="bin.dependency.sources.fileset">
83+
<dependency groupid="${group}" artifactid="tapestry-upload" version="${pom.version}"/>
84+
<dependency groupid="${group}" artifactid="tapestry-hibernate" version="${pom.version}"/>
85+
<dependency groupid="${group}" artifactid="tapestry-spring" version="${pom.version}"/>
7586

76-
<zipfileset prefix="tapestry-tutorial1" dir="tapestry-tutorial1" includes="${licenses}"/>
77-
<zipfileset prefix="tapestry-tutorial1" dir="tapestry-tutorial1/target" includes="*.war"/>
87+
<!-- All else will be dragged in. -->
88+
</mvn:dependencies>
7889

79-
</zip>
90+
<copyto dir="${binimage.dir}/lib" filesetid="bin.dependency.fileset"/>
91+
<copyto dir="${binimage.dir}/lib-src" filesetid="bin.dependency.sources.fileset"/>
8092

81-
<!-- Build the other formats from the .zip -->
93+
<!-- We don't package tapestry-test because of its huge number of large dependencies. -->
8294

83-
<tar destfile="${dists.dir}/tapestry-bin-${version}.tar.gz" compression="gzip">
84-
<zipfileset src="${bin.zip}"/>
85-
</tar>
95+
<copy-licenses module="tapestry-ioc"/>
96+
<copy-licenses module="tapestry-core"/>
97+
<copy-licenses module="tapestry-hibernate"/>
98+
<copy-licenses module="tapestry-spring"/>
99+
<copy-licenses module="tapestry-upload"/>
86100

87-
<tar destfile="${dists.dir}/tapestry-bin-${version}.tar.bz2" compression="bzip2">
88-
<zipfileset src="${bin.zip}"/>
89-
</tar>
101+
<mkdir dir="${dists.dir}"/>
90102

91-
<echo>Building source distribution</echo>
103+
<parallel>
104+
<zip destfile="${bin.zip}">
105+
<fileset dir="${binimage.dir}"/>
106+
</zip>
107+
<tar destfile="${dists.dir}/tapestry-bin-${version}.tar.gz" compression="gzip">
108+
<fileset dir="${binimage.dir}"/>
109+
</tar>
92110

93-
<!-- Now on to the source files. -->
111+
<tar destfile="${dists.dir}/tapestry-bin-${version}.tar.bz2" compression="bzip2">
112+
<fileset dir="${binimage.dir}"/>
113+
</tar>
114+
115+
</parallel>
116+
117+
</target>
118+
119+
<target name="-announce">
120+
<echo>*** Building distribution for project version ${version} ***</echo>
121+
</target>
122+
123+
<target name="assemble-src">
94124

95125
<zip destfile="${src.zip}">
96126
<fileset dir="." includes="${licenses}"/>
@@ -123,6 +153,18 @@
123153
<checksum fileext=".md5">
124154
<fileset dir="${dists.dir}" includes="*.bz2,*.gz,*.zip"/>
125155
</checksum>
156+
</target>
157+
158+
<!-- This has to be kept synchronized with the modules, as they change. We include just the "runtime" modules,
159+
no the ones used only within a Maven build; if the user is using Maven, they know how to (let Maven) get
160+
the code. -->
161+
162+
<target name="assemble" description="Build distribution files." depends="-announce,assemble-bin,assemble-src">
163+
164+
<echo>Building source distribution</echo>
165+
166+
<!-- Now on to the source files. -->
167+
126168

127169
<echo>*** Please sign the distributions using GPG before uploading the files. ***
128170

@@ -139,6 +181,7 @@
139181

140182
<target name="clean" description="Remove distribution directory.">
141183
<delete dir="${dists.dir}" quiet="true"/>
184+
<delete dir="${binimage.dir}" quiet="true"/>
142185
</target>
143186

144187
<target name="generate" description="Generate and deploy the build.">

support/maven-ant-tasks-2.0.8.jar

958 KB
Binary file not shown.

0 commit comments

Comments
 (0)