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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
|
<!--
Copyright (C) 2020 The Project Lombok Authors.
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.mapstructBinding" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus" basedir="..">
<description>
This buildfile is part of projectlombok.org. It builds the mapstruct-lombok binding; we think the
version on mavencentral is the last version that is ever needed; the code itself is trivial and
exists as a separate dependency solely because it is itself dependent on both lombok and mapstruct.
</description>
<target name="-mapstructBinding.compile" depends="-setup.build">
<mkdir dir="build/mapstruct" />
</target>
<target name="-mapstructBinding.prepare" depends="-mapstructBinding.compile">
<mkdir dir="build/mapstruct-module-path" />
<copy file="dist/lombok.jar" todir="build/mapstruct-module-path" />
<jar destfile="build/mapstruct-module-path/mapstruct-processor.jar" basedir="build/mapstruct" includes="org/**">
<manifest>
<attribute name="Automatic-Module-Name" value="org.mapstruct.processor" />
</manifest>
</jar>
<mkdir dir="build/mapstruct-binding/maven" />
<copy tofile="build/mapstruct-binding/maven/pom.xml" overwrite="true" file="doc/mapstruct-binding-maven-pom.xml">
<filterchain>
<replacetokens>
<token key="VERSION" value="${mapstruct-binding.version}" />
</replacetokens>
</filterchain>
</copy>
</target>
<target name="-mapstructBinding.doc" depends="-mapstructBinding.prepare">
<mkdir dir="build/mapstruct-binding/api" />
<javadoc
Package="true"
packagenames="lombok.*"
sourcepath="src/bindings/mapstruct"
classpath="build/mapstruct"
defaultexcludes="yes"
destdir="build/mapstruct-binding/api"
windowtitle="Lombok Mapstruct Binding"
source="1.8" />
<!-- bugfix for boneheaded javadoc bug where ?is-external=true is inserted before an anchor ref, breaking the anchor ref.
is-external=true doesn't actually do anything, so, we'll just get rid of it. -->
<replaceregexp match="\?is-external=true#" replace="#" flags="gi">
<fileset dir="build/mapstruct-binding/api" includes="**/*.html" />
</replaceregexp>
<jar destfile="dist/lombok-mapstruct-binding-${mapstruct-binding.version}-javadoc.jar" basedir="build/mapstruct-binding/api" includes="**" />
</target>
<target name="-mapstructBinding.jar" depends="dist, -mapstructBinding.prepare">
<mkdir dir="build/mapstruct-binding/classes" />
<echo file="build/mapstruct-binding/classes/META-INF/services/org.mapstruct.ap.spi.AstModifyingAnnotationProcessor">lombok.mapstruct.NotifierHider$AstModificationNotifier</echo>
<javac includeAntRuntime="false" source="1.8" target="1.8" destdir="build/mapstruct-binding/classes">
<src path="src/bindings/mapstruct" />
<exclude name="module-info.java" />
<classpath location="build/mapstruct" />
</javac>
<javac includeAntRuntime="false" source="1.9" target="1.9" destdir="build/mapstruct-binding/classes" modulepath="build/mapstruct-module-path">
<src path="src/bindings/mapstruct" />
<include name="module-info.java" />
</javac>
<jar destfile="dist/lombok-mapstruct-binding-${mapstruct-binding.version}.jar" basedir="build/mapstruct-binding/classes" includes="**" />
</target>
<target name="-mapstructBinding.src" depends="-mapstructBinding.jar">
<jar destfile="dist/lombok-mapstruct-binding-${mapstruct-binding.version}-sources.jar" basedir="src/bindings/mapstruct" includes="**" />
</target>
<target name="mapstructBinding.pack" depends="dist,-mapstructBinding.jar,-mapstructBinding.doc,-mapstructBinding.src">
</target>
<target name="mapstructBinding.publish" depends="mapstructBinding.pack">
<tar destfile="dist/mavenPublish-mapstructBinding.tar.bz2" compression="bzip2">
<tarfileset dir="dist">
<include name="lombok-mapstruct-binding-${mapstruct-binding.version}.jar" />
<include name="lombok-mapstruct-binding-${mapstruct-binding.version}-sources.jar" />
<include name="lombok-mapstruct-binding-${mapstruct-binding.version}-javadoc.jar" />
</tarfileset>
<tarfileset dir="build/mapstruct-binding/maven" includes="pom.xml" />
</tar>
<ivy:scpUpload
from="dist/mavenPublish-mapstructBinding.tar.bz2"
to="/data/lombok/staging"
server="projectlombok.org"
username="${ssh.username}"
keyfile="${ssh.keyfile}"
knownHosts="ssh.knownHosts" />
<ivy:sshExec
cmd="/data/lombok/stagingCmd/publishToMavenCentral-mapstructBinding"
server="projectlombok.org"
username="${ssh.username}"
keyfile="${ssh.keyfile}"
knownHosts="ssh.knownHosts" />
<echo>The artifact has been published to staging. Now go to https://oss.sonatype.org/ and log in as Reinier, then doublecheck if all is well and 'release' it.</echo>
<ivy:sshExec
cmd="/data/lombok/stagingCmd/showMavenCentralPassword"
server="projectlombok.org"
username="${ssh.username}"
keyfile="${ssh.keyfile}"
knownHosts="ssh.knownHosts" />
</target>
<target name="mapstructBinding.maven" depends="mapstructBinding.pack" description="Create a maven repo for mapstruct binding into a build dir.">
<delete quiet="true" dir="build/mapstruct-binding-maven" />
<mkdir dir="build/mapstruct-binding-maven" />
<condition property="exe.mvn.base" value="mvn.cmd" else="mvn">
<os family="windows" />
</condition>
<condition property="exe.mvn" value="${env.MAVEN_HOME}/bin/${exe.mvn.base}" else="${exe.mvn.base}">
<isset property="env.MAVEN_HOME" />
</condition>
<local name="mvn.result" />
<exec executable="${exe.mvn}" failifexecutionfails="false" resultproperty="mvn.result">
<arg value="deploy:deploy-file" />
<arg value="-Dfile=dist/lombok-mapstruct-binding-${mapstruct-binding.version}.jar" />
<arg value="-Dsources=dist/lombok-mapstruct-binding-${mapstruct-binding.version}-sources.jar" />
<arg value="-Djavadoc=dist/lombok-mapstruct-binding-${mapstruct-binding.version}-javadoc.jar" />
<arg value="-DgroupId=org.projectlombok" />
<arg value="-DartifactId=lombok-mapstruct-binding" />
<arg value="-Dversion=${mapstruct-binding.version}" />
<arg value="-DpomFile=build/mapstruct-binding/maven/pom.xml" />
<arg value="-Durl=file://${basedir}/build/mapstruct-binding-maven" />
</exec>
<fail>
mvn is not on your path and/or MAVEN_HOME is not set. Add mvn to your path or set MAVEN_HOME to continue.
<condition>
<not><isset property="mvn.result" /></not>
</condition>
</fail>
</target>
</project>
|