Author: nbubna
Date: Tue Jul 3 10:59:01 2007
New Revision: 552931
URL: http://svn.apache.org/viewvc?view=rev&rev=552931
Log:
add release targets, add publish targets, and spruce up the jar target to
simplify release process
Modified:
velocity/dvsl/trunk/build.properties
velocity/dvsl/trunk/build.xml
Modified: velocity/dvsl/trunk/build.properties
URL:
http://svn.apache.org/viewvc/velocity/dvsl/trunk/build.properties?view=diff&rev=552931&r1=552930&r2=552931
==============================================================================
--- velocity/dvsl/trunk/build.properties (original)
+++ velocity/dvsl/trunk/build.properties Tue Jul 3 10:59:01 2007
@@ -7,6 +7,9 @@
# The title of this project
project.title = DVSL
+# A description of this project
+project.description = Declarative Velocity Style Language, an XML
transformation tool that uses Xpath and VTL
+
# version number
project.version = 1.0-dev
@@ -22,6 +25,17 @@
# The base directory for distribution targets
dist.home = dist
+# The directory for the examples
+examples.home = examples
+
+# The base directory for preparing releases
+release.home = ${dist.home}/release/${final.name}
+
+# distribution properties
+publish.server=people.apache.org
+publish.home=~/public_html/velocity/dvsl/${final.name}
+publish.docs.home=/www/velocity.apache.org/dvsl/
+
# The base directory for component sources
source.home = src
@@ -92,4 +106,4 @@
#
# Destination
-lib.dir= ${basedir}/lib
+lib.home= ${basedir}/lib
Modified: velocity/dvsl/trunk/build.xml
URL:
http://svn.apache.org/viewvc/velocity/dvsl/trunk/build.xml?view=diff&rev=552931&r1=552930&r2=552931
==============================================================================
--- velocity/dvsl/trunk/build.xml (original)
+++ velocity/dvsl/trunk/build.xml Tue Jul 3 10:59:01 2007
@@ -46,7 +46,8 @@
<mkdir dir="${build.home}/conf"/>
<mkdir dir="${build.home}/javadoc"/>
<mkdir dir="${build.home}/tests"/>
- <mkdir dir="${lib.dir}" />
+ <mkdir dir="${lib.home}" />
+ <mkdir dir="${dist.home}"/>
</target>
<!-- ================================================================== -->
@@ -200,7 +201,7 @@
<!-- To do a truly, completely clean build, include this target -->
<target name="clean.lib"
description="Deletes the folder of downloaded dependencies">
- <delete dir="${lib.dir}"/>
+ <delete dir="${lib.home}"/>
</target>
<!-- ================================================================== -->
@@ -222,7 +223,7 @@
version="true"
doctitle="<h1>${project.title}</h1>"
windowtitle="${project.title} (Version ${project.version})"
- bottom="Copyright (c) 2001-2002 Apache Software Foundation" >
+ bottom="Copyright (c) 2001-2007 Apache Software Foundation" >
<classpath refid="classpath"/>
@@ -234,9 +235,27 @@
<!-- ================================================================== -->
<target name="jar" depends="compile"
description="Creates jar file">
- <jar jarfile="${dvsl.jar}"
- basedir="${build.home}/classes"
- manifest="${conf.home}/MANIFEST.MF"/>
+ <jar jarfile="${dist.home}/${dvsl.jar}">
+ <fileset dir="${build.home}/classes"/>
+ <metainf dir="${basedir}">
+ <include name="LICENSE"/>
+ <include name="NOTICE"/>
+ </metainf>
+ <manifest>
+ <attribute name="Created-By" value="Apache Ant"/>
+ <attribute name="Package" value="org.apache.dvsl"/>
+ <attribute name="Build-Jdk" value="${java.version}"/>
+ <attribute name="Extension-Name" value="${project.name}"/>
+ <attribute name="Specification-Title" value="${project.title} is
${project.description}" />
+ <attribute name="Specification-Vendor" value="Apache Software
Foundation"/>
+ <attribute name="Implementation-Title" value="org.apache.velocity"/>
+ <attribute name="Implementation-Vendor-Id" value="org.apache"/>
+ <attribute name="Implementation-Vendor" value="Apache Software
Foundation"/>
+ <attribute name="Implementation-Version" value="${project.version}"/>
+ </manifest>
+ </jar>
+ <checksum file="${dist.home}/${dvsl.jar}" algorithm="md5" fileext=".md5"/>
+ <checksum file="${dist.home}/${dvsl.jar}" algorithm="sha1"
fileext=".sha1"/>
</target>
<!-- ================================================================== -->
@@ -287,7 +306,7 @@
<target name="docs-init" depends="init-classpath">
<taskdef name="dvsl" classname="org.apache.dvsl.DVSLTask">
<classpath>
- <pathelement location="${dvsl.jar}"/>
+ <pathelement location="${dist.home}/${dvsl.jar}"/>
<path refid="classpath"/>
</classpath>
</taskdef>
@@ -329,7 +348,7 @@
<istrue value="${skip.jar.loading}"/>
<and>
<isfalse value="${force.jar.loading}"/>
- <available
file="${lib.dir}/${download.jarname}-${download.jarversion}.jar"/>
+ <available
file="${lib.home}/${download.jarname}-${download.jarversion}.jar"/>
</and>
</or>
</condition>
@@ -338,13 +357,199 @@
<target name="do-http-download" unless="skip-download">
<setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"/>
- <property name="download.dirname" value="${download.jarname}"/> <!-- if
not set previously -->
- <get
src="${repo.url}/${download.dirname}/jars/${download.jarname}-${download.jarversion}.jar"
- dest="${lib.dir}/${download.jarname}-${download.jarversion}.jar"
+ <property name="download.homename" value="${download.jarname}"/> <!-- if
not set previously -->
+ <get
src="${repo.url}/${download.homename}/jars/${download.jarname}-${download.jarversion}.jar"
+ dest="${lib.home}/${download.jarname}-${download.jarversion}.jar"
usetimestamp="true"
verbose="false"
ignoreerrors="false" />
</target>
+ <!-- ================================================================== -->
+ <!-- R E L E A S E T A R G E T S -->
+ <!-- ================================================================== -->
+
+ <target name="release"
+ depends="release.source,release.binaries,env"
+ description="Creates binary and source distribution files"/>
+
+ <!-- Create source distribution files -->
+ <target name="release.source"
+ depends="clean"
+ description="Cleans everything and creates source distribution
files">
+
+ <mkdir dir="${dist.home}"/>
+ <zip zipfile="${dist.home}/${final.name}-src.zip">
+ <zipfileset dir="${basedir}" prefix="${final.name}-src">
+ <include name="*"/>
+ <include name="examples/**"/>
+ <include name="src/**"/>
+ <include name="docs/**"/>
+ <exclude name="dist"/>
+ <exclude name="lib"/>
+ </zipfileset>
+ </zip>
+ <tar tarfile="${dist.home}/${final.name}-src.tar" longfile="gnu">
+ <tarfileset dir="${basedir}" prefix="${final.name}-src">
+ <include name="*"/>
+ <include name="examples/**"/>
+ <include name="src/**"/>
+ <include name="docs/**"/>
+ <exclude name="dist"/>
+ <exclude name="lib"/>
+ </tarfileset>
+ </tar>
+ <gzip zipfile="${dist.home}/${final.name}-src.tar.gz"
+ src="${dist.home}/${final.name}-src.tar"/>
+
+ <!-- Create checksums for the binary distribution files -->
+ <checksum file="${dist.home}/${final.name}-src.zip" algorithm="md5"
fileext=".md5"/>
+ <checksum file="${dist.home}/${final.name}-src.zip" algorithm="sha1"
fileext=".sha1"/>
+ <checksum file="${dist.home}/${final.name}-src.tar.gz" algorithm="md5"
fileext=".md5"/>
+ <checksum file="${dist.home}/${final.name}-src.tar.gz" algorithm="sha1"
fileext=".sha1"/>
+ </target>
+
+ <!-- Create binary distribution files -->
+ <target name="release.binaries"
+ depends="clean,all,test"
+ description="Builds everything and creates the binary distribution
files">
+
+ <!-- Gather misc docs/files -->
+ <mkdir dir="${release.home}"/>
+ <copy todir="${release.home}" file="${basedir}/LICENSE"/>
+ <copy todir="${release.home}" file="${basedir}/NOTICE"/>
+ <copy todir="${release.home}" file="${basedir}/README.txt"/>
+
+ <!-- Gather all project jars -->
+ <mkdir dir="${release.home}/lib"/>
+ <copy todir="${release.home}/lib">
+ <fileset dir="${dist.home}" includes="*.jar" />
+ </copy>
+
+ <!-- Gather all project dependencies -->
+ <copy todir="${release.home}/lib">
+ <fileset dir="${lib.home}" includes="*.jar"/>
+ </copy>
+
+ <!-- Gather all generated documentation -->
+ <mkdir dir="${release.home}/docs"/>
+ <copy todir="${release.home}/docs">
+ <fileset dir="${docs.dest}">
+ <include name="**" />
+ </fileset>
+ <fileset dir="${build.home}">
+ <include name="javadoc/**" />
+ </fileset>
+ </copy>
+
+ <!-- Create binary distribution files -->
+ <zip zipfile="${dist.home}/${final.name}.zip"
+ basedir="${dist.home}/release"/>
+ <tar tarfile="${dist.home}/${final.name}.tar" longfile="gnu"
+ basedir="${dist.home}/release"/>
+ <gzip zipfile="${dist.home}/${final.name}.tar.gz"
+ src="${dist.home}/${final.name}.tar"/>
+
+ <!-- Create checksums for the binary distribution files -->
+ <checksum file="${dist.home}/${final.name}.zip" algorithm="md5"
fileext=".md5"/>
+ <checksum file="${dist.home}/${final.name}.zip" algorithm="sha1"
fileext=".sha1"/>
+ <checksum file="${dist.home}/${final.name}.tar.gz" algorithm="md5"
fileext=".md5"/>
+ <checksum file="${dist.home}/${final.name}.tar.gz" algorithm="sha1"
fileext=".sha1"/>
+
+ <!-- Delete TAR files and staging dir as they're no longer needed -->
+ <delete>
+ <fileset dir="${dist.home}" includes="*.tar"/>
+ <fileset dir="${dist.home}/release"/>
+ </delete>
+ </target>
+
+ <!-- Environment Target -->
+ <target name="env" description="Prints build parameters">
+ <echo>
+ Global settings:
+ java.home = ${java.home}
+ user.home = ${user.home}
+ java.class.path = ${java.class.path}
+
+ Project settings:
+ Version: ${final.name}
+ Debug: ${compile.debug}
+ Optimize: ${compile.optimize}
+ Deprecation: ${compile.deprecation}
+
+ Build settings:
+ Source Files: ${source.home}
+ Build Files: ${build.home}
+ Distribution Files: ${dist.home}
+ </echo>
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- P U B L I S H H E L P E R S -->
+ <!-- ================================================================== -->
+
+ <target name="publish.check">
+ <condition property="release.signed">
+ <and>
+ <available file="${dist.home}/${final.name}.tar.gz.asc"/>
+ <available file="${dist.home}/${final.name}.zip.asc"/>
+ <available file="${dist.home}/${final.name}-src.tar.gz.asc"/>
+ <available file="${dist.home}/${final.name}-src.zip.asc"/>
+ <available file="${dist.home}/${final.name}.jar.asc"/>
+ </and>
+ </condition>
+ </target>
+
+ <target name="publish.sigs" unless="release.signed"
+ depends="publish.check">
+ <echo>
+ You must first execute "release" target, then sign the distribution
+ files with your pgp key (creating the needed '.asc'signature files).
+ You may also need to add the Jsch jar to Ant's classpath to enable the
+ optional 'scp' task.
+ </echo>
+ </target>
+
+ <target name="publish.user" unless="username">
+ <input message="Type your username and hit enter:" addproperty="username"/>
+ </target>
+
+ <target name="publish.pass" unless="password">
+ <input message="Type your password and hit enter:" addproperty="password"/>
+ </target>
+
+ <target name="publish.auth" if="release.signed"
+ depends="publish.user,publish.pass">
+ <condition property="have.auth">
+ <and>
+ <isset property="username"/>
+ <isset property="password"/>
+ </and>
+ </condition>
+ </target>
+
+ <target name="prepare.publish"
+ depends="publish.sigs,publish.auth">
+ <condition property="ready">
+ <and>
+ <isset property="release.signed"/>
+ <isset property="have.auth"/>
+ </and>
+ </condition>
+ </target>
+
+ <target name="publish" depends="prepare.publish" if="ready"
+ description="Uploads distribution files to the distribution server">
+ <echo>
+ Uploading distribution files from
+ ${dist.home}
+ to
+ ${username}:[EMAIL PROTECTED]:${publish.home}
+ </echo>
+ <scp todir="${username}:[EMAIL PROTECTED]:${publish.home}"
+ verbose="true" failonerror="true" trust="yes">
+ <fileset dir="${dist.home}"/>
+ </scp>
+ </target>
</project>