|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810 |
- <?xml version="1.0"?>
-
- <!--
- =======================================================================
- Apache Ant own build file
-
- Copyright (c) 2000-2005 The Apache Software Foundation. All rights
- reserved.
-
- =======================================================================
- -->
- <project name="apache-ant" default="main" basedir=".">
-
- <!-- Give user a chance to override without editing this file
- (and without typing -D each time it compiles it) -->
- <property file=".ant.properties"/>
- <property file="${user.home}/.ant.properties"/>
- <property environment="env"/>
-
-
- <!--
- ===================================================================
- Set the properties that control names and versions
- ===================================================================
- -->
- <property name="Name" value="Apache Ant"/>
- <property name="name" value="ant"/>
- <property name="version" value="1.7alpha"/>
- <property name="manifest-version" value="1.7"/>
- <property name="bootstrap.jar" value="ant-bootstrap.jar"/>
-
- <property name="ant.package" value="org/apache/tools/ant"/>
- <property name="taskdefs.package" value="${ant.package}/taskdefs"/>
- <property name="condition.package" value="${taskdefs.package}/condition"/>
- <property name="optional.package" value="${taskdefs.package}/optional"/>
- <property name="optional.condition.package" value="${optional.package}/condition"/>
- <property name="type.package" value="${ant.package}/types"/>
- <property name="optional.type.package" value="${type.package}/optional"/>
- <property name="apache.resolver.type.package" value="${ant.package}/types/resolver"/>
- <property name="util.package" value="${ant.package}/util"/>
- <property name="regexp.package" value="${util.package}/regexp"/>
-
- <property name="optional.jars.prefix" value="ant"/>
-
- <!--
- ===================================================================
- Set the properties that control various build options
- ===================================================================
- -->
- <property name="debug" value="true"/>
- <property name="chmod.fail" value="true"/>
- <property name="chmod.maxparallel" value="250"/>
- <property name="deprecation" value="false"/>
- <property name="optimize" value="true"/>
- <property name="javac.target" value="1.2"/>
- <property name="javac.source" value="1.2"/>
- <property name="junit.fork" value="false"/>
- <property name="junit.filtertrace" value="off"/>
- <property name="junit.summary" value="no"/>
- <property name="test.haltonfailure" value="yes"/>
- <property name="junit.forkmode" value="once"/>
- <property name="unfiltered.files" value="**/*.gif,**/*.jpg,**/*.ico,**/*.pdf,**/*.zip"/>
-
- <!--
- ===================================================================
- Set the properties related to the source tree
- ===================================================================
- -->
- <property name="src.dir" value="src"/>
- <property name="java.dir" value="${src.dir}/main"/>
- <property name="script.dir" value="${src.dir}/script"/>
- <property name="lib.dir" value="lib"/>
- <property name="docs.dir" value="docs"/>
- <property name="etc.dir" value="src/etc"/>
- <property name="tests.dir" value="src/testcases"/>
- <property name="tests.etc.dir" value="src/etc/testcases"/>
- <property name="manifest" value="src/etc/manifest"/>
- <property name="resource.dir" value="${src.dir}/resources"/>
-
- <!--
- ===================================================================
- Set the properties for the build area
- ===================================================================
- -->
- <property name="build.dir" value="build"/>
- <property name="bootstrap.dir" value="bootstrap"/>
- <property name="build.classes" value="${build.dir}/classes"/>
- <property name="build.lib" value="${build.dir}/lib"/>
- <property name="build.javadocs" value="${build.dir}/javadocs"/>
- <property name="build.tests" value="${build.dir}/testcases"/>
- <property name="build.tests.javadocs" value="${build.dir}/javadocs.test/"/>
- <property name="manifest.tmp" value="${build.dir}/optional.manifest"/>
- <!-- the absolute path -->
- <property name="build.tests.value" location="${build.tests}"/>
-
- <!--
- ===================================================================
- Set the paths used in the build
- ===================================================================
- -->
- <path id="classpath">
- </path>
-
- <path id="tests-classpath">
- <pathelement location="${build.classes}"/>
- <pathelement location="${build.tests}"/>
- <!--
- include the test source and test data dirs
- so that we can pick resources via getResource(AsStream)
- -->
- <pathelement location="${tests.dir}"/>
- <pathelement location="${tests.etc.dir}"/>
- <path refid="classpath"/>
- </path>
-
- <!-- turn this path into a string which is passed to the tests -->
- <property name="tests-classpath.value"
- refid="tests-classpath"/>
-
- <!--
- ===================================================================
- Set up properties for the distribution area
- ===================================================================
- -->
- <property name="dist.name" value="apache-${name}-${version}"/>
- <property name="dist.base" value="distribution"/>
- <property name="dist.base.source" value="${dist.base}/source"/>
- <property name="dist.base.binaries" value="${dist.base}/binaries"/>
- <property name="dist.dir" value="dist"/>
- <property name="dist.bin" value="${dist.dir}/bin"/>
- <property name="dist.lib" value="${dist.dir}/lib"/>
- <property name="dist.docs" value="${dist.dir}/docs"/>
- <property name="dist.etc" value="${dist.dir}/etc"/>
- <property name="dist.javadocs" value="${dist.dir}/docs/manual/api"/>
-
- <property name="src.dist.dir" value="dist-src"/>
- <property name="src.dist.src" value="${src.dist.dir}/src"/>
- <property name="src.dist.docs" value="${src.dist.dir}/docs"/>
- <property name="src.dist.lib" value="${src.dist.dir}/lib"/>
-
- <property name="java-repository.dir" value="java-repository/ant/jars"/>
-
- <!--
- ===================================================================
- Set up selectors to be used by javac, junit and jar to exclude
- files that have dependencies that are not available
- ===================================================================
- -->
- <!-- depends on JDK version -->
- <selector id="needs.jdk1.3+">
- <or>
- <filename name="${ant.package}/taskdefs/TestProcess*"/>
- <filename name="${optional.package}/extension/**"/>
- </or>
- </selector>
-
- <selector id="needs.jdk1.4+">
- <or>
- <filename name="${regexp.package}/Jdk14Regexp*"/>
- <filename name="${ant.package}/types/AssertionsTest.java"/>
- </or>
- </selector>
-
- <selector id="needs.jdk1.5+">
- <or>
- <filename name="${taskdefs.package}/AptTest*"/>
- </or>
- </selector>
-
- <!-- Kaffe has some JDK 1.5 features including java.lang.Readable,
- but not all of them -->
- <selector id="not.in.kaffe">
- <or>
- <filename name="${condition.package}/IsReachable*"/>
- </or>
- </selector>
-
- <selector id="needs.sun.uue">
- <filename name="${ant.package}/taskdefs/email/UUMailer*"/>
- </selector>
-
- <selector id="needs.sun.b64">
- <or>
- <filename name="${optional.package}/splash/SplashTask*"/>
- <filename name="${optional.package}/splash/SplashScreenTest.java"/>
- </or>
- </selector>
-
- <!-- depends on external libraries -->
- <selector id="needs.trax">
- <or>
- <filename name="${optional.package}/junit/Xalan2Executor*"/>
- <filename name="${optional.package}/TraXLiaison*"/>
- <filename name="${optional.package}/sitraka/**"/>
- <filename name="${optional.package}/metamata/MMetrics*"/>
- <filename name="${optional.package}/XsltTest*"/>
- <filename name="${type.package}/XMLCatalogBuildFileTest*"/>
- </or>
- </selector>
-
- <selector id="needs.xalan1">
- <or>
- <filename name="${optional.package}/XalanLiaison*"/>
- <filename name="${optional.package}/junit/Xalan1Executor*"/>
- </or>
- </selector>
-
- <selector id="needs.xslp">
- <filename name="${optional.package}/XslpLiaison*"/>
- </selector>
-
- <selector id="needs.apache-resolver">
- <filename name="${apache.resolver.type.package}/**"/>
- </selector>
-
- <selector id="needs.junit">
- <filename name="${optional.package}/junit/**"/>
- </selector>
-
- <selector id="needs.apache-regexp">
- <filename name="${regexp.package}/JakartaRegexp*"/>
- </selector>
-
- <selector id="needs.apache-oro">
- <or>
- <filename name="${regexp.package}/JakartaOro*"/>
- <filename name="${optional.package}/perforce/*"/>
- <filename name="${optional.package}/metamata/MAudit*"/>
- </or>
- </selector>
-
- <selector id="needs.apache-bcel">
- <or>
- <filename name="${ant.package}/filters/util/JavaClassHelper*"/>
- <filename name="${util.package}/depend/bcel/*"/>
- <filename name="${optional.type.package}/depend/ClassFileSetTest*"/>
- </or>
- </selector>
-
- <selector id="needs.apache-log4j">
- <filename name="${ant.package}/listener/Log4jListener*"/>
- </selector>
-
- <selector id="needs.commons-logging">
- <filename name="${ant.package}/listener/CommonsLoggingListener*"/>
- </selector>
-
- <selector id="needs.apache-bsf">
- <or>
- <filename name="${optional.package}/Script*"/>
- <filename name="${optional.package}/script/**/*"/>
- <filename name="${optional.type.package}/*Script*"/>
- <filename name="${util.package}/Script*"/>
- </or>
- </selector>
-
- <selector id="needs.stylebook">
- <filename name="${optional.package}/StyleBook*"/>
- </selector>
-
- <selector id="needs.javamail">
- <or>
- <filename name="${ant.package}/taskdefs/email/MimeMailer*"/>
- </or>
- </selector>
-
- <selector id="needs.icontract">
- <filename name="${optional.package}/IContract*"/>
- </selector>
-
- <selector id="needs.netrexx">
- <filename name="${optional.package}/NetRexxC*"/>
- </selector>
-
- <selector id="needs.weblogic.ejbc">
- <filename name="${optional.package}/ejb/Ejbc*"/>
- </selector>
-
- <selector id="needs.weblogic.ddcreator">
- <filename name="${optional.package}/ejb/DDCreator*"/>
- </selector>
-
- <selector id="needs.weblogic.server">
- <or>
- <filename name="${optional.package}/ejb/WLRun*"/>
- <filename name="${optional.package}/ejb/WLStop*"/>
- </or>
- </selector>
-
- <selector id="needs.commons-net">
- <or>
- <filename name="${optional.package}/net/FTP*"/>
- <filename name="${optional.package}/net/RExec*"/>
- <filename name="${optional.package}/net/TelnetTask*"/>
- </or>
- </selector>
-
- <selector id="needs.starteam">
- <or>
- <filename name="${optional.package}/scm/AntStarTeam*"/>
- <filename name="${optional.package}/starteam/*"/>
- </or>
- </selector>
-
- <selector id="needs.vaj">
- <filename name="${optional.package}/ide/VAJ*"/>
- </selector>
-
- <selector id="needs.antlr">
- <filename name="${optional.package}/ANTLR*"/>
- </selector>
-
- <selector id="needs.jmf">
- <filename name="${optional.package}/sound/*"/>
- </selector>
-
- <selector id="needs.jai">
- <or>
- <filename name="${optional.package}/image/*"/>
- <filename name="${optional.type.package}/image/*"/>
- </or>
- </selector>
-
- <selector id="needs.jdepend">
- <filename name="${optional.package}/jdepend/*"/>
- </selector>
-
- <selector id="needs.swing">
- <filename name="${optional.package}/splash/*"/>
- </selector>
-
- <selector id="needs.jsch">
- <filename name="${optional.package}/ssh/*"/>
- </selector>
-
- <selector id="ant.launcher">
- <filename name="${ant.package}/launch/**/*"/>
- </selector>
-
- <patternset id="onlinetests">
- <exclude name="**/GetTest.java" if="offline"/>
- </patternset>
-
- <patternset id="teststhatfail">
- <!-- Property 'run.failing.tests' should force Ant to run these tests. -->
- <!-- Because the whole patternset can not be excluded, you have to add -->
- <!-- an unless-attribute on each exclude-element. -->
- <exclude unless="run.failing.tests" name="${optional.package}/BeanShellScriptTest.java"/>
- <exclude unless="run.failing.tests" name="${optional.package}/jdepend/JDependTest.java"/>
- <exclude unless="run.failing.tests" name="${optional.package}/DotnetTest.java"/>
- <exclude unless="run.failing.tests" name="${optional.package}/WsdlToDotnetTest.java"/>
- </patternset>
-
- <!--tests that need an XML Schema-supporting parser to work-->
- <selector id="needs.xmlschema">
- <or>
- <filename name="${optional.package}/SchemaValidateTest.*"/>
- <filename name="${optional.package}/XmlValidateTest.*"/>
- </or>
- </selector>
-
- <!--
- ===================================================================
- Set up a patternsets that matches the parts of our JUnit testsuite
- that may be useful for task developers.
- ===================================================================
- -->
- <patternset id="useful.tests">
- <include name="${ant.package}/BuildFileTest*"/>
- <include name="${regexp.package}/RegexpMatcherTest*"/>
- <include name="${regexp.package}/RegexpTest*"/>
- <include name="${optional.package}/AbstractXSLTLiaisonTest*"/>
- <include name="${ant.package}/types/AbstractFileSetTest*"/>
- </patternset>
-
- <!--
- ===================================================================
- Set up a patternsets that matches the parts of our site that
- should not be part of the distribution.
- ===================================================================
- -->
- <patternset id="site.excludes">
- <exclude name="bindownload.html"/>
- <exclude name="srcdownload.html"/>
- <exclude name="*.cgi"/>
- </patternset>
-
- <!--
- ===================================================================
- Check to see what optional dependencies are available
- ===================================================================
- -->
- <target name="check_for_optional_packages">
- <available property="jdk1.3+" classname="java.lang.StrictMath"/>
- <available property="jdk1.4+" classname="java.lang.CharSequence"/>
- <available property="jdk1.5+" classname="java.lang.Readable"/>
- <available property="kaffe" classname="kaffe.util.NotImplemented"/>
- <available property="bsf.present"
- classname="org.apache.bsf.BSFManager"
- classpathref="classpath"/>
- <available property="netrexx.present"
- classname="netrexx.lang.Rexx"
- classpathref="classpath"/>
- <available property="trax.present"
- classname="javax.xml.transform.Transformer"
- classpathref="classpath"/>
- <condition property="trax.impl.present">
- <or>
- <and>
- <isset property="javax.xml.transform.TransformerFactory"/>
- <available classname="${javax.xml.transform.TransformerFactory}"
- classpathref="classpath"/>
- </and>
- <available resource="META-INF/services/javax.xml.transform.TransformerFactory"/>
- </or>
- </condition>
- <available property="xslp.present"
- classname="com.kvisco.xsl.XSLProcessor"
- classpathref="classpath"/>
- <available property="apache.resolver.present"
- classname="org.apache.xml.resolver.tools.CatalogResolver"
- classpathref="classpath"/>
- <available property="xalan.present"
- classname="org.apache.xalan.xslt.XSLTProcessorFactory"
- classpathref="classpath"/>
- <available property="xalan2.present"
- classname="org.apache.xalan.transformer.TransformerImpl"
- classpathref="classpath"/>
- <available property="ejb.ejbc.present"
- classname="weblogic.ejbc"
- classpathref="classpath"/>
- <available property="ejb.DDCreator.present"
- classname="weblogic.ejb.utils.DDCreator"
- classpathref="classpath"/>
- <available property="ejb.wls.present"
- classname="weblogic.Server"
- classpathref="classpath"/>
- <available property="junit.present"
- classname="junit.framework.TestCase"
- classpathref="classpath"/>
- <available property="commons.net.present"
- classname="org.apache.commons.net.ftp.FTPClient"
- classpathref="classpath"/>
- <available property="starteam.present"
- classname="com.starbase.util.Platform"
- classpathref="classpath"/>
- <available property="antlr.present"
- classname="antlr.Tool"
- classpathref="classpath"/>
- <available property="vaj.present"
- classname="com.ibm.ivj.util.base.Workspace"
- classpathref="classpath"/>
- <available property="stylebook.present"
- classname="org.apache.stylebook.Engine"
- classpathref="classpath"/>
- <available property="apache.regexp.present"
- classname="org.apache.regexp.RE"
- classpathref="classpath"/>
- <available property="apache.oro.present"
- classname="org.apache.oro.text.regex.Perl5Matcher"
- classpathref="classpath"/>
- <available property="jmf.present"
- classname="javax.sound.sampled.Clip"
- classpathref="classpath"/>
- <available property="jai.present"
- classname="javax.media.jai.JAI"
- classpathref="classpath"/>
- <available property="icontract.present"
- classname="com.reliablesystems.iContract.IContracted"
- classpathref="classpath"/>
- <available property="jdepend.present"
- classname="jdepend.framework.JDepend"
- classpathref="classpath"/>
- <available property="log4j.present"
- classname="org.apache.log4j.Logger"
- classpathref="classpath"/>
- <available property="commons.logging.present"
- classname="org.apache.commons.logging.LogFactory"
- classpathref="classpath"/>
- <available property="xalan.envcheck"
- classname="org.apache.xalan.xslt.EnvironmentCheck"
- classpathref="classpath"/>
- <available property="which.present"
- classname="org.apache.env.Which"
- classpathref="classpath"/>
-
- <available property="xerces.present"
- classname="org.apache.xerces.parsers.SAXParser"
- classpathref="classpath"/>
- <available property="bcel.present"
- classname="org.apache.bcel.Constants"
- classpathref="classpath"/>
- <available property="sunuue.present"
- classname="sun.misc.UUEncoder"
- classpathref="classpath"/>
-
- <condition property="javamail.complete">
- <and>
- <available classname="javax.activation.DataHandler"
- classpathref="classpath"/>
- <available classname="javax.mail.Transport"
- classpathref="classpath"/>
- </and>
- </condition>
-
- <condition property="some.regexp.support">
- <or>
- <isset property="jdk1.4+"/>
- <isset property="apache.regexp.present"/>
- <isset property="apache.oro.present"/>
- </or>
- </condition>
-
- <condition property="tests.and.ant.share.classloader">
- <or>
- <equals arg1="${junit.fork}" arg2="true"/>
- <equals arg1="${build.sysclasspath}" arg2="only"/>
- </or>
- </condition>
-
- <condition property="sun.tools.present">
- <and>
- <available classname="sun.tools.native2ascii.Main"/>
- <available classname="com.sun.tools.javah.Main"/>
- </and>
- </condition>
-
- <available property="base64.present" classname="sun.misc.BASE64Encoder"/>
-
- <property name="build.tests.resolved" location="${build.tests}"/>
- <condition property="tests.are.on.system.classpath">
- <or>
- <!-- relative paths in CLASSPATH -->
- <contains string="${java.class.path}"
- substring="${build.tests}"/>
- <!-- absolute paths in CLASSPATH -->
- <contains string="${java.class.path}"
- substring="${build.tests.resolved}"/>
- <istrue value="${junit.fork}"/>
- </or>
- </condition>
-
- <condition property="jasper.present">
- <and>
- <available classname="org.apache.jasper.compiler.Compiler"/>
- <available classname="org.apache.jasper.JasperException"/>
- </and>
- </condition>
-
- <condition property="swing.present">
- <or>
- <not>
- <isset property="kaffe"/>
- </not>
- <available classname="javax.swing.ImageIcon"
- classpathref="classpath"/>
- </or>
- </condition>
-
- <!-- http client needs commons logging -->
- <condition property="apache-httpclient.present">
- <and>
- <available
- classname="org.apache.commons.httpclient.HttpClient"
- classpathref="classpath"/>
- <isset property="commons.logging.present"/>
- </and>
- </condition>
-
- <condition property="wsdl.found">
- <or>
- <available file="wsdl" filepath="${env.PATH}"/>
- <available file="wsdl.exe" filepath="${env.PATH}"/>
- <available file="wsdl.exe" filepath="${env.Path}"/>
- </or>
- </condition>
- <echo level="verbose"> wsdl.found=${wsdl.found}</echo>
- <condition property="csc.found">
- <or>
- <available file="mcs" filepath="${env.PATH}"/>
- <available file="csc" filepath="${env.PATH}"/>
- <available file="csc.exe" filepath="${env.PATH}"/>
- <available file="csc.exe" filepath="${env.Path}"/>
- </or>
- </condition>
- <echo level="verbose"> csc.found=${csc.found}</echo>
- <condition property="dotnetapps.found">
- <and>
- <isset property="csc.found"/>
- <isset property="wsdl.found"/>
- </and>
- </condition>
- <echo level="verbose"> dotnetapps.found=${dotnetapps.found}</echo>
-
- <available property="rhino.present"
- classname="org.mozilla.javascript.Scriptable"
- classpathref="classpath"/>
- <available property="beanshell.present"
- classname="bsh.StringUtil"
- classpathref="classpath"/>
- <available property="xerces1.present"
- classname="org.apache.xerces.framework.XMLParser"
- classpathref="classpath"/>
- <available property="jsch.present"
- classname="com.jcraft.jsch.Session"
- classpathref="classpath"/>
-
- <condition property="build.compiler" value="classic">
- <not>
- <isset property="jdk1.3+"/>
- </not>
- </condition>
- <property name="build.compiler" value="modern"/>
-
- <!--check for XSD support in the parser-->
- <condition property="xmlschema.present">
- <or>
- <parsersupports
- feature="http://apache.org/xml/features/validation/schema"/>
- <parsersupports
- feature="http://java.sun.com/xml/jaxp/properties/schemaSource"/>
- </or>
- </condition>
-
-
- </target>
-
-
- <!--
- ===================================================================
- Prepare the build
- ===================================================================
- -->
- <target name="prepare">
- <tstamp>
- <format property="year" pattern="yyyy"/>
- </tstamp>
- <filterchain id="ant.filters">
- <replacetokens>
- <token key="VERSION" value="${version}"/>
- <token key="DATE" value="${TODAY}"/>
- <token key="TIME" value="${TSTAMP}"/>
- </replacetokens>
- </filterchain>
- </target>
-
- <!--
- ===================================================================
- Build the code
- ===================================================================
- -->
- <target name="build"
- depends="prepare, check_for_optional_packages"
- description="--> compiles the source code">
- <mkdir dir="${build.dir}"/>
- <mkdir dir="${build.classes}"/>
- <mkdir dir="${build.lib}"/>
-
- <javac srcdir="${java.dir}"
- destdir="${build.classes}"
- debug="${debug}"
- deprecation="${deprecation}"
- target="${javac.target}"
- source="${javac.source}"
- optimize="${optimize}">
- <classpath refid="classpath"/>
-
- <selector id="conditional-patterns">
- <not>
- <or>
- <selector refid="needs.jdk1.3+" unless="jdk1.3+"/>
- <selector refid="needs.jdk1.4+" unless="jdk1.4+"/>
- <selector refid="needs.jdk1.5+" unless="jdk1.5+"/>
- <selector refid="not.in.kaffe" if="kaffe"/>
- <selector refid="needs.sun.uue" unless="sunuue.present"/>
- <selector refid="needs.sun.b64" unless="base64.present"/>
-
- <selector refid="needs.trax" unless="trax.present"/>
- <selector refid="needs.xalan1" unless="xalan.present"/>
- <selector refid="needs.xslp" unless="xslp.present"/>
- <selector refid="needs.apache-resolver" unless="apache.resolver.present"/>
- <selector refid="needs.junit" unless="junit.present"/>
- <selector refid="needs.apache-regexp"
- unless="apache.regexp.present"/>
- <selector refid="needs.apache-oro" unless="apache.oro.present"/>
- <selector refid="needs.apache-bcel" unless="bcel.present"/>
- <selector refid="needs.apache-log4j" unless="log4j.present"/>
- <selector refid="needs.commons-logging"
- unless="commons.logging.present"/>
- <selector refid="needs.apache-bsf" unless="bsf.present"/>
- <selector refid="needs.stylebook" unless="stylebook.present"/>
- <selector refid="needs.javamail" unless="javamail.complete"/>
- <selector refid="needs.icontract" unless="icontract.present"/>
- <selector refid="needs.netrexx" unless="netrexx.present"/>
- <selector refid="needs.weblogic.ejbc" unless="ejb.ejbc.present"/>
- <selector refid="needs.weblogic.ddcreator"
- unless="ejb.DDCreator.present"/>
- <selector refid="needs.weblogic.server" unless="ejb.wls.present"/>
- <selector refid="needs.commons-net" unless="commons.net.present"/>
- <selector refid="needs.starteam" unless="starteam.present"/>
- <selector refid="needs.vaj" unless="vaj.present"/>
- <selector refid="needs.antlr" unless="antlr.present"/>
- <selector refid="needs.jmf" unless="jmf.present"/>
- <selector refid="needs.jai" unless="jai.present"/>
- <selector refid="needs.jdepend" unless="jdepend.present"/>
- <selector refid="needs.swing" unless="swing.present"/>
- <selector refid="needs.jsch" unless="jsch.present"/>
- <selector refid="needs.xmlschema" unless="xmlschema.present"/>
- </or>
- </not>
- </selector>
- </javac>
-
- <copy todir="${build.classes}">
- <fileset dir="${java.dir}">
- <include name="**/*.properties"/>
- <include name="**/*.dtd"/>
- </fileset>
- <fileset dir="${resource.dir}" />
- </copy>
-
- <copy todir="${build.classes}"
- overwrite="true" encoding="UTF-8">
- <fileset dir="${java.dir}">
- <include name="**/version.txt"/>
- <include name="**/defaultManifest.mf"/>
- </fileset>
- <filterchain refid="ant.filters"/>
- </copy>
-
- <copy todir="${build.classes}/${optional.package}/junit/xsl">
- <fileset dir="${etc.dir}">
- <include name="junit-frames.xsl"/>
- <include name="junit-noframes.xsl"/>
- </fileset>
- </copy>
- </target>
-
- <!--
- ===================================================================
- Create the all of the Apache Ant jars
- ===================================================================
- -->
- <target name="jars"
- depends="build"
- description="--> creates the Apache Ant jars">
-
- <copy todir="${build.dir}">
- <fileset dir=".">
- <include name="LICENSE"/>
- <include name="LICENSE.xerces"/>
- <include name="LICENSE.dom"/>
- <include name="LICENSE.sax"/>
- <include name="NOTICE"/>
- </fileset>
- <mapper type="glob" from="*" to="*.txt"/>
- </copy>
-
- <copy file="${manifest}" tofile="${manifest.tmp}"/>
- <manifest file="${manifest.tmp}">
- <section name="${optional.package}/">
- <attribute name="Extension-name"
- value="org.apache.tools.ant"/>
- <attribute name="Specification-Title"
- value="Apache Ant"/>
- <attribute name="Specification-Version"
- value="${manifest-version}"/>
- <attribute name="Specification-Vendor"
- value="Apache Software Foundation"/>
- <attribute name="Implementation-Title"
- value="org.apache.tools.ant"/>
- <attribute name="Implementation-Version"
- value="${manifest-version}"/>
- <attribute name="Implementation-Vendor"
- value="Apache Software Foundation"/>
- </section>
- </manifest>
-
- <jar destfile="${build.lib}/${name}-launcher.jar"
- basedir="${build.classes}"
- whenmanifestonly="fail">
- <selector refid="ant.launcher"/>
- <manifest>
- <attribute name="Main-Class" value="org.apache.tools.ant.launch.Launcher"/>
- </manifest>
- </jar>
-
- <jar destfile="${build.lib}/${name}.jar"
- basedir="${build.classes}"
- manifest="${manifest}"
- whenmanifestonly="fail">
- <not>
- <selector id="non-core">
- <or>
- <filename name="${optional.package}/**"/>
- <filename name="${optional.type.package}/**"/>
- <filename name="${util.package}/depend/**"/>
- <filename name="${util.package}/optional/**"/>
- <selector refid="needs.apache-log4j"/>
- <selector refid="needs.commons-logging"/>
- <selector refid="needs.apache-regexp"/>
- <selector refid="needs.apache-oro"/>
- <selector refid="needs.jdk1.4+"/>
- <selector refid="needs.javamail"/>
- <selector refid="ant.launcher"/>
- </or>
- </selector>
- </not>
- <metainf dir="${build.dir}">
- <include name="LICENSE.txt"/>
- <include name="NOTICE.txt"/>
- </metainf>
-
- <manifest>
- <section name="${ant.package}/">
- <attribute name="Extension-name"
- value="org.apache.tools.ant"/>
- <attribute name="Specification-Title"
- value="Apache Ant"/>
- <attribute name="Specification-Version"
- value="${manifest-version}"/>
- <attribute name="Specification-Vendor"
- value="Apache Software Foundation"/>
- <attribute name="Implementation-Title"
- value="org.apache.tools.ant"/>
- <attribute name="Implementation-Version"
- value="${manifest-version}"/>
- <attribute name="Implementation-Vendor"
- value="Apache Software Foundation"/>
- </section>
- </manifest>
-
- <fileset dir="${docs.dir}">
- <include name="images/ant_logo_large.gif"/>
- </fileset>
- </jar>
-
- <jar destfile="${build.lib}/${bootstrap.jar}"
- basedir="${build.classes}"
- manifest="${manifest}"
- whenmanifestonly="fail">
- <include name="${ant.package}/Main.class"/>
- <metainf dir="${build.dir}">
- <include name="LICENSE.txt"/>
- <include name="NOTICE.txt"/>
- </metainf>
- <manifest>
- <attribute name="Class-Path"
- value="ant.jar xml-apis.jar xercesImpl.jar xalan.jar"/>
- </manifest>
- </jar>
-
- <jar destfile="${build.lib}/ant-nodeps.jar"
- basedir="${build.classes}"
- manifest="${manifest.tmp}"
- whenmanifestonly="skip">
- <and>
- <selector refid="non-core"/>
- <not>
- <or>
- <selector refid="needs.trax"/>
- <selector refid="needs.xalan1"/>
- <selector refid="needs.xslp"/>
- <selector refid="needs.apache-resolver"/>
- <selector refid="needs.junit"/>
- <selector refid="needs.apache-regexp"/>
- <selector refid="needs.apache-oro"/>
- <selector refid="needs.apache-bcel"/>
- <selector refid="needs.apache-log4j"/>
- <selector refid="needs.commons-logging"/>
- <selector refid="needs.apache-bsf"/>
- <selector refid="needs.stylebook"/>
- <selector refid="needs.javamail"/>
- <selector refid="needs.icontract"/>
- <selector refid="needs.netrexx"/>
- <selector refid="needs.weblogic.ejbc"/>
- <selector refid="needs.weblogic.ddcreator"/>
- <selector refid="needs.weblogic.server"/>
- <selector refid="needs.commons-net"/>
- <selector refid="needs.starteam"/>
- <selector refid="needs.vaj"/>
- <selector refid="needs.antlr"/>
- <selector refid="needs.jmf"/>
- <selector refid="needs.jai"/>
- <selector refid="needs.jdepend"/>
- <selector refid="needs.swing"/>
- <selector refid="needs.jsch"/>
- </or>
- </not>
- </and>
- <metainf dir="${build.dir}">
- <include name="LICENSE.txt"/>
- <include name="NOTICE.txt"/>
- </metainf>
- </jar>
-
- <macrodef name="optional-jar">
- <attribute name="dep"/>
- <sequential>
- <jar destfile="${build.lib}/${optional.jars.prefix}-@{dep}.jar"
- basedir="${build.classes}"
- manifest="${manifest.tmp}"
- whenmanifestonly="skip">
- <selector refid="needs.@{dep}"/>
- </jar>
- </sequential>
- </macrodef>
-
- <optional-jar dep="trax"/>
- <optional-jar dep="xalan1"/>
- <optional-jar dep="xslp"/>
- <optional-jar dep="apache-resolver"/>
- <optional-jar dep="junit"/>
- <optional-jar dep="apache-regexp"/>
- <optional-jar dep="apache-oro"/>
- <optional-jar dep="apache-bcel"/>
- <optional-jar dep="apache-log4j"/>
- <optional-jar dep="commons-logging"/>
- <optional-jar dep="apache-bsf"/>
- <optional-jar dep="stylebook"/>
- <optional-jar dep="javamail"/>
- <optional-jar dep="icontract"/>
- <optional-jar dep="netrexx"/>
- <optional-jar dep="commons-net"/>
- <optional-jar dep="starteam"/>
- <optional-jar dep="vaj"/>
- <optional-jar dep="antlr"/>
- <optional-jar dep="jmf"/>
- <optional-jar dep="jai"/>
- <optional-jar dep="swing"/>
- <optional-jar dep="jsch"/>
- <optional-jar dep="jdepend"/>
-
- <jar destfile="${build.lib}/${optional.jars.prefix}-weblogic.jar"
- basedir="${build.classes}"
- manifest="${manifest.tmp}"
- whenmanifestonly="skip">
- <or>
- <selector refid="needs.weblogic.ejbc"/>
- <selector refid="needs.weblogic.ddcreator"/>
- <selector refid="needs.weblogic.server"/>
- </or>
- </jar>
-
- </target>
-
- <!-- Creates jar of test utility classes -->
- <target name="test-jar"
- depends="compile-tests"
- description="--> creates the Apache Ant Test Utilities jar">
-
- <fail unless="junit.present">
- We cannot build the test jar unless JUnit is present,
- as JUnit is needed to compile the test classes.
- </fail>
- <jar destfile="${build.lib}/${name}-testutil.jar"
- basedir="${build.tests}">
- <patternset refid="useful.tests"/>
- </jar>
- </target>
-
- <!--
- ===================================================================
- Create the essential distribution that can run Apache Ant
- ===================================================================
- -->
- <target name="dist-lite"
- depends="jars"
- description="--> creates a minimum distribution to run Apache Ant">
-
- <mkdir dir="${dist.dir}"/>
- <mkdir dir="${dist.bin}"/>
- <mkdir dir="${dist.lib}"/>
-
- <copy todir="${dist.lib}">
- <fileset dir="${build.lib}">
- <exclude name="${bootstrap.jar}"/>
- </fileset>
- </copy>
-
- <copy todir="${dist.lib}">
- <fileset dir="${lib.dir}">
- <include name="*.jar"/>
- <include name="*.zip"/>
- </fileset>
- </copy>
-
- <copy todir="${dist.bin}">
- <fileset dir="${script.dir}/"/>
- </copy>
-
- <fixcrlf srcdir="${dist.bin}" eol="dos" includes="*.bat,*.cmd"/>
- <fixcrlf srcdir="${dist.bin}" eol="unix">
- <include name="ant"/>
- <include name="antRun"/>
- <include name="*.pl"/>
- </fixcrlf>
-
- <chmod perm="ugo+rx" dir="${dist.dir}" type="dir" includes="**"
- failonerror="${chmod.fail}"/>
- <chmod perm="ugo+r" dir="${dist.dir}" type="file" includes="**"
- failonerror="${chmod.fail}" maxparallel="${chmod.maxparallel}"/>
- <chmod perm="ugo+x" type="file" failonerror="${chmod.fail}">
- <fileset dir="${dist.bin}">
- <include name="**/ant"/>
- <include name="**/antRun"/>
- <include name="**/*.pl"/>
- <include name="**/*.py"/>
- </fileset>
- </chmod>
-
- </target>
-
- <!--
- ===================================================================
- Create the complete distribution
- ===================================================================
- -->
- <target name="dist" description="--> creates a complete distribution">
- <antcall inheritAll="false" target="internal_dist">
- <param name="dist.dir" value="${dist.name}"/>
- </antcall>
- </target>
-
- <target name="dist_javadocs" depends="javadocs">
- <mkdir dir="${dist.javadocs}"/>
- <copy todir="${dist.javadocs}" overwrite="true">
- <fileset dir="${build.javadocs}"/>
- </copy>
- </target>
-
-
- <target name="internal_dist" depends="dist-lite,dist_javadocs">
- <mkdir dir="${dist.docs}"/>
- <mkdir dir="${dist.etc}"/>
-
- <copy todir="${dist.lib}" file="${lib.dir}/README"/>
- <copy todir="${dist.lib}" file="${lib.dir}/libraries.properties"/>
-
- <copy todir="${dist.docs}">
- <fileset dir="${docs.dir}" excludes="${unfiltered.files}">
- <patternset refid="site.excludes"/>
- </fileset>
- <filterchain refid="ant.filters"/>
- </copy>
-
- <copy todir="${dist.docs}" filtering="false">
- <fileset dir="${docs.dir}" includes="${unfiltered.files}">
- <patternset refid="site.excludes"/>
- </fileset>
- </copy>
-
- <copy todir="${dist.dir}">
- <fileset dir=".">
- <include name="README"/>
- <include name="INSTALL"/>
- <include name="LICENSE"/>
- <include name="LICENSE.xerces"/>
- <include name="LICENSE.dom"/>
- <include name="LICENSE.sax"/>
- <include name="NOTICE"/>
- <include name="TODO"/>
- <include name="WHATSNEW"/>
- <include name="KEYS"/>
- <include name="welcome.html"/>
- <include name="fetch.xml"/>
- </fileset>
- </copy>
-
- <chmod perm="ugo+rx" dir="${dist.dir}" type="dir" includes="**"
- failonerror="${chmod.fail}"/>
- <chmod perm="ugo+r" dir="${dist.dir}" type="file" includes="**"
- failonerror="${chmod.fail}" maxparallel="${chmod.maxparallel}"/>
- <chmod perm="ugo+x" type="file" failonerror="${chmod.fail}">
- <fileset dir="${dist.bin}">
- <include name="**/ant"/>
- <include name="**/antRun"/>
- <include name="**/*.pl"/>
- <include name="**/*.py"/>
- </fileset>
- </chmod>
-
- <!-- publish some useful stylesheets -->
- <copy todir="${dist.etc}">
- <fileset dir="${etc.dir}">
- <include name="junit-frames.xsl"/>
- <include name="junit-noframes.xsl"/>
- <include name="junit-frames-xalan1.xsl"/>
- <include name="coverage-frames.xsl"/>
- <include name="maudit-frames.xsl"/>
- <include name="mmetrics-frames.xsl"/>
- <include name="changelog.xsl"/>
- <include name="jdepend.xsl"/>
- <include name="jdepend-frames.xsl"/>
- <include name="checkstyle/*.xsl"/>
- <include name="log.xsl"/>
- <include name="tagdiff.xsl"/>
- </fileset>
- <fileset dir="${build.lib}">
- <include name="${bootstrap.jar}"/>
- </fileset>
- </copy>
-
- </target>
-
-
- <!--
- ===================================================================
- Target to create bootstrap build
- ===================================================================
- -->
- <target name="bootstrap" description="--> creates a bootstrap build">
- <antcall inheritAll="false" target="dist-lite">
- <param name="dist.dir" value="${bootstrap.dir}"/>
- </antcall>
- </target>
-
-
- <!--
- ===================================================================
- Create the source distribution
- ===================================================================
- -->
- <target name="src-dist"
- description="--> creates a source distribution">
-
- <mkdir dir="${src.dist.dir}"/>
-
- <copy todir="${src.dist.lib}">
- <fileset dir="${lib.dir}">
- <include name="*.jar"/>
- <include name="*.zip"/>
- <include name="README"/>
- <include name="libraries.properties"/>
- </fileset>
- </copy>
-
- <copy todir="${src.dist.src}">
- <fileset dir="${src.dir}"/>
- </copy>
-
- <copy todir="${src.dist.docs}">
- <fileset dir="${docs.dir}">
- <exclude name="manual/api/**"/>
- <patternset refid="site.excludes"/>
- </fileset>
- </copy>
-
- <copy todir="${src.dist.dir}">
- <fileset dir=".">
- <include name="README"/>
- <include name="INSTALL"/>
- <include name="LICENSE"/>
- <include name="LICENSE.xerces"/>
- <include name="LICENSE.dom"/>
- <include name="LICENSE.sax"/>
- <include name="NOTICE"/>
- <include name="TODO"/>
- <include name="WHATSNEW"/>
- <include name="KEYS"/>
- <include name="build.bat"/>
- <include name="build.sh"/>
- <include name="bootstrap.bat"/>
- <include name="bootstrap.sh"/>
- <include name="build.xml"/>
- <include name="fetch.xml"/>
- <include name="welcome.html"/>
- </fileset>
- </copy>
-
- <fixcrlf srcdir="${src.dist.dir}" eol="dos" includes="*.bat,*.cmd"/>
- <fixcrlf srcdir="${src.dist.dir}" eol="unix">
- <include name="**/*.sh"/>
- <include name="**/*.pl"/>
- <include name="**/ant"/>
- <include name="**/antRun"/>
- </fixcrlf>
- <fixcrlf srcdir="${src.dist.dir}">
- <include name="**/*.java"/>
- <exclude name="src/etc/testcases/taskdefs/fixcrlf/expected/Junk?.java"/>
- <exclude name="src/etc/testcases/taskdefs/fixcrlf/input/Junk?.java"/>
- </fixcrlf>
-
- <chmod perm="ugo+x" dir="${src.dist.dir}" type="dir"
- failonerror="${chmod.fail}"/>
- <chmod perm="ugo+r" dir="${src.dist.dir}" failonerror="${chmod.fail}"/>
- <chmod perm="ugo+x" failonerror="${chmod.fail}">
- <fileset dir="${src.dist.dir}">
- <include name="**/.sh"/>
- <include name="**/.pl"/>
- <include name="**/.py"/>
- <include name="**/ant"/>
- <include name="**/antRun"/>
- </fileset>
- </chmod>
-
- </target>
-
- <!--
- ===================================================================
- Create the binary distribution
- ===================================================================
- -->
- <target name="main_distribution"
- description="--> creates the zip and tar distributions">
- <delete dir="${dist.name}"/>
- <delete dir="${java-repository.dir}"/>
- <mkdir dir="${dist.base}"/>
- <mkdir dir="${dist.base.source}"/>
- <mkdir dir="${dist.base.binaries}"/>
- <mkdir dir="${java-repository.dir}"/>
-
- <antcall inheritAll="false" target="internal_dist">
- <param name="dist.dir" value="${dist.name}"/>
- </antcall>
- <zip destfile="${dist.base.binaries}/${dist.name}-bin.zip">
- <zipfileset dir="${dist.name}/.." filemode="755">
- <include name="${dist.name}/bin/ant"/>
- <include name="${dist.name}/bin/antRun"/>
- <include name="${dist.name}/bin/*.pl"/>
- <include name="${dist.name}/bin/*.py"/>
- </zipfileset>
- <fileset dir="${dist.name}/..">
- <include name="${dist.name}/**"/>
- <exclude name="${dist.name}/bin/ant"/>
- <exclude name="${dist.name}/bin/antRun"/>
- <exclude name="${dist.name}/bin/*.pl"/>
- <exclude name="${dist.name}/bin/*.py"/>
- </fileset>
- </zip>
- <tar longfile="gnu"
- destfile="${dist.base.binaries}/${dist.name}-bin.tar">
- <tarfileset dir="${dist.name}/.." mode="755" username="ant" group="ant">
- <include name="${dist.name}/bin/ant"/>
- <include name="${dist.name}/bin/antRun"/>
- <include name="${dist.name}/bin/*.pl"/>
- <include name="${dist.name}/bin/*.py"/>
- </tarfileset>
- <tarfileset dir="${dist.name}/.." username="ant" group="ant">
- <include name="${dist.name}/**"/>
- <exclude name="${dist.name}/bin/ant"/>
- <exclude name="${dist.name}/bin/antRun"/>
- <exclude name="${dist.name}/bin/*.pl"/>
- <exclude name="${dist.name}/bin/*.py"/>
- </tarfileset>
- </tar>
- <gzip destfile="${dist.base.binaries}/${dist.name}-bin.tar.gz"
- src="${dist.base.binaries}/${dist.name}-bin.tar"/>
- <bzip2 destfile="${dist.base.binaries}/${dist.name}-bin.tar.bz2"
- src="${dist.base.binaries}/${dist.name}-bin.tar"/>
- <delete file="${dist.base.binaries}/${dist.name}-bin.tar"/>
-
- <copy todir="${java-repository.dir}">
- <fileset dir="${dist.name}/lib">
- <include name="ant*.jar"/>
- </fileset>
- <mapper type="glob" from="*.jar" to="*-${version}.jar"/>
- </copy>
- <checksum fileext=".md5">
- <fileset dir="${java-repository.dir}" includes="*${version}.jar"/>
- </checksum>
- <checksum fileext=".sha1" algorithm="SHA">
- <fileset dir="${java-repository.dir}" includes="*${version}.jar"/>
- </checksum>
-
- <delete dir="${dist.name}"/>
- <checksum fileext=".md5">
- <fileset dir="${dist.base.binaries}/">
- <include name="**/*"/>
- <exclude name="**/*.asc"/>
- <exclude name="**/*.md5"/>
- </fileset>
- </checksum>
- <checksum fileext=".sha1" algorithm="SHA">
- <fileset dir="${dist.base.binaries}/">
- <include name="**/*"/>
- <exclude name="**/*.asc"/>
- <exclude name="**/*.md5"/>
- </fileset>
- </checksum>
-
- <antcall inheritAll="false" target="src-dist">
- <param name="src.dist.dir" value="${dist.name}"/>
- </antcall>
- <zip destfile="${dist.base.source}/${dist.name}-src.zip">
- <zipfileset dir="${dist.name}/.." filemode="755">
- <include name="${dist.name}/bootstrap.sh"/>
- <include name="${dist.name}/build.sh"/>
- </zipfileset>
- <fileset dir="${dist.name}/..">
- <include name="${dist.name}/**"/>
- <exclude name="${dist.name}/bootstrap.sh"/>
- <exclude name="${dist.name}/build.sh"/>
- </fileset>
- </zip>
- <tar longfile="gnu"
- destfile="${dist.base.source}/${dist.name}-src.tar">
- <tarfileset dir="${dist.name}/.." mode="755" username="ant" group="ant">
- <include name="${dist.name}/bootstrap.sh"/>
- <include name="${dist.name}/build.sh"/>
- </tarfileset>
- <tarfileset dir="${dist.name}/.." username="ant" group="ant">
- <include name="${dist.name}/**"/>
- <exclude name="${dist.name}/bootstrap.sh"/>
- <exclude name="${dist.name}/build.sh"/>
- </tarfileset>
- </tar>
- <gzip destfile="${dist.base.source}/${dist.name}-src.tar.gz"
- src="${dist.base.source}/${dist.name}-src.tar"/>
- <bzip2 destfile="${dist.base.source}/${dist.name}-src.tar.bz2"
- src="${dist.base.source}/${dist.name}-src.tar"/>
- <delete file="${dist.base.source}/${dist.name}-src.tar"/>
- <delete dir="${dist.name}"/>
- <checksum fileext=".md5">
- <fileset dir="${dist.base.source}/">
- <include name="**/*"/>
- <exclude name="**/*.asc"/>
- <exclude name="**/*.md5"/>
- </fileset>
- </checksum>
- <checksum fileext=".sha1" algorithm="SHA">
- <fileset dir="${dist.base.source}/">
- <include name="**/*"/>
- <exclude name="**/*.asc"/>
- <exclude name="**/*.md5"/>
- </fileset>
- </checksum>
- </target>
-
- <target name="distribution" depends="main_distribution"
- description="--> creates the full Apache Ant distribution">
- </target>
-
- <!--
- ===================================================================
- Upload the distribution to cvs.apache.org for final releases
- ===================================================================
- -->
-
- <target name="init-upload" >
- <fail unless="apache.user" message="set a property apache.user with your apache user"/>
- <fail unless="ssh.passphrase" message="set a property with your ssh passphrase"/>
- <fail unless="ssh.keyfile" message="set a property with your ssh keyfile"/>
- <property name="ssh.knownhosts" location="${user.home}/.ssh/known_hosts" />
- <property name="ssh.host" value="cvs.apache.org"/>
- <property name="ssh.verbose" value="false"/>
- <property name="ssh.base.directory" value="/www/www.apache.org/dist"/>
- <property name="ssh.dist.directory" value="${ssh.base.directory}/ant"/>
- <property name="ssh.jars.directory" value="${ssh.base.directory}/java-repository/ant/jars"/>
- <echo >
- Uploading Ant version ${version}
- to host ${ssh.host} as ${apache.user}
- distribution to ${ssh.dist.directory}
- JAR files to ${ssh.jars.directory}
- Known hosts = ${ssh.knownhosts}
- </echo>
- </target>
-
- <!-- create the directories if absent-->
- <target name="ssh-mkdirs"
- depends="init-upload">
- <sshexec username="${apache.user}" host="${ssh.host}"
- keyfile="${ssh.keyfile}" passphrase="${ssh.passphrase}"
- knownhosts="${ssh.knownhosts}"
- command="mkdir -p ${ssh.dist.directory}" />
- <sshexec username="${apache.user}" host="${ssh.host}"
- keyfile="${ssh.keyfile}" passphrase="${ssh.passphrase}"
- knownhosts="${ssh.knownhosts}"
- command="mkdir -p ${ssh.jars.directory}"/>
- </target>
-
- <target name="upload" description="--> uploads the distribution"
- depends="init-upload,ssh-mkdirs">
- <scp todir="${apache.user}@${ssh.host}:${ssh.dist.directory}"
- keyfile="${ssh.keyfile}" passphrase="${ssh.passphrase}"
- knownhosts="${ssh.knownhosts}"
- verbose="${ssh.verbose}" >
- <fileset dir="${dist.base}">
- <include name="**/*${version}*"/>
- </fileset>
- </scp>
- <scp todir="${apache.user}@${ssh.host}:${ssh.jars.directory}"
- keyfile="${ssh.keyfile}" passphrase="${ssh.passphrase}"
- knownhosts="${ssh.knownhosts}"
- verbose="${ssh.verbose}">
- <fileset dir="java-repository/ant/jars">
- <include name="*${version}*"/>
- </fileset>
- </scp>
- </target>
-
- <!--
- ===================================================================
- Cleans up build and distribution directories
- ===================================================================
- -->
- <target name="clean"
- description="--> cleans up build and dist directories">
- <delete dir="${build.dir}"/>
- <delete dir="${dist.base}"/>
- <delete dir="${dist.dir}"/>
- <delete>
- <fileset dir="." includes="**/*~" defaultexcludes="no"/>
- </delete>
- </target>
-
- <!--
- ===================================================================
- Cleans everything
- ===================================================================
- -->
- <target name="allclean"
- depends="clean"
- description="--> cleans up everything">
- <delete file="${bootstrap.dir}/bin/antRun"/>
- <delete file="${bootstrap.dir}/bin/antRun.bat"/>
- <delete file="${bootstrap.dir}/bin/*.pl"/>
- <delete file="${bootstrap.dir}/bin/*.py"/>
- </target>
-
- <!--
- ===================================================================
- Installs Apache Ant
- ===================================================================
- -->
- <target name="install" if="ant.install">
- <antcall inheritAll="false" target="internal_dist">
- <param name="dist.dir" value="${ant.install}"/>
- </antcall>
- </target>
-
- <target name="install-lite" if="ant.install">
- <antcall inheritAll="false" target="dist-lite">
- <param name="dist.dir" value="${ant.install}"/>
- </antcall>
- </target>
-
- <!--
- ===================================================================
- Creates the API documentation
- ===================================================================
- -->
- <target name="javadoc_check">
- <uptodate property="javadoc.notrequired"
- targetfile="${build.javadocs}/packages.html">
- <srcfiles dir="${java.dir}" includes="**/*.java"/>
- </uptodate>
- <uptodate property="tests.javadoc.notrequired"
- targetfile="${build.tests.javadocs}/packages.html">
- <srcfiles dir="${tests.dir}">
- <patternset refid="useful.tests"/>
- </srcfiles>
- </uptodate>
- </target>
-
- <target name="javadocs" depends="prepare, javadoc_check"
- unless="javadoc.notrequired"
- description="--> creates the API documentation">
- <mkdir dir="${build.javadocs}"/>
- <javadoc useexternalfile="yes"
- destdir="${build.javadocs}"
- author="true"
- version="true"
- locale="en"
- windowtitle="${Name} API"
- doctitle="${Name}">
-
- <packageset dir="${java.dir}"/>
-
- <tag name="todo" description="To do:" scope="all"/>
- <tag name="ant.task" enabled="false" description="Task:" scope="types"/>
- <tag name="ant.datatype" enabled="false" description="Data type:" scope="types"/>
- <tag name="ant.attribute" enabled="false" description="Attribute:" scope="types"/>
- <tag name="ant.attribute.group" enabled="false" description="Attribute group:" scope="types"/>
- <tag name="ant.element" enabled="false" description="Nested element:" scope="types"/>
- <group title="Apache Ant Core" packages="org.apache.tools.ant*"/>
- <group title="Core Tasks" packages="org.apache.tools.ant.taskdefs*"/>
- <group title="Core Types" packages="org.apache.tools.ant.types*"/>
- <group title="Optional Tasks" packages="org.apache.tools.ant.taskdefs.optional*"/>
- <group title="Optional Types" packages="org.apache.tools.ant.types.optional*"/>
- <group title="Ant Utilities" packages="org.apache.tools.ant.util*"/>
-
- <bottom>Copyright © 2000-${year} Apache Software Foundation. All Rights Reserved.</bottom>
- </javadoc>
- </target>
-
- <target name="test-javadocs" depends="prepare, javadoc_check"
- unless="tests.javadoc.notrequired"
- description="--> creates the API documentation for test utilities">
- <mkdir dir="${build.tests.javadocs}"/>
- <javadoc useexternalfile="yes"
- destdir="${build.tests.javadocs}"
- author="true"
- version="true"
- locale="en"
- windowtitle="${Name} Test Utilities"
- doctitle="${Name}">
-
- <fileset dir="${tests.dir}">
- <patternset refid="useful.tests"/>
- </fileset>
-
- <bottom>Copyright © 2000-${year} Apache Software Foundation. All Rights Reserved.</bottom>
- </javadoc>
- </target>
-
- <!--
- ===================================================================
- Compile testcases
- ===================================================================
- -->
- <target name="compile-tests" depends="build" if="junit.present">
- <mkdir dir="${build.tests}"/>
-
- <javac srcdir="${tests.dir}"
- destdir="${build.tests}"
- debug="${debug}"
- target="${javac.target}"
- source="${javac.source}"
- deprecation="${deprecation}">
- <classpath refid="tests-classpath"/>
-
- <selector refid="conditional-patterns"/>
- </javac>
-
- <!-- Used by AntlibTest.testAntlibResource: -->
- <jar jarfile="${build.tests}/org/apache/tools/ant/taskdefs/test2-antlib.jar">
- <zipfileset dir="${tests.etc.dir}" fullpath="taskdefs/test.antlib.xml">
- <include name="taskdefs/test2.antlib.xml"/>
- </zipfileset>
- </jar>
- </target>
-
- <target name="dump-info" depends="dump-sys-properties,run-which"/>
-
- <target name="dump-sys-properties" unless="which.present"
- depends="xml-check">
- <echo message="java.vm.info=${java.vm.info}"/>
- <echo message="java.vm.name=${java.vm.name}"/>
- <echo message="java.vm.vendor=${java.vm.vendor}"/>
- <echo message="java.vm.version=${java.vm.version}"/>
- <echo message="os.arch=${os.arch}"/>
- <echo message="os.name=${os.name}"/>
- <echo message="os.version=${os.version}"/>
- <echo message="file.encoding=${file.encoding}"/>
- <echo message="user.language=${user.language}"/>
- </target>
-
- <!-- helper class from Xalan2 to check for jar versioning of xml/xsl processors -->
- <target name="xml-check" depends="check_for_optional_packages"
- if="xalan.envcheck" unless="which.present">
- <java classname="org.apache.xalan.xslt.EnvironmentCheck"/>
- </target>
-
- <target name="run-which" depends="check_for_optional_packages"
- if="which.present">
- <java classname="org.apache.env.Which" taskname="which"/>
- </target>
-
- <!-- test to see if we are online or not. can take a while when we are off line, so
- setting the property is a good shortcut-->
- <target name="probe-offline">
- <condition property="offline">
- <or>
- <isset property="offline"/>
- <not>
- <http url="http://www.apache.org/"/>
- </not>
- </or>
- </condition>
- <echo level="verbose"> offline=${offline}</echo>
- </target>
-
- <!--
- ===================================================================
- Run testcase
- ===================================================================
- -->
- <target name="test" depends="run-tests,run-single-test" description="--> run JUnit tests"/>
-
- <target name="run-tests" depends="dump-info,compile-tests,probe-offline" if="junit.present" unless="testcase">
-
- <condition property="run.junitreport">
- <or>
- <isset property="xalan2.present"/>
- <and>
- <isset property="xalan.present"/>
- <isset property="bsf.present"/>
- </and>
- </or>
- </condition>
-
- <property name="includetests" value="**/*Test*" />
- <property name="excludetests" value="" />
-
- <junit printsummary="${junit.summary}" haltonfailure="${test.haltonfailure}"
- filtertrace="${junit.filtertrace}"
- fork="${junit.fork}" forkmode="${junit.forkmode}"
- failureproperty="tests.failed">
- <!-- <jvmarg value="-classic"/> -->
- <classpath refid="tests-classpath"/>
-
- <sysproperty key="ant.home" value="${ant.home}"/>
- <sysproperty key="build.tests" file="${build.tests}"/>
- <sysproperty key="offline" value="${offline}"/>
- <sysproperty key="build.tests.value" value="${build.tests.value}"/>
- <sysproperty key="tests-classpath.value"
- value="${tests-classpath.value}"/>
- <sysproperty key="root" file="${basedir}"/>
- <sysproperty key="build.compiler" value="${build.compiler}"/>
- <sysproperty key="tests.and.ant.share.classloader"
- value="${tests.and.ant.share.classloader}"/>
- <formatter type="brief" usefile="false"/>
-
- <batchtest>
- <fileset dir="${tests.dir}"
- includes="${includetests}" excludes="${excludetests}">
-
- <!-- abstract classes, not testcases -->
- <exclude name="${taskdefs.package}/TaskdefsTest.java"/>
- <exclude name="${ant.package}/BuildFileTest.java"/>
- <exclude name="${regexp.package}/RegexpMatcherTest.java"/>
- <exclude name="${regexp.package}/RegexpTest.java"/>
- <exclude name="${optional.package}/AbstractXSLTLiaisonTest.java"/>
- <exclude name="${ant.package}/types/AbstractFileSetTest.java"/>
- <exclude name="${ant.package}/types/selectors/BaseSelectorTest.java"/>
-
- <!-- helper classes, not testcases -->
- <exclude name="org/example/**"/>
- <exclude name="${taskdefs.package}/TaskdefTest*Task.java"/>
- <exclude name="${optional.package}/junit/TestFormatter.java"/>
-
- <!-- interactive tests -->
- <exclude name="${taskdefs.package}/TestProcess.java"/>
- <exclude name="${optional.package}/splash/SplashScreenTest.java"/>
-
- <!-- only run these tests if their required libraries are
- installed -->
- <selector refid="conditional-patterns"/>
-
- <!-- tests excluded if the test is run in offline mode -->
- <patternset refid="onlinetests"/>
-
- <!-- failing tests excluded unless run.failing.tests is set -->
- <patternset refid="teststhatfail"/>
-
- <!-- runtime dependencies that are different from compile
- time dependencies -->
- <exclude name="${optional.package}/ReplaceRegExpTest.java"
- unless="some.regexp.support"/>
- <exclude name="${optional.package}/sitraka/*.java"
- unless="some.regexp.support"/>
- <exclude name="${ant.package}/types/selectors/ContainsRegexpTest.java"
- unless="some.regexp.support"/>
- <exclude name="${ant.package}/types/mappers/RegexpPatternMapperTest.java"
- unless="some.regexp.support"/>
- <exclude name="${optional.package}/Rhino*.java"
- unless="bsf.present"/>
- <exclude name="${optional.package}/Rhino*.java"
- unless="rhino.present"/>
- <exclude name="${optional.package}/script/*.java"
- unless="bsf.present"/>
- <exclude name="${optional.package}/script/*.java"
- unless="rhino.present"/>
- <exclude name="${optional.package}/BeanShellScriptTest.java"
- unless="bsf.present"/>
- <exclude name="${optional.package}/BeanShellScriptTest.java"
- unless="beanshell.present"/>
- <exclude name="${optional.type.package}/Script*.java"
- unless="bsf.present"/>
- <exclude name="${optional.type.package}/Script*.java"
- unless="rhino.present"/>
-
- <!-- fail if testcases can be loaded from the system classloader -->
- <exclude name="${ant.package}/AntClassLoaderDelegationTest.java"
- if="tests.are.on.system.classpath"/>
- <exclude name="${optional.package}/junit/JUnitClassLoaderTest.java"
- if="tests.are.on.system.classpath"/>
- <exclude name="${optional.package}/sitraka/XMLReportTest.java"
- if="tests.are.on.system.classpath"/>
-
- <!-- these tests need to be localised before being ran???? -->
- <exclude name="${optional.package}/PvcsTest.java"/>
-
- <!-- These tests need a TraX implementation like xalan2 or saxon -->
- <exclude name="${optional.package}/TraXLiaisonTest.java"
- unless="trax.impl.present"/>
- <exclude name="${optional.package}/XsltTest.java"
- unless="trax.impl.present"/>
- <exclude name="${ant.package}/types/XMLCatalogBuildFileTest.java"
- unless="trax.impl.present"/>
- <exclude name="${optional.package}/junit/JUnitReportTest.java"
- unless="run.junitreport"/>
- <exclude name="${taskdefs.package}/StyleTest.java"
- unless="trax.impl.present"/>
-
- <!-- needs BSF to work -->
- <exclude name="${optional.package}/XalanLiaisonTest.java"
- unless="bsf.present"/>
- <exclude name="${optional.package}/XalanLiaisonTest.java"
- unless="xerces1.present"/>
- <exclude name="${optional.package}/XslpLiaisonTest.java"
- unless="xerces1.present"/>
-
- <!-- needs resolver.jar to work -->
- <exclude name="${optional.package}/XmlValidateCatalogTest.java"
- unless="apache.resolver.present"/>
-
- <!-- needs jasperc -->
- <exclude name="${optional.package}/JspcTest.java"
- unless="jasper.present"/>
-
- <!-- misc oneoff tests -->
- <exclude name="${optional.package}/WsdlToDotnetTest.java"
- unless="dotnetapps.found"/>
- <exclude name="${optional.package}/DotnetTest.java"
- unless="dotnetapps.found"/>
-
- <!-- These tests only passes if testcases and Ant classes have
- been loaded by the same classloader - will throw
- IllegalAccessExceptions otherwise. -->
- <exclude name="${ant.package}/DirectoryScannerTest.java"
- unless="tests.and.ant.share.classloader"/>
- <exclude name="${taskdefs.package}/SQLExecTest.java"
- unless="tests.and.ant.share.classloader"/>
- <exclude name="${taskdefs.package}/cvslib/ChangeLogWriterTest.java"
- unless="tests.and.ant.share.classloader"/>
- <exclude name="${taskdefs.package}/cvslib/ChangeLogParserTest.java"
- unless="tests.and.ant.share.classloader"/>
- <exclude name="${optional.package}/sos/SOSTest.java"
- unless="tests.and.ant.share.classloader"/>
- <exclude name="${optional.package}/vss/MSVSSTest.java"
- unless="tests.and.ant.share.classloader"/>
- <exclude name="${optional.package}/TraXLiaisonTest.java"
- unless="tests.and.ant.share.classloader"/>
- <exclude name="${optional.package}/metamata/MAuditParserTest.java"
- unless="tests.and.ant.share.classloader"/>
- <exclude name="${taskdefs.package}/ProcessDestroyerTest.java"
- unless="tests.and.ant.share.classloader"/>
- <exclude name="${taskdefs.package}/ProtectedJarMethodsTest.java"
- unless="tests.and.ant.share.classloader"/>
-
- <!-- can only run if cvs is installed on your machine
- enable by setting the property have.cvs
- -->
- <exclude name="${taskdefs.package}/AbstractCvsTaskTest.java"
- unless="have.cvs"/>
-
- <!-- needs a local ftp server and the entry of a user/password combination -->
- <exclude name="${optional.package}/net/FTPTest.java"/>
-
- <!-- test needs special setup -->
- <exclude name="${optional.package}/ssh/ScpTest.java"/>
-
- <!-- test fails if build/classes and ant.jar are using the same
- classloader -->
- <exclude name="${ant.package}/util/ClasspathUtilsTest.java"
- if="tests.and.ant.share.classloader"/>
- </fileset>
- </batchtest>
- </junit>
- <fail if="tests.failed">At least one test has failed.</fail>
- </target>
-
- <target name="run-single-test" if="testcase" depends="compile-tests,run-single-test-only"
- description="--> runs the single unit test defined in the testcase property"/>
-
- <target name="run-single-test-only" if="testcase"
- description="--> runs the single unit test defined in the testcase property">
-
-
- <junit printsummary="${junit.summary}"
- haltonfailure="${test.haltonfailure}"
- fork="${junit.fork}"
- filtertrace="${junit.filtertrace}">
- <!-- <jvmarg value="-classic"/> -->
- <sysproperty key="ant.home" value="${ant.home}"/>
- <sysproperty key="build.tests" file="${build.tests}"/>
- <sysproperty key="build.tests.value" value="${build.tests.value}"/>
- <sysproperty key="offline" value="${offline}"/>
- <sysproperty key="tests-classpath.value"
- value="${tests-classpath.value}"/>
- <sysproperty key="root" file="${basedir}"/>
- <sysproperty key="build.compiler" value="${build.compiler}"/>
- <sysproperty key="tests.and.ant.share.classloader"
- value="${tests.and.ant.share.classloader}"/>
- <classpath refid="tests-classpath"/>
- <formatter type="plain" usefile="false"/>
- <test name="${testcase}"/>
- </junit>
- </target>
-
- <target name="interactive-tests" description="--> runs interactive tests"
- depends="compile-tests"
- if="jdk1.3+">
- <java classpathref="tests-classpath"
- classname="org.apache.tools.ant.taskdefs.TestProcess"
- fork="true"/>
- </target>
-
- <!--
- ===================================================================
- Main target - runs dist-lite by default
- ===================================================================
- -->
- <target name="main"
- description="--> creates a minimum distribution in ./dist"
- depends="dist-lite"/>
-
- </project>
|