| <?xml version="1.0" encoding="UTF-8"?> |
| |
| <!-- |
| Ant build script for Groovy. |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in |
| compliance with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software distributed under the License is |
| distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| implied. See the License for the specific language governing permissions and limitations under the License. |
| |
| This work is copyright by the author(s) and is part of a greater work collectively copyright by Codehaus on |
| behalf of the Groovy community. See the NOTICE.txt file distributed with this work for additional information. |
| |
| Author : Russel Winder |
| Author : Paul King |
| $Revision$ ($LastChangedBy$) |
| $Date$ |
| --> |
| |
| <project name="Groovy" default="createJars" basedir="."> |
| |
| <property file="local.build.properties"/> |
| <property file="build.properties"/> |
| <property name="ant.requiredVersion" value="1.7"/> |
| |
| <!-- config/ant/build-maven.xml imports config/ant/build-setup.xml where all the paths are defined. --> |
| <import file="config/ant/build-maven.xml"/> |
| <import file="config/ant/build-checkstyle.xml"/> |
| <import file="config/ant/build-cobertura.xml"/> |
| |
| <condition property="_skipTests_"> |
| <or> |
| <equals arg1="${test}" arg2="false"/> |
| <istrue value="${skipTests}"/> |
| </or> |
| </condition> |
| |
| <condition property="_skipExamples_"> |
| <istrue value="${skipExamples}"/> |
| </condition> |
| |
| <target name="-initCoverage"> |
| <condition property="_forceCoverage_"> |
| <and> |
| <not> |
| <istrue value="${skipTests}"/> |
| </not> |
| <istrue value="${forceCoverage}"/> |
| </and> |
| </condition> |
| </target> |
| |
| <target name="ensureGrammars" description="Ensure all the Antlr generated files are up to date."> |
| <mkdir dir="${groovyParserDirectory}"/> |
| <antlr target="${antlrDirectory}/groovy.g" outputdirectory="${groovyParserDirectory}"> |
| <classpath refid="compilePath"/> |
| </antlr> |
| <antlr target="${javaParserDirectory}/java.g" outputdirectory="${javaParserDirectory}"> |
| <classpath refid="compilePath"/> |
| </antlr> |
| </target> |
| |
| <target name="-init" depends="-fetchDependencies"> |
| <echo message="Java Runtime Environment version: ${java.version}"/> |
| <echo message="Java Runtime Environment vendor: ${java.vendor}"/> |
| <echo message="Operating system name: ${os.name}"/> |
| <echo message="Operating system architecture: ${os.arch}"/> |
| <echo message="Operating system version: ${os.version}"/> |
| </target> |
| |
| <target name="-checkAntVersion" depends="-excludeLegacyAntVersion,-ensureRequiredAntVersion" |
| description="Check that we are running on the required version of Ant."/> |
| |
| <target name="-excludeLegacyAntVersion"> |
| <!-- antversion didn't exist in early versions of ant so we have |
| a legacy check to provide a nicer error message in this case --> |
| <fail message="You are using ant ${ant.version}, please install using ant ${ant.requiredVersion}+"> |
| <condition> |
| <or> |
| <contains string="${ant.version}" substring="1.1"></contains> |
| <contains string="${ant.version}" substring="1.2"></contains> |
| <contains string="${ant.version}" substring="1.3"></contains> |
| <contains string="${ant.version}" substring="1.4"></contains> |
| <contains string="${ant.version}" substring="1.5"></contains> |
| <contains string="${ant.version}" substring="1.6"></contains> |
| </or> |
| </condition> |
| </fail> |
| </target> |
| |
| <target name="-ensureRequiredAntVersion"> |
| <fail message="You are using ant ${ant.version}, please install using ant ${ant.requiredVersion}+"> |
| <condition><not><antversion atleast="${ant.requiredVersion}"/></not></condition> |
| </fail> |
| </target> |
| |
| <target name="compileMain" depends="ubercompile,stagedcompile" |
| description="Compile the Java and Groovy code in the main source."> |
| </target> |
| |
| <target name="stagedcompile" depends="-init,-includeResources,ensureGrammars" unless="uber"> |
| <mkdir dir="${mainClassesDirectory}"/> |
| <mkdir dir="${toolsClassesDirectory}"/> |
| <javac srcdir="${mainSourceDirectory}" includeantruntime="false" destdir="${mainClassesDirectory}" |
| deprecation="on" debug="yes" source="1.4" target="1.4" fork="true" classpathref="compilePath"/> |
| |
| <!-- |
| |
| There seems to be a problem using the groovyc task directly. If we use it directly as below then there |
| is an NoClassDefFoundError for class org/objectweb/asm/Opcodes. If however we run a separate java task |
| to run the groovyc task then everything works as it should. |
| |
| <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpath="${mainClassesDirectory}"/> |
| <groovyc srcdir="${mainSourceDirectory}" destdir="${mainClassesDirectory}" classpathref="groovyMainCompileDependencies"/> |
| |
| --> |
| |
| <echo message="Groovyc of main code."/> |
| <java classname="org.codehaus.groovy.ant.Groovyc" failonerror="true"> |
| <classpath> |
| <pathelement path="${mainClassesDirectory}"/> |
| <path refid="compilePath"/> |
| </classpath> |
| <arg value="${mainClassesDirectory}"/> |
| <arg value="${mainSourceDirectory}"/> |
| </java> |
| </target> |
| |
| <target name="ubercompile:bootstrap" depends="-init,-includeResources,ensureGrammars" if="uber"> |
| <mkdir dir="${mainClassesDirectory}"/> |
| |
| <javac destdir="${mainClassesDirectory}" |
| deprecation="on" |
| debug="yes" |
| source="1.4" |
| target="1.4" |
| fork="true" |
| includeantruntime="false"> |
| <classpath refid="compilePath"/> |
| <src location="${mainSourceDirectory}"/> |
| |
| <!-- |
| NOTE: This list includes *most* of the classes which are required for the ubercompile |
| bits to work, adding them here to allow for more incremental compilation when |
| required support classes change. |
| --> |
| |
| <include name="groovy/lang/**/*.java"/> |
| <include name="org/codehaus/groovy/ant/**/*.java"/> |
| <include name="org/codehaus/groovy/antlr/**/*.java"/> |
| <include name="org/codehaus/groovy/ast/**/*.java"/> |
| <include name="org/codehaus/groovy/classgen/**/*.java"/> |
| <include name="org/codehaus/groovy/control/**/*.java"/> |
| <include name="org/codehaus/groovy/reflection/**/*.java"/> |
| <include name="org/codehaus/groovy/runtime/**/*.java"/> |
| <include name="org/codehaus/groovy/syntax/**/*.java"/> |
| <include name="org/codehaus/groovy/tools/javac/**/*.java"/> |
| </javac> |
| |
| <taskdef name="ubercompile" classname="org.codehaus.groovy.ant.UberCompileTask"> |
| <classpath> |
| <pathelement location="${mainClassesDirectory}"/> |
| <path refid="compilePath"/> |
| </classpath> |
| </taskdef> |
| </target> |
| |
| <target name="ubercompile" depends="ubercompile:bootstrap" if="uber"> |
| <mkdir dir="${mainStubsDirectory}"/> |
| |
| <ubercompile destdir="${mainClassesDirectory}"> |
| <classpath> |
| <pathelement location="${mainClassesDirectory}"/> |
| <path refid="compilePath"/> |
| </classpath> |
| <src location="${mainSourceDirectory}"/> |
| |
| <generatestubs destdir="${mainStubsDirectory}"> |
| <configuration targetBytecode="1.4"/> |
| </generatestubs> |
| |
| <javac includeantruntime="false" deprecation="on" debug="yes" source="1.4" target="1.4" fork="true"/> |
| <groovyc> |
| <configuration debug="true" verbose="true"/> |
| </groovyc> |
| </ubercompile> |
| </target> |
| |
| <target name="compileTest" depends="compileMain" unless="_skipTests_" |
| description="Compile the Java and Groovy code in the test source."> |
| <mkdir dir="${testClassesDirectory}"/> |
| |
| <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpath="${mainClassesDirectory}" classpathref="testPath"/> |
| <groovyc srcdir="${testSourceDirectory}" destdir="${testClassesDirectory}"> |
| <classpath> |
| <pathelement path="${mainClassesDirectory}"/> |
| <pathelement path="${testClassesDirectory}"/> |
| <path refid="testPath"/> |
| </classpath> |
| <javac source="1.4" target="1.4" fork="true" memorymaximumsize="64m"/> |
| </groovyc> |
| |
| </target> |
| |
| <target name="compileExamples" depends="compileMain" unless="_skipExamples_" |
| description="Compile the Java and Groovy code in the examples source directory."> |
| <mkdir dir="${examplesClassesDirectory}"/> |
| <echo message="Groovyc of example code."/> |
| <java classname="org.codehaus.groovy.ant.Groovyc" fork="true"> |
| <classpath> |
| <pathelement path="${mainClassesDirectory}"/> |
| <pathelement path="${examplesClassesDirectory}"/> |
| <path refid="compilePath"/> |
| <path refid="examplesPath"/> |
| </classpath> |
| <arg value="${examplesClassesDirectory}"/> |
| <arg value="${examplesSourceDirectory}"/> |
| <arg value="-j"/> |
| <arg value="-Jsource=1.4"/> |
| <arg value="-Jtarget=1.4"/> |
| </java> |
| </target> |
| |
| <target name="-initializeReports"> |
| <mkdir dir="${reportsDirectory}"/> |
| </target> |
| |
| <condition property="_shouldBeHeadless_"> |
| <or> |
| <istrue value="${java.awt.headless}"/> |
| <os name="Mac OS X"/> |
| </or> |
| </condition> |
| |
| <target name="-testInit" depends="-initHeadless"> |
| <property name="headlessArg" value=""/> |
| <property name="junitJvmArgs" |
| value="-Xms${groovyJUnit_ms} -XX:PermSize=${groovyJUnit_permSize} -XX:MaxPermSize=${groovyJUnit_maxPermSize} ${headlessArg}"/> |
| </target> |
| |
| <target name="-initHeadless" if="_shouldBeHeadless_"> |
| <property name="headlessArg" value="-Djava.awt.headless=true"/> |
| <echo message="Setting headless mode ..."/> |
| </target> |
| |
| <target name="test" depends="-initializeReports,compileTest,-coverageInstrument,-testInit,-testOne,-testAll" |
| description="Compile and test all the classes (or just one class if testCase property is defined)."/> |
| |
| <target name="clean-test" depends="clean,test" |
| description="Clean and compile and test all the classes (or just one class if testCase property is defined)."/> |
| |
| <condition property="_testOne_"> |
| <and> |
| <not> |
| <istrue value="${_skipTests_}"/> |
| </not> |
| <isset property="testCase"/> |
| </and> |
| </condition> |
| |
| <target name="-testOne" if="_testOne_"> |
| <mkdir dir="${junitRawDirectory}"/> |
| <junit printsummary="true" fork="true" includeantruntime="false" haltonfailure="yes" |
| maxmemory="${groovyJUnit_mx}" dir="${basedir}"> |
| <jvmarg line="${junitJvmArgs}"/> |
| <test name="${testCase}" todir="${junitRawDirectory}"/> |
| <formatter type="brief" usefile="false"/> |
| <classpath> |
| <path refid="testPath"/> |
| <pathelement path="${instrumentedClassesDirectory}"/> |
| <pathelement path="${mainClassesDirectory}"/> |
| <pathelement path="${testClassesDirectory}"/> |
| <pathelement path="src/test"/> |
| <path refid="coberturaPath"/> |
| </classpath> |
| </junit> |
| </target> |
| |
| <condition property="_testAll_"> |
| <and> |
| <not> |
| <istrue value="${_skipTests_}"/> |
| </not> |
| <not> |
| <isset property="_testOne_"/> |
| </not> |
| </and> |
| </condition> |
| |
| <target name="-testAll" if="_testAll_"> |
| <mkdir dir="${junitRawDirectory}"/> |
| <junit printsummary="true" fork="true" includeantruntime="false" failureproperty="testFailed" |
| maxmemory="${groovyJUnit_mx}" dir="${basedir}"> |
| <jvmarg line="${junitJvmArgs}"/> |
| <formatter type="xml"/> |
| <formatter type="plain" unless="noTextReports"/> |
| <batchtest todir="${junitRawDirectory}"> |
| <fileset dir="${testClassesDirectory}" includes="UberTest*.class"/> |
| </batchtest> |
| <classpath> |
| <path refid="testPath"/> |
| <pathelement path="${instrumentedClassesDirectory}"/> |
| <pathelement path="${mainClassesDirectory}"/> |
| <pathelement path="${testClassesDirectory}"/> |
| <pathelement path="src/test"/> |
| <path refid="coberturaPath"/> |
| </classpath> |
| </junit> |
| <mkdir dir="${junitReportsDirectory}"/> |
| <junitreport tofile="${junitRawDirectory}/Results.xml"> |
| <fileset dir="${junitRawDirectory}" includes="TEST-*.xml"/> |
| <report format="frames" todir="${junitReportsDirectory}"/> |
| </junitreport> |
| </target> |
| |
| <target name="-reportTestFailed" depends="test,-coverageReport" if="testFailed"> |
| <fail message="Test failed, not processing further targets."/> |
| </target> |
| |
| <target name="-coverageInstrument" depends="-initCoverage,-coberturaInit" if="_forceCoverage_"> |
| <mkdir dir="${instrumentedClassesDirectory}"/> |
| <coberturaInstrument classesDirectory="${mainClassesDirectory}"/> |
| </target> |
| |
| <target name="-coverageReport" depends="-initCoverage" if="_forceCoverage_"> |
| <coberturaReport reportDirectory="${reportsDirectory}/cobertura" sourceDirectory="${mainSourceDirectory}"/> |
| </target> |
| |
| <target name="-actuallyCreateJars" |
| depends="-makeManifest,-initializeJars,-createBaseJar,-createEmbeddableJar" |
| unless="testFailed"/> |
| |
| <target name="-makeManifest"> |
| <mkdir dir="${mainClassesDirectory}/META-INF"/> |
| <copy todir="${mainClassesDirectory}/META-INF" file="LICENSE.txt"/> |
| <manifest file="${mainClassesDirectory}/META-INF/MANIFEST.MF"> |
| <attribute name="Built-By" value="${user.name}"/> |
| <attribute name="Extension-Name" value="groovy"/> |
| <attribute name="Specification-Title" value="Groovy: a powerful, dynamic language for the JVM"/> |
| <attribute name="Specification-Version" value="${groovyVersion}"/> |
| <attribute name="Specification-Vendor" value="The Codehaus"/> |
| <attribute name="Implementation-Title" value="Groovy: a powerful, dynamic language for the JVM"/> |
| <attribute name="Implementation-Version" value="${groovyVersion}"/> |
| <attribute name="Implementation-Vendor" value="The Codehaus"/> |
| </manifest> |
| </target> |
| |
| <target name="-includeResources" depends="-includeGroovyDocTemplates"> |
| <copy todir="${mainClassesDirectory}"> |
| <fileset dir="${mainSourceDirectory}"> |
| <include name="groovy/ui/*.properties"/> |
| <include name="groovy/ui/*.png"/> |
| <include name="org/codehaus/groovy/tools/shell/**/*.properties"/> |
| <include name="org/codehaus/groovy/tools/shell/**/*.xml"/> |
| </fileset> |
| </copy> |
| </target> |
| |
| <target name="-includeGroovyDocTemplates"> |
| <copy todir="${mainClassesDirectory}"> |
| <fileset dir="${mainSourceDirectory}"> |
| <include name="org/codehaus/groovy/tools/groovydoc/gstring-templates/**/*.*"/> |
| </fileset> |
| </copy> |
| </target> |
| |
| <target name="-initializeJars" depends="test"> |
| <mkdir dir="${targetDistDirectory}"/> |
| </target> |
| |
| <target name="-createBaseJar" unless="testFailed"> |
| <jar destfile="${targetDistDirectory}/groovy-${groovyVersion}.jar" basedir="${mainClassesDirectory}" |
| excludes="*.groovy" manifest="${mainClassesDirectory}/META-INF/MANIFEST.MF"/> |
| </target> |
| |
| <target name="-jarjarInit"> |
| <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpathref="toolsPath"/> |
| </target> |
| |
| <target name="-createEmbeddableJar" depends="-jarjarInit" unless="testFailed"> |
| <delete dir="${stagingDirectory}" quiet="true"/> |
| <mkdir dir="${stagingDirectory}"/> |
| <unzip dest="${stagingDirectory}"> |
| <fileset dir="${runtimeLibDirectory}"> |
| <include name="antlr*.jar"/> |
| <include name="asm*.jar"/> |
| <exclude name="asm-attr*.jar"/> |
| <exclude name="asm-util*.jar"/> |
| <exclude name="asm-analysis*.jar"/> |
| </fileset> |
| </unzip> |
| <unzip dest="${stagingDirectory}"> |
| <fileset dir="${targetDistDirectory}"> |
| <include name="groovy-${groovyVersion}.jar"/> |
| </fileset> |
| </unzip> |
| <copy toDir="${stagingDirectory}/META-INF"> |
| <fileset dir="${basedir}"> |
| <include name="ASM-LICENSE.txt"/> |
| </fileset> |
| </copy> |
| <mkdir dir="${targetDistDirectory}"/> |
| <jarjar jarfile="${targetDistDirectory}/groovy-all-${groovyVersion}.jar" |
| manifest="${stagingDirectory}/META-INF/MANIFEST.MF"> |
| <fileset dir="${stagingDirectory}"/> |
| <rule pattern="antlr.**" result="groovyjarjarantlr.@1"/> |
| <rule pattern="org.objectweb.**" result="groovyjarjarasm.@1"/> |
| </jarjar> |
| <copy file="${targetDistDirectory}/groovy-all-${groovyVersion}.jar" |
| tofile="${targetDistDirectory}/groovy-all-minimal-${groovyVersion}.jar"/> |
| <delete dir="${stagingDirectory}" quiet="true"/> |
| </target> |
| |
| <target name="createJars" depends="-checkAntVersion,-reportTestFailed,-actuallyCreateJars" |
| description="Build Groovy and create the jarfiles."/> |
| |
| <target name="install" depends="createJars" unless="testFailed" |
| description="Create an installation hierarchy in target/install."> |
| |
| <!-- |
| FIXME: Its not really a good idea to delete stuff, as it tends to negate Ant's (or other tools) |
| ability to run faster incremental builds. |
| --> |
| <delete dir="${installDirectory}" quiet="true"/> |
| <mkdir dir="${installDirectory}"/> |
| |
| <!-- Install license files --> |
| <copy todir="${installDirectory}"> |
| <fileset dir="${basedir}"> |
| <include name="LICENSE.txt"/> |
| <include name="ASM-LICENSE.txt"/> |
| <include name="NOTICE.txt"/> |
| </fileset> |
| </copy> |
| <fixcrlf srcdir="${installDirectory}" eol="crlf" includes="*.txt"/> |
| |
| <!-- Install generated artifacts and runtime dependencies --> |
| <mkdir dir="${installDirectory}/lib"/> |
| <copy todir="${installDirectory}/lib"> |
| <fileset file="${targetDistDirectory}/groovy-${groovyVersion}.jar"/> |
| <fileset dir="${runtimeLibDirectory}" includes="*.jar"/> |
| </copy> |
| |
| <!-- Install the embeddable bits --> |
| <mkdir dir="${installDirectory}/embeddable"/> |
| <copy todir="${installDirectory}/embeddable"> |
| <fileset file="${targetDistDirectory}/groovy-all-${groovyVersion}.jar"/> |
| </copy> |
| |
| <!-- Install configuration files --> |
| <mkdir dir="${installDirectory}/conf"/> |
| <copy toDir="${installDirectory}/conf"> |
| <fileset dir="${sourceDirectory}/conf" includes="*"/> |
| </copy> |
| |
| <!-- Install scripts --> |
| <mkdir dir="${installDirectory}/bin"/> |
| <copy toDir="${installDirectory}/bin"> |
| <fileset dir="${sourceDirectory}/bin" includes="*"/> |
| <filterset> |
| <filter token="GROOVYJAR" value="groovy-${groovyVersion}.jar"/> |
| </filterset> |
| </copy> |
| |
| <!-- Tweak scripts for platform compatibility --> |
| <fixcrlf srcdir="${installDirectory}/bin" eol="lf" excludes="*.bat"/> |
| <fixcrlf srcdir="${installDirectory}/bin" eol="crlf" includes="*.bat"/> |
| <chmod perm="ugo+x"> |
| <fileset dir="${installDirectory}/bin" includes="*,*.*"/> |
| </chmod> |
| </target> |
| |
| <target name="checkstyle" depends="-init,-initializeReports,-checkstyleInit" |
| description="Create the code style reports."> |
| <checkAndReport |
| reportDirectory="${reportsDirectory}/checkstyle" |
| sourceDirectory="${mainSourceDirectory}" |
| excludes="org/codehaus/groovy/antlr/parser/*,org/codehaus/groovy/antlr/java/*,org/codehaus/groovy/syntax/Types.java"> |
| <path> |
| <pathelement path="${mainClassesDirectory}"/> |
| <path refid="testPath"/> |
| </path> |
| </checkAndReport> |
| </target> |
| |
| <target name="-compileTools" depends="compileMain"> |
| <echo message="Groovyc of tools code."/> |
| <java classname="org.codehaus.groovy.ant.Groovyc"> |
| <classpath> |
| <path refid="toolsPath"/> |
| <pathelement path="${mainClassesDirectory}"/> |
| <path refid="compilePath"/> |
| </classpath> |
| <arg value="${toolsClassesDirectory}"/> |
| <arg value="${toolsSourceDirectory}"/> |
| </java> |
| </target> |
| |
| <target name="buildinfo"> |
| <mkdir dir="${cruiseReportRootDirectory}"/> |
| <copy todir="${cruiseReportRootDirectory}"> |
| <fileset dir="config/build"/> |
| </copy> |
| </target> |
| |
| <target name="cruiseInit"> |
| <property name="noTextReports" value="true"/> |
| <property name="forceCoverage" value="true"/> |
| <delete dir="${reportsDirectory}" quiet="true" failonerror="false"/> |
| <delete dir="${junitRawDirectory}" quiet="true" failonerror="false"/> |
| </target> |
| |
| <target name="cruise" depends="cruiseInit,distribution,compileExamples,checkstyle,buildinfo"/> |
| |
| <target name="-docInit"> |
| <mkdir dir="${docsDirectory}"/> |
| </target> |
| |
| <target name="doc" depends="-compileTools,-docInit" description="Create the documentation."> |
| <java classname="org.codehaus.groovy.tools.DocGenerator" fork="yes"> |
| <classpath> |
| <pathelement path="${toolsClassesDirectory}"/> |
| <path refid="toolsPath"/> |
| <pathelement path="${mainClassesDirectory}"/> |
| </classpath> |
| </java> |
| <property name="title" value="Groovy"/> |
| <javadoc destdir="${docsDirectory}/api" author="true" version="true" |
| windowtitle="${title} (${groovyVersion})" doctitle="${title} (${groovyVersion})" |
| encoding="ISO-8859-1" useexternalfile="true" |
| footer="Copyright &copy; 2003-2007 The Codehaus. All rights reserved."> |
| <classpath> |
| <path path="${mainClassesDirectory}"/> |
| <path refid="compilePath"/> |
| </classpath> |
| <fileset dir="${mainSourceDirectory}" includes="**/*.java"/> |
| <link href="http://java.sun.com/j2se/1.4.2/docs/api"/> |
| <link href="http://www.dpml.net/api/ant/1.7.0"/> |
| <link href="http://junit.sourceforge.net/junit3.8.1/javadoc/"/> |
| <link href="http://java.sun.com/j2ee/1.4/docs/api"/> |
| <link href="http://www.antlr2.org/javadoc"/> |
| </javadoc> |
| <taskdef name="groovydoc" classname="org.codehaus.groovy.ant.Groovydoc"> |
| <classpath> |
| <path path="${mainClassesDirectory}"/> |
| <path refid="compilePath"/> |
| </classpath> |
| </taskdef> |
| <groovydoc |
| destdir="${docsDirectory}/gapi" |
| sourcepath="${mainSourceDirectory}" |
| packagenames="**.*" |
| use="true" |
| windowtitle="groovydoc" |
| private="false"/> |
| </target> |
| |
| <target name="groovydoc" depends="-compileTools,-docInit,-includeGroovyDocTemplates" |
| description="Create the groovydoc documentation."> |
| <taskdef name="groovydoc" classname="org.codehaus.groovy.ant.Groovydoc"> |
| <classpath> |
| <path path="${mainClassesDirectory}"/> |
| <path refid="compilePath"/> |
| </classpath> |
| </taskdef> |
| <groovydoc |
| destdir="${docsDirectory}/gapi" |
| sourcepath="${mainSourceDirectory}" |
| packagenames="**.*" |
| use="true" |
| windowtitle="groovydoc" |
| private="false"/> |
| </target> |
| |
| |
| <target name="clean" description="Clean out the built materials."> |
| <delete dir="${targetDirectory}" quiet="true"/> |
| <delete quiet="true"> |
| <fileset dir="." includes="**/*~"/> |
| <fileset dir="${groovyParserDirectory}" includes="Groovy*.*"/> |
| <fileset dir="${javaParserDirectory}" |
| includes="JavaLexer.java,JavaRecognizer.java,JavaTokenTypes.java,JavaTokenTypes.txt,*.smap"/> |
| </delete> |
| </target> |
| |
| <target name="deploy" depends="-mavenDeployInit,install" |
| description="Deploy jars to maven repository."> |
| <mavenDeploy version="${groovyVersion}" artifact="groovy"/> |
| <mavenDeploy version="${groovyVersion}" artifact="groovy-all"/> |
| <mavenDeploy version="${groovyVersion}" artifact="groovy-all-minimal"/> |
| </target> |
| |
| <target name="installRepo" depends="-mavenInit,install" |
| description="Deploy artifacts to local maven repository."> |
| <mavenInstallRepo version="${groovyVersion}" artifact="groovy"/> |
| <mavenInstallRepo version="${groovyVersion}" artifact="groovy-all"/> |
| <mavenInstallRepo version="${groovyVersion}" artifact="groovy-all-minimal"/> |
| </target> |
| |
| <target name="distribution" depends="install,doc" description="Create everything needed for a distribution."> |
| <zip destfile="${targetDistDirectory}/groovy-binary-${groovyVersion}.zip" |
| comment="The Groovy ${groovyVersion} binary distribution."> |
| |
| <!-- Make unix scripts executable --> |
| <zipfileset dir="${installDirectory}" prefix="groovy-${groovyVersion}" filemode="775"> |
| <include name="bin/*"/> |
| <exclude name="bin/*.*"/> |
| <exclude name="bin/startGroovy*"/> |
| </zipfileset> |
| |
| <!-- Include the other scripts asis --> |
| <zipfileset dir="${installDirectory}" prefix="groovy-${groovyVersion}"> |
| <include name="bin/*.*"/> |
| <include name="bin/startGroovy*"/> |
| </zipfileset> |
| |
| <!-- Include everything else asis too --> |
| <zipfileset dir="${installDirectory}" prefix="groovy-${groovyVersion}"> |
| <exclude name="bin/**"/> |
| <include name="**"/> |
| </zipfileset> |
| </zip> |
| |
| <zip destfile="${targetDistDirectory}/groovy-docs-${groovyVersion}.zip" |
| comment="The Groovy ${groovyVersion} documentation distribution."> |
| <zipfileset dir="${wikiPdfDirectory}" includes="wiki-snapshot.pdf" prefix="groovy-${groovyVersion}/pdf"/> |
| <zipfileset dir="${docsDirectory}" prefix="groovy-${groovyVersion}/html"/> |
| </zip> |
| |
| <zip destfile="${targetDistDirectory}/groovy-src-${groovyVersion}.zip" |
| comment="The Groovy ${groovyVersion} source distribution."> |
| <zipfileset dir="${basedir}" prefix="groovy-${groovyVersion}"> |
| <!-- Exclude generated bits as well as any other bits that shouldn't make it in --> |
| <exclude name="${targetDirectory}/**"/> |
| <exclude name="classes/**"/> |
| <exclude name="cruise/**"/> |
| <exclude name=".clover/*"/> |
| <exclude name="local.build.properties"/> |
| <exclude name="cobertura.ser"/> |
| <exclude name="junitvmwatcher*.properties"/> |
| </zipfileset> |
| </zip> |
| </target> |
| |
| <target name="dist" depends="distribution" description="Alias to distribution for the lazy."/> |
| |
| </project> |