diff options
Diffstat (limited to 'buildScripts/maven.ant.xml')
-rw-r--r-- | buildScripts/maven.ant.xml | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/buildScripts/maven.ant.xml b/buildScripts/maven.ant.xml new file mode 100644 index 00000000..783303f2 --- /dev/null +++ b/buildScripts/maven.ant.xml @@ -0,0 +1,111 @@ +<!-- + Copyright © 2009 Reinier Zwitserloot and Roel Spilker. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +--> +<project name="lombok-maven" basedir=".." default="maven"> + <description>This buildfile is part of projectlombok.org. It is responsible for creating and maintaining +the maven repository that contains lombok's deliverables for those using maven.</description> + <target name="version" unless="lombok.version"> + <ant antfile="build.xml" target="version" inheritAll="false" /> + <loadresource property="lombok.version"> + <file file="build/version.txt" /> + <filterchain> + <striplinebreaks /> + </filterchain> + </loadresource> + </target> + + <target name="dist" unless="lombok.dist.built" depends="version"> + <ant antfile="buildScripts/compile.xml" target="dist" inheritAll="false"> + <property name="lombok.version" value="${lombok.version}" /> + </ant> + </target> + + <target name="maven" depends="version, dist" description="Build a maven repository."> + <loadresource property="mvn.oldversions"> + <url url="http://projectlombok.org/mavenrepo/org/projectlombok/lombok/maven-metadata.xml" /> + <filterchain> + <linecontains><contains value="/version>" /></linecontains> + <headfilter lines="-1" skip="1" /> + </filterchain> + </loadresource> + <mkdir dir="build" /> + <echo file="build/version.tagged.tmp"><version>${lombok.version}</version></echo> + <loadfile srcFile="build/version.tagged.tmp" property="lombok.version.tagged" /> + <delete file="build/version.tagged.tmp" /> + <fail message="You already created a maven target for this version. You'll have to update the version to something new!"> + <condition> + <contains string="${mvn.oldversions}" substring="${lombok.version.tagged}" /> + </condition> + </fail> + + <delete dir="build/maven" quiet="true" /> + <property name="mvn.dir" value="build/maven/org/projectlombok/lombok" /> + <property name="mvn.bin" value="${mvn.dir}/${lombok.version}" /> + <property name="mvn.pom" value="${mvn.bin}/lombok-${lombok.version}.pom" /> + <mkdir dir="${mvn.bin}" /> + <tstamp> + <format property="now.millis" pattern="yyyyMMddHHmmss" timezone="UTC" /> + </tstamp> + <copy todir="${mvn.bin}" file="dist/lombok-${lombok.version}.jar" /> + <checksum property="mvn.bin.md5" file="${mvn.bin}/lombok-${lombok.version}.jar" algorithm="MD5" /> + <checksum property="mvn.bin.sha1" file="${mvn.bin}/lombok-${lombok.version}.jar" algorithm="SHA1" /> + <echo file="${mvn.bin}/lombok-${lombok.version}.jar.md5">${mvn.bin.md5}</echo> + <echo file="${mvn.bin}/lombok-${lombok.version}.jar.sha1">${mvn.bin.sha1}</echo> + <jar destfile="${mvn.bin}/lombok-${lombok.version}-sources.jar" basedir="src" excludes="**/.DS_Store" /> + <checksum property="mvn.src.md5" file="${mvn.bin}/lombok-${lombok.version}-sources.jar" algorithm="MD5" /> + <checksum property="mvn.src.sha1" file="${mvn.bin}/lombok-${lombok.version}-sources.jar" algorithm="SHA1" /> + <echo file="${mvn.bin}/lombok-${lombok.version}-sources.jar.md5">${mvn.src.md5}</echo> + <echo file="${mvn.bin}/lombok-${lombok.version}-sources.jar.sha1">${mvn.src.sha1}</echo> + <copy tofile="${mvn.pom}" file="doc/maven-pom.xml"> + <filterchain> + <replacetokens> + <token key="VERSION" value="${lombok.version}" /> + </replacetokens> + </filterchain> + </copy> + <checksum property="mvn.pom.md5" file="${mvn.pom}" algorithm="MD5" /> + <checksum property="mvn.pom.sha1" file="${mvn.pom}" algorithm="SHA1" /> + <echo file="${mvn.pom}.md5">${mvn.pom.md5}</echo> + <echo file="${mvn.pom}.sha1">${mvn.pom.sha1}</echo> + <echo file="${mvn.dir}/maven-metadata.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?> +<metadata> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + <version>${lombok.version}</version> + <versioning> + <versions> + <version>${lombok.version}</version> + ${mvn.oldversions} + </versions> + <lastUpdated>${now.millis}</lastUpdated> + </versioning> +</metadata> +]]></echo> + <checksum property="mvn.manifest.md5" file="${mvn.dir}/maven-metadata.xml" algorithm="MD5" /> + <checksum property="mvn.manifest.sha1" file="${mvn.dir}/maven-metadata.xml" algorithm="SHA1" /> + <echo file="${mvn.dir}/maven-metadata.xml.md5">${mvn.manifest.md5}</echo> + <echo file="${mvn.dir}/maven-metadata.xml.sha1">${mvn.manifest.sha1}</echo> + <tar destfile="dist/maven.tar.bz2" compression="bzip2"> + <tarfileset dir="build/maven" /> + </tar> + <echo>Now copy maven.tar.bz2 to the website and unpack it in the mavenrepo directory. Let it overwrite files.</echo> + </target> +</project> |