Ivy: Difference between revisions
Jump to navigation
Jump to search
Line 10: | Line 10: | ||
<source lang="xml"> | <source lang="xml"> | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<project name="chorke" default="cki. | <project name="chorke" default="cki.ini" basedir="." | ||
xmlns:ivy="antlib:org.apache.ivy.ant" | |||
xmlns:ac="antlib:net.sf.antcontrib"> | |||
<description>chorke ant ivy impl</description> | |||
<property name="ant.dir" location="${basedir}/ant"/> | <property name="ant.dir" location="${basedir}/ant"/> | ||
<property name="ant.lib" location="${user.home}/.ant/lib"/> | <property name="ant.lib" location="${user.home}/.ant/lib"/> | ||
Line 20: | Line 22: | ||
<property name="central.proxy" value="${sonatype.local}/artifact/maven/redirect?r=central-proxy"/> | <property name="central.proxy" value="${sonatype.local}/artifact/maven/redirect?r=central-proxy"/> | ||
<available file="${ant.lib}/ivy.jar" property="ivy.jar.exist"/> | |||
<condition property="ivy.jar.not.exist"> | <condition property="ivy.jar.not.exist"> | ||
<not> <available file="${ant.lib}/ivy.jar"/></not> | <not> | ||
<available file="${ant.lib}/ivy.jar"/> | |||
</not> | |||
</condition> | </condition> | ||
<target name="cki.log"> | |||
<script language="javascript" src="${ant.dir}/build.js"> | <script language="javascript" src="${ant.dir}/build.js"> | ||
Chorke.ant.init(true); | Chorke.ant.init(true); | ||
Line 30: | Line 35: | ||
</target> | </target> | ||
<target name="cki. | <target name="cki.get" depends="cki.log" if="ivy.jar.not.exist"> | ||
<mkdir dir="${ant.lib}"/> | <mkdir dir="${ant.lib}"/> | ||
<get src="${central.proxy}&g=org.apache.ivy&a=ivy&v=2.3.0&e=jar" dest="${ant.lib}/ivy.jar"/> | <get src="${central.proxy}&g=org.apache.ivy&a=ivy&v=2.3.0&e=jar" dest="${ant.lib}/ivy.jar"/> | ||
</target> | </target> | ||
<target name="cki.ivy" depends="cki.get" if="ivy.jar.exist"> | |||
<ivy:resolve/> | <ivy:resolve/> | ||
<ivy:report todir= | <ivy:report todir="${basedir}/target/ivy-reports" graph="false" xml="false"/> | ||
<ivy:cachepath pathid="compile.path" conf="compile"/> | <ivy:cachepath pathid="compile.path" conf="compile"/> | ||
<ivy:cachepath pathid="runtime.path" conf="runtime"/> | <ivy:cachepath pathid="runtime.path" conf="runtime"/> | ||
Line 44: | Line 49: | ||
</target> | </target> | ||
<target name="cki.def" depends="cki.ivy" if="ivy.jar.exist"> | |||
<taskdef uri="antlib:net.sf.antcontrib" classpathref="build.path"/> | <taskdef uri="antlib:net.sf.antcontrib" classpathref="build.path"/> | ||
</target> | </target> | ||
<target name="cki.dep" if="ivy.jar.exist"> | |||
<echo message="Hello, world"/> | <echo message="Hello, world"/> | ||
<echo message="The first five letters of the alphabet are:"/> | <echo message="The first five letters of the alphabet are:"/> | ||
Line 58: | Line 63: | ||
</target> | </target> | ||
<target name="cki.ini" depends="cki.def"> | |||
<sequential> | <sequential> | ||
<antcall target="cki.dep"/> | <antcall target="cki.dep"/> |
Revision as of 10:06, 18 September 2019
├─ build.xml ├─ ivysettings.xml ├─ ivy.xml └─ ant ├─ build.js └─ build.properties
Ant Build
build.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="chorke" default="cki.ini" basedir="."
xmlns:ivy="antlib:org.apache.ivy.ant"
xmlns:ac="antlib:net.sf.antcontrib">
<description>chorke ant ivy impl</description>
<property name="ant.dir" location="${basedir}/ant"/>
<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"/>
<available file="${ant.lib}/ivy.jar" property="ivy.jar.exist"/>
<condition property="ivy.jar.not.exist">
<not>
<available file="${ant.lib}/ivy.jar"/>
</not>
</condition>
<target name="cki.log">
<script language="javascript" src="${ant.dir}/build.js">
Chorke.ant.init(true);
</script>
</target>
<target name="cki.get" depends="cki.log" if="ivy.jar.not.exist">
<mkdir dir="${ant.lib}"/>
<get src="${central.proxy}&g=org.apache.ivy&a=ivy&v=2.3.0&e=jar" dest="${ant.lib}/ivy.jar"/>
</target>
<target name="cki.ivy" depends="cki.get" if="ivy.jar.exist">
<ivy:resolve/>
<ivy:report todir="${basedir}/target/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.ivy" if="ivy.jar.exist">
<taskdef uri="antlib:net.sf.antcontrib" classpathref="build.path"/>
</target>
<target name="cki.dep" if="ivy.jar.exist">
<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.ini" depends="cki.def">
<sequential>
<antcall target="cki.dep"/>
</sequential>
</target>
</project>
Settings
ivysettings.xml
<ivysettings>
<settings defaultResolver="central"/>
<credentials host="mvn.chorke.org" realm="Authorization" username="user" passwd="pass"/>
<resolvers>
<ibiblio name="central" m2compatible="true"/>
<ibiblio name="chorke.releases" root="http://mvn.chorke.org/m2/releases/" m2compatible="true"/>
</resolvers>
<modules>
<module organisation="org.chorke.ecma" resolver="chorke.releases"/>
</modules>
</ivysettings>
Settings
ivy.xml
<ivy-module version="2.0">
<info organisation="org.chorke.make" module="chorke-make-migrat"/>
<configurations>
<conf name="compile" description="compile time dependencies"/>
<conf name="runtime" description="run-time dependencies" extends="compile"/>
<conf name="test" description="test only dependencies" extends="runtime"/>
<conf name="build" description="ant dependencies"/>
</configurations>
<dependencies>
<dependency org="org.slf4j" name="slf4j-api" rev="1.6.4" conf="compile->default"/>
<dependency org="org.slf4j" name="slf4j-simple" rev="1.6.4" conf="runtime->default"/>
<dependency org="junit" name="junit" rev="4.10" conf="test->default"/>
<dependency org="ant-contrib" name="ant-contrib" rev="1.0b3" conf="build->default"/>
</dependencies>
</ivy-module>