Changeset 9a91443 for build.xml


Ignore:
Timestamp:
Jun 13, 2016 6:02:48 AM (4 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
47f0bbb
Parents:
249e6f0
Message:

Add build target for Maven Central

Requires the Maven Ant Tasks to be installed. On Debian:

sudo apt-get install libmaven-ant-tasks-java

File:
1 edited

Legend:

Unmodified
Added
Removed
  • build.xml

    r249e6f0 r9a91443  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    2 <project basedir="." default="all" name="i2p">
     2<project basedir="." default="all" name="i2p"
     3    xmlns:artifact="antlib:org.apache.maven.artifact.ant">
    34
    45    <!-- Include property files so that values can be easily overridden.
     
    9394                <fileset dir="${basedir}">
    9495                    <include name="@{file} @{file}.sig" />
     96                </fileset>
     97            </chmod>
     98        </sequential>
     99    </macrodef>
     100
     101    <macrodef name="gpgsignasc">
     102        <attribute name="file" />
     103        <sequential>
     104            <delete file="@{file}.asc" quiet="true" />
     105            <exec executable="gpg" failonerror="true">
     106                <arg value="--default-key" />
     107                <arg value="${release.gpg.keyid}" />
     108                <arg value="-ab" />
     109                <arg value="@{file}" />
     110            </exec>
     111            <chmod type="file" perm="444">
     112                <fileset dir="${basedir}">
     113                    <include name="@{file} @{file}.asc" />
    95114                </fileset>
    96115            </chmod>
     
    944963        <delete file="i2p.fba" />
    945964        <delete file="${sloccount.report.file}" />
     965        <delete file="mavencentral-i2p.jar" />
     966        <delete file="mavencentral-mstreaming.jar" />
     967        <delete file="mavencentral-streaming.jar" />
    946968    </target>
    947969
     
    13441366    <target name="deletepkg-temp">
    13451367        <delete dir="pkg-temp" />
     1368        <delete dir="./pkg-mavencentral" />
    13461369    </target>
    13471370
     
    19651988        <echo message="Don't forget to mtn tag w: i2p-${release.number}" />
    19661989        <echo message="... and mtn cert t:i2p-${release.number} branch i2p.i2p.release" />
     1990    </target>
     1991
     1992    <target name="mavenCentral.deps" depends="buildStreaming">
     1993        <ant dir="core/java/" target="javadocJar" />
     1994        <ant dir="core/java/" target="sourcesJar" />
     1995        <ant dir="apps/ministreaming/java/" target="javadocJar" />
     1996        <ant dir="apps/ministreaming/java/" target="sourcesJar" />
     1997        <ant dir="apps/streaming/java/" target="javadocJar" />
     1998        <ant dir="apps/streaming/java/" target="sourcesJar" />
     1999    </target>
     2000
     2001    <target name="mavenCentral" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, mavenCentral.deps">
     2002        <mkdir dir="./pkg-mavencentral" />
     2003        <!-- Libraries -->
     2004        <copy file="build/i2p.jar" tofile="pkg-mavencentral/i2p-${release.number}.jar" />
     2005        <copy file="build/mstreaming.jar" tofile="pkg-mavencentral/mstreaming-${release.number}.jar" />
     2006        <copy file="build/streaming.jar" tofile="pkg-mavencentral/streaming-${release.number}.jar" />
     2007        <!-- JavaDocs -->
     2008        <copy file="core/java/build/i2p-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
     2009        <copy file="apps/ministreaming/java/build/mstreaming-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
     2010        <copy file="apps/streaming/java/build/streaming-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
     2011        <!-- Sources -->
     2012        <copy file="core/java/build/i2p-${release.number}-sources.jar" todir="pkg-mavencentral/" />
     2013        <copy file="apps/ministreaming/java/build/mstreaming-${release.number}-sources.jar" todir="pkg-mavencentral/" />
     2014        <copy file="apps/streaming/java/build/streaming-${release.number}-sources.jar" todir="pkg-mavencentral/" />
     2015        <!-- POMs -->
     2016        <artifact:pom id="i2ppom" groupId="net.i2p" artifactId="i2p" version="${release.number}"
     2017                name="I2P Core"
     2018                description="The core I2P APIs"
     2019                url="https://geti2p.net/">
     2020            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
     2021            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
     2022            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/"/>
     2023            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
     2024                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
     2025                 url="git@github.com:i2p/i2p.i2p.git" />
     2026        </artifact:pom>
     2027        <artifact:pom id="mstreamingpom" groupId="net.i2p.client" artifactId="mstreaming" version="${release.number}"
     2028                name="I2P Ministreaming"
     2029                description="API, interfaces, and factory for a TCP-like set of sockets for communicating over I2P."
     2030                url="https://geti2p.net/en/docs/api/streaming">
     2031            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
     2032            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
     2033            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
     2034            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
     2035                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
     2036                 url="git@github.com:i2p/i2p.i2p.git" />
     2037            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
     2038        </artifact:pom>
     2039        <artifact:pom id="streamingpom" groupId="net.i2p.client" artifactId="streaming" version="${release.number}"
     2040                name="I2P Streaming"
     2041                description="Implementation of a TCP-like set of sockets for communicating over I2P."
     2042                url="https://geti2p.net/en/docs/api/streaming">
     2043            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
     2044            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
     2045            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
     2046            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
     2047                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
     2048                 url="git@github.com:i2p/i2p.i2p.git" />
     2049            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
     2050            <dependency groupId="net.i2p.client" artifactId="mstreaming" version="${release.number}" />
     2051        </artifact:pom>
     2052        <artifact:writepom pomRefId="i2ppom" file="pkg-mavencentral/i2p-${release.number}.pom"/>
     2053        <artifact:writepom pomRefId="mstreamingpom" file="pkg-mavencentral/mstreaming-${release.number}.pom" />
     2054        <artifact:writepom pomRefId="streamingpom" file="pkg-mavencentral/streaming-${release.number}.pom" />
     2055        <!-- Signatures -->
     2056        <echo message="Sign the files:" />
     2057        <input message="Enter GPG key ID (e.g. 0x12345678) for signing:" addproperty="release.gpg.keyid" />
     2058        <fail message="You must enter a key ID." >
     2059            <condition>
     2060                <equals arg1="${release.gpg.keyid}" arg2=""/>
     2061            </condition>
     2062        </fail>
     2063        <!-- the gpgsign macro sets the permission of signed files and the sigs themselves to 444 -->
     2064        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}.jar" />
     2065        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}.pom" />
     2066        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}-javadoc.jar" />
     2067        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}-sources.jar" />
     2068        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}.jar" />
     2069        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}.pom" />
     2070        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}-javadoc.jar" />
     2071        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}-sources.jar" />
     2072        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}.jar" />
     2073        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}.pom" />
     2074        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}-javadoc.jar" />
     2075        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}-sources.jar" />
     2076        <!-- Bundle -->
     2077        <jar destfile="mavencentral-i2p.jar">
     2078            <fileset dir="./pkg-mavencentral">
     2079                <include name="i2p-*" />
     2080            </fileset>
     2081        </jar>
     2082        <jar destfile="mavencentral-mstreaming.jar">
     2083            <fileset dir="./pkg-mavencentral">
     2084                <include name="mstreaming-*" />
     2085            </fileset>
     2086        </jar>
     2087        <jar destfile="mavencentral-streaming.jar">
     2088            <fileset dir="./pkg-mavencentral">
     2089                <include name="streaming-*" />
     2090            </fileset>
     2091        </jar>
     2092        <echo message="Now upload mavencentral-*.jar to Maven Central." />
    19672093    </target>
    19682094
Note: See TracChangeset for help on using the changeset viewer.