You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@excalibur.apache.org by do...@apache.org on 2004/07/02 04:53:48 UTC

svn commit: rev 22443 - excalibur/trunk/buildsystem

Author: donaldp
Date: Thu Jul  1 19:53:47 2004
New Revision: 22443

Added:
   excalibur/trunk/buildsystem/maven.xml   (contents, props changed)
Log:
Add in maven script to help release process


Added: excalibur/trunk/buildsystem/maven.xml
==============================================================================
--- (empty file)
+++ excalibur/trunk/buildsystem/maven.xml	Thu Jul  1 19:53:47 2004
@@ -0,0 +1,119 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2004 The Apache Software Foundation
+ Licensed  under the  Apache License,  Version 2.0  (the "License");
+ you may not use  this file  except in  compliance with the License.
+ You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed  under the  License is distributed on an "AS IS" BASIS,
+ WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+ implied.
+
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project default="java:jar" xmlns:excalibur="excalibur" xmlns:deploy="deploy" xmlns:artifact="artifact" xmlns:maven="jelly:maven" xmlns:define="jelly:define" xmlns:j="jelly:core" xmlns:ant="jelly:ant">
+
+    <define:taglib uri="excalibur">
+        <!--
+         @name the name of file to deploy (assumed to be in the distributions dir)
+         @type the maven "type"
+        -->
+        <define:tag name="deploy">
+            <j:set var="pass" value='-i "${maven.repo.default.privatekey}"'/>
+            <j:set var="acct" value="${maven.repo.default.username}@${maven.repo.default.host}"/>
+            <j:set var="deployDir" value="${maven.repo.default.directory}/${pom.groupId}/${type}s"/>
+            <j:set var="grp" value="${maven.repo.default.group}"/>
+
+            <ant:exec dir="${maven.dist.dir}" executable="scp" failonerror="true">
+                <ant:arg line="${pass} ${name} ${acct}:${deployDir}"/>
+            </ant:exec>
+            <ant:exec dir="${maven.dist.dir}" executable="ssh" failonerror="true">
+                <ant:arg line="${pass} ${acct} 'chgrp -R ${grp} ${deployDir};chmod -R a+r ${deployDir}'"/>
+            </ant:exec>
+	    </define:tag>
+
+        <!--
+         @name the name of file to gpg (assumed to be in the distributions dir)
+        -->
+        <define:tag name="gpg">
+            <ant:exec dir="${maven.dist.dir}" executable="gpg" failonerror="true">
+                <ant:arg line="-v --output ${name}.asc --detach-sig --armor ${name}"/>
+            </ant:exec>
+        </define:tag>
+    </define:taglib>
+
+    <goal name="excalibur:tagRelease">
+        <j:set var="repoBase" value="https://svn.apache.org/repos/asf/excalibur"/>
+        <j:set var="tagName" value="${pom.artifactId}-${pom.currentVersion}-Release"/>
+        <j:set var="tagMsg" value="Tagging release of ${pom.artifactId} version ${pom.currentVersion}"/>
+        <ant:exec dir="${maven.build.dir}" executable="svn" failonerror="true">
+            <ant:arg line="copy -m &quot;${tagMsg}&quot; ${repoBase}/trunk ${repoBase}/tags/${tagName}"/>
+        </ant:exec>
+    </goal>
+
+    <postGoal name="dist:build-src">
+        <excalibur:gpg name="${pom.artifactId}-${pom.currentVersion}-src.zip"/>
+        <excalibur:gpg name="${pom.artifactId}-${pom.currentVersion}-src.tar.gz"/>
+    </postGoal>
+
+    <postGoal name="dist:build-bin">
+        <excalibur:gpg name="${pom.artifactId}-${pom.currentVersion}.zip"/>
+        <excalibur:gpg name="${pom.artifactId}-${pom.currentVersion}.tar.gz"/>
+    </postGoal>
+
+    <postGoal name="dist:deploy-src">
+        <excalibur:deploy name="${pom.artifactId}-${pom.currentVersion}-src.zip.asc"
+            type="distribution"/>
+        <excalibur:deploy name="${pom.artifactId}-${pom.currentVersion}-src.tar.gz.asc"
+            type="distribution"/>
+    </postGoal>
+
+    <postGoal name="dist:deploy-bin">
+        <excalibur:deploy name="${pom.artifactId}-${pom.currentVersion}.zip.asc"
+            type="distribution"/>
+        <excalibur:deploy name="${pom.artifactId}-${pom.currentVersion}.tar.gz.asc"
+            type="distribution"/>
+    </postGoal>
+
+    <goal name="excalibur:deploy">
+        <maven:user-check user="${maven.username}"/>
+
+        <j:if test='${pom.getContext().getVariable("maven.privatekey") == null}'>
+            <ant:fail>
+                User must specify -Dmaven.privatekey=X
+            </ant:fail>
+        </j:if>
+
+        <j:set var="user" value="${maven.username}"/>
+        <j:set var="key" value="${maven.privatekey}"/>
+        <j:set var="host" value="minotaur.apache.org"/>
+        <j:set var="url" value="scp://${host}"/>
+
+        <j:set var="version" value="${pom.currentVersion}"/>
+        <j:set var="isRC" value="${version.indexOf('RC') != '-1'}"/>
+
+        <j:if test="${isRC == true}">
+            <j:set var="deployBase" value="/home/${user}/public_html/dist"/>
+        </j:if>
+        <j:if test="${isRC == false}">
+            <j:set var="deployBase" value="/www/www.apache.org/dist"/>
+        </j:if>
+
+        ${pom.getContext().setVariable("maven.repo.list", "default")}
+        ${pom.getContext().setVariable("maven.repo.default", url )}
+        ${pom.getContext().setVariable("maven.repo.default.host", host)}
+        ${pom.getContext().setVariable("maven.repo.default.directory", deployBase)}
+        ${pom.getContext().setVariable("maven.repo.default.group", "excalibur")}
+        ${pom.getContext().setVariable("maven.repo.default.username", user)}
+        ${pom.getContext().setVariable("maven.repo.default.privatekey", key)}
+
+        <attainGoal name="dist:deploy"/>
+    </goal>
+    
+    <goal name="excalibur:release" prereqs="excalibur:deploy,excalibur:tagRelease"/>
+
+</project>

---------------------------------------------------------------------
To unsubscribe, e-mail: scm-unsubscribe@excalibur.apache.org
For additional commands, e-mail: scm-help@excalibur.apache.org