Ivy

From Chorke Wiki
Revision as of 11:11, 17 September 2019 by Shahed (talk | contribs) (Created page with "==Ant Build== <code>build.xml</code> <source lang="xml"> <?xml version="1.0" encoding="UTF-8" standalone="no"?> <project name="chorke" default="cki.init" basedir="." xmlns:ivy...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Ant Build

build.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="chorke" default="cki.init" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:ac="antlib:net.sf.antcontrib">
    <description>chorke ant.js deployment implementation</description>
    <property name="ant.lib" location="${user.home}/.ant/lib"/>
    <property name="chorke.home" location="${user.home}/.chorke"/>
    <property name="academia.home" location="${chorke.home}/academia"/>
    <property name="sonatype.local" value="https://repository.sonatype.org/service/local"/>
    <property name="central.proxy" value="${sonatype.local}/artifact/maven/redirect?r=central-proxy"/>
    <condition property="ivy.jar.not.exist">
        <not> <available file="${ant.lib}/ivy.jar"/></not>
    </condition>

     <target name="cki.logo">
        <script language="javascript" src="${ant.dir}/build.js">
            Chorke.ant.init(true);
        </script>
    </target>

    <target name="cki.ivy" depends="cki.logo" if="ivy.jar.not.exist"> 
        <mkdir dir="${ant.lib}"/>
        <get src="${central.proxy}&amp;g=org.apache.ivy&amp;a=ivy&amp;v=2.3.0&amp;e=jar" dest="${ant.lib}/ivy.jar"/>
    </target>

     <target name="cki.ins" depends="cki.ivy">
        <ivy:resolve/>
        <ivy:report todir='build/ivy-reports' graph='false' xml='false'/>
        <ivy:cachepath pathid="compile.path" conf="compile"/>
        <ivy:cachepath pathid="runtime.path" conf="runtime"/>
        <ivy:cachepath pathid="build.path" conf="build"/>
        <ivy:cachepath pathid="test.path" conf="test"/>
    </target>

     <target name="cki.def" depends="cki.ins">
        <taskdef uri="antlib:net.sf.antcontrib" classpathref="build.path"/>
    </target>

     <target name="cki.dep">
        <echo message="Hello, world"/>
        <echo message="The first five letters of the alphabet are:"/>
        <ac:for list="a,b,c,d,e" param="letter">
            <sequential>
                <echo>Letter @{letter}</echo>
            </sequential>
        </ac:for>
    </target>

     <target name="cki.init" depends="cki.def">
        <sequential>
            <antcall target="cki.dep"/>
        </sequential>
    </target>
</project>