Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 55 lines (50 sloc) 1.934 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
<project>
   <macrodef name="gpg">
      <attribute name="todir" />
      <attribute name="file" />
      <sequential>
         <exec executable="gpg" dir="@{todir}">
            <arg line="-ab @{file}" />
         </exec>
      </sequential>
   </macrodef>
   
   <macrodef name="sonatype-bundle">
      <attribute name="dir" />
      <attribute name="todir" />
      <attribute name="pomTemplate" />
      <attribute name="artifact" />
      <attribute name="type" />
      <attribute name="name" />
      <attribute name="version" />
      <attribute name="description" />
      <element name="includes" />
      
      <sequential>
         <taskdef resource="net/sf/antcontrib/antlib.xml"/>
            
         <!-- Create POM from template -->
         <copy file="@{pomTemplate}" tofile="@{todir}/pom.xml" />
         <replace file="@{todir}/pom.xml">
            <replacefilter token="@ARTIFACT@" value="@{artifact}" />
            <replacefilter token="@TYPE@" value="@{type}" />
            <replacefilter token="@NAME@" value="@{name}" />
            <replacefilter token="@VERSION@" value="@{version}" />
            <replacefilter token="@DESCRIPTION@" value="@{description}" />
         </replace>
      
         <!-- Sign all files using GPG, assumes GPG is installed and configured -->
         <for param="fileToSign">
            <fileset dir="@{todir}">
               <includes />
            </fileset>
            <sequential>
               <gpg todir="@{todir}" file="@{fileToSign}" />
            </sequential>
         </for>
      
         <!-- Zip into bundle for manual upload -->
         <zip destfile="@{todir}/sonatype-@{artifact}-@{version}.zip">
            <zipfileset dir="@{todir}">
               <includes />
               <include name="*.asc" />
            </zipfileset>
         </zip>
      </sequential>
   </macrodef>
</project>
Something went wrong with that request. Please try again.