blob: a0c20dd4faaf4e5b1a962bafebb790e85cc6fc89 [file] [log] [blame]
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
-->
<project name="bootstrap" default="run" xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="bootstrap.dir" value="${basedir}/target/bootstrap"/>
<property name="version" value="0.9-incubating" />
<target name="ivy:init">
<mkdir dir="${bootstrap.dir}"/>
<property name="ivy.version" value="2.4.0"/>
<mkdir dir="${user.home}/.ivy2/jars" />
<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar" dest="${user.home}/.ivy2/jars/ivy-${ivy.version}.jar" usetimestamp="true"/>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${user.home}/.ivy2/jars/ivy-${ivy.version}.jar" />
</target>
<target name="clean-cache">
<delete dir ="${user.home}/.easyant/easyant-cache" failonerror="false"/>
<delete dir ="${user.home}/.easyant/project-cache" failonerror="false"/>
</target>
<target name="clean" depends="clean-cache">
<delete dir="${bootstrap.dir}" failonerror="false" />
</target>
<target name="clean-all" depends="clean-cache">
<delete dir="${basedir}/target" failonerror="false"/>
</target>
<target name="compile" depends="ivy:init">
<ivy:configure file="${basedir}/ivysettings-bootstrap.xml" />
<ivy:resolve file="${basedir}/module.ivy" />
<ivy:cachepath pathid="default.classpath" conf="default" />
<mkdir dir="${bootstrap.dir}/classes" />
<javac srcdir="${basedir}/src/main/java" destdir="${bootstrap.dir}/classes" includeantruntime="false" debug="true">
<classpath refid="default.classpath" />
</javac>
<copy todir="${bootstrap.dir}/classes">
<fileset dir="${basedir}/src/main/resources" />
</copy>
<ivy:info file="${basedir}/module.ivy" />
<tstamp>
<format property="now" pattern="yyyyMMddHHmmss" />
</tstamp>
<property name="version" value="${ivy.revision}-build-${now}" />
<propertyfile file="${bootstrap.dir}/classes/META-INF/version.properties" comment="Generated by easyant">
<entry key="APPLICATION-NAME" value="${ivy.module}" />
<entry key="SPEC-VERSION" value="${ivy.revision}" />
<entry key="APPLICATION_ORG" value="${ivy.organisation}" />
<entry key="VERSION" value="${version}" />
<entry key="DATE" type="date" value="now" />
</propertyfile>
</target>
<target name="jar" depends="compile">
<jar destfile="${bootstrap.dir}/easyant.jar" basedir="${bootstrap.dir}/classes" />
</target>
<target name="run" depends="jar">
<property name="target" value="distribution" />
<property name="bootstrap.fork" value="false" />
<java classname="org.apache.easyant.core.EasyAntMain" failonerror="true" fork="${bootstrap.fork}">
<classpath>
<path refid="default.classpath" />
<pathelement location="${bootstrap.dir}/easyant.jar" />
<!--
Ant will try to find the tools.jar using java.home System property, but sometimes
this points to JDK, and sometimes to JRE.
See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4200300
-->
<path path="${java.class.path}"/>
</classpath>
<sysproperty key="easyant.home" file="${basedir}" />
<arg line="-configfile ${basedir}/easyant-conf.xml" />
<arg line="-f ${basedir}/module.ivy" />
<arg line="-Dskip.svn=true"/>
<arg line="-Dversion=${version}"/>
<arg line="${target}" />
</java>
</target>
</project>