Permalink
Fetching contributors…
Cannot retrieve contributors at this time
60 lines (50 sloc) 2.64 KB
<?xml version="1.0" encoding="UTF-8"?>
<project default="get.elixir" name="elixir">
<dirname property="elixir.basedir" file="${ant.file.elixir}"/>
<property environment="env"/>
<property name="elixir.version" value="${env.ELIXIR_VERSION}"/>
<property name="elixir.output.dir" value="${elixir.basedir}/dependencies/elixir"/>
<property name="elixir.sha1" value="v${elixir.version}"/>
<property name="elixir.zip" value="${elixir.sha1}.zip"/>
<property name="elixir.cache" value="${elixir.basedir}/cache/elixir"/>
<property name="elixir.zip.root.basename" value="elixir-${elixir.version}"/>
<property name="elixir.output.zip.root.dir" value="${elixir.output.dir}/${elixir.zip.root.basename}"/>
<available file="${elixir.output.zip.root.dir}" property="elixir.output.zip.root.available"/>
<available file="${elixir.output.dir}/${elixir.zip}" property="elixir.zip.available"/>
<target name="clean.elixir">
<delete quiet="true">
<fileset dir="${elixir.output.dir}"/>
<fileset dir="${elixir.cache}"/>
</delete>
</target>
<target name="get.elixir" depends="unpack.elixir.zip" description="Get Elixir ${elixir.sha1} from Github">
<copy todir="${elixir.cache}">
<fileset dir="${elixir.output.zip.root.dir}"/>
</copy>
</target>
<target name="set.elixir.code.lib.dir" depends="make.elixir" description="Set elixir.code.lib.dir to :code.lib_dir">
<exec executable="${elixir.output.zip.root.dir}/bin/elixir" outputproperty="elixir.code.lib.dir">
<arg value="-e"/>
<arg value="IO.puts :code.lib_dir"/>
</exec>
</target>
<target name="get.elixir.zip" description="Get Elixir ${elixir.sha1} zip from Github" unless="elixir.zip.available">
<mkdir dir="${elixir.output.dir}"/>
<get dest="${elixir.output.dir}"
src="https://github.com/elixir-lang/elixir/archive/${elixir.zip}"
usetimestamp="true"
verbose="true"/>
</target>
<target name="make.elixir" depends="unpack.elixir.zip" description="Build Elixir">
<exec dir="${elixir.output.zip.root.dir}" executable="make" />
</target>
<target name="unpack.elixir.zip" depends="get.elixir.zip" description="unzip ${elixir.zip}" unless="elixir.output.zip.root.available">
<unzip src="${elixir.output.dir}/${elixir.zip}" dest="${elixir.output.dir}"/>
<chmod perm="u+x">
<file file="${elixir.output.zip.root.dir}/rebar"/>
<fileset dir="${elixir.output.zip.root.dir}/bin">
<exclude name="*.bat"/>
</fileset>
</chmod>
</target>
</project>