diff options
author | Roel Spilker <r.spilker@gmail.com> | 2018-08-27 22:51:02 +0200 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2018-08-27 22:51:02 +0200 |
commit | 29db6335e6f6dd01377465cb85c737e1bad21a20 (patch) | |
tree | a9a62a2d1bf12f32be88ebdaf26f5ee61fafc238 | |
parent | f6859079045393344613de61e424316fc218241c (diff) | |
download | lombok-29db6335e6f6dd01377465cb85c737e1bad21a20.tar.gz lombok-29db6335e6f6dd01377465cb85c737e1bad21a20.tar.bz2 lombok-29db6335e6f6dd01377465cb85c737e1bad21a20.zip |
Make ant install-maven also work without having to set MAVEN_HOME
-rw-r--r-- | build.xml | 25 |
1 files changed, 12 insertions, 13 deletions
@@ -34,10 +34,6 @@ the common tasks and can be called on to run the main aspects of all the sub-scr <available file="${rt-openjdk8}" property="rt-openjdk8.available" /> <property environment="env"/> - <condition property="isWindows"> - <os family="windows" /> - </condition> - <path id="build.path"> <fileset dir="lib/build"> <include name="*.jar" /> @@ -372,17 +368,16 @@ lombok.launch.AnnotationProcessorHider$ClaimingProcessor,isolating</echo> <property name="lombok.dist.built" value="true" /> </target> - <target name="-mvn-ext-win" if="isWindows"> - <property name="mvn-ext" value=".cmd" /> - </target> - <target name="-mvn-ext-not-win" unless="isWindows"> - <property name="mvn-ext" value="" /> + <target name="-mvn-ext"> + <condition property="mvn-ext" value=".cmd" else=""> + <os family="windows" /> + </condition> </target> - <target name="-mvn-ext" depends="-mvn-ext-win,-mvn-ext-not-win" /> <target name="install-maven" depends="version,dist,-mvn-ext" description="Install THE lombok.jar into the local maven repository using Apache Maven"> - <fail unless="env.MAVEN_HOME" message="MAVEN_HOME environment variable must be set. "/> - <echo message="MAVEN_HOME: ${env.MAVEN_HOME}" /> + <condition property="mvn-exe" value="${env.MAVEN_HOME}/bin/mvn${mvn-ext}" else="mvn${mvn-ext}"> + <isset property="env.MAVEN_HOME" /> + </condition> <echo message="Lombok version: ${lombok.version}-SNAPSHOT" /> <echo file="pom.xml"><![CDATA[<project> @@ -392,7 +387,7 @@ lombok.launch.AnnotationProcessorHider$ClaimingProcessor,isolating</echo> <version>]]>${lombok.version}-SNAPSHOT<![CDATA[</version> </project>]]></echo> - <exec executable="${env.MAVEN_HOME}/bin/mvn${mvn-ext}"> + <exec executable="${mvn-exe}" failifexecutionfails="false" resultproperty="mvn-result"> <arg value="install:install-file"/> <arg value="-Dfile=dist/lombok-${lombok.version}.jar"/> <arg value="-DgroupId=org.projectlombok"/> @@ -401,6 +396,10 @@ lombok.launch.AnnotationProcessorHider$ClaimingProcessor,isolating</echo> <arg value="-Dpackaging=jar"/> </exec> <delete file="pom.xml" quiet="true" /> + <condition property="mvn-notfound" value="true"> + <not><isset property="mvn-result" /></not> + </condition> + <fail message="mvn is not on your path and/or MAVEN_HOME is not set. Add mvn to your path or set MAVEN_HOME to continue." if="mvn-notfound" /> </target> <target name="dist-utils" description="Builds lombok-utils.jar, which is a library used by i.e. lombok.ast project." depends="version, compile"> |