[ http://jira.codehaus.org/browse/MERCURY-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=157315#action_157315 ]
Oleg Gusakov edited comment on MERCURY-48 at 12/10/08 2:25 PM: --------------------------------------------------------------- The proposed syntax looks like this {code:xml|title=build.xml|borderStyle=solid} <project name="test" default="compile-tests" xmlns:merc="antlib:org.apache.maven.mercury.ant.tasks" > <!-- this example does not include <merc:write .../> task, which will be used to install / deploy artifacts into repositories nor this example show how to configure artifact validation - for the sake of simplicity --> <target name="init"> <property name="config.name" value="home-config"/> <property name="java.version" value="1.5"/> <property name="src" value="${basedir}/src/main/java"/> <property name="target" value="${basedir}/target/classes"/> <property name="test.src" value="${basedir}/src/test/java"/> <property name="test.target" value="${basedir}/target/test-classes"/> <!-- | configration: repositories, ?possibly profiles --> <merc:config id="work-config"> <!-- local repo (indicated by dir) of default type --> <merc:repo id="localRepo" dir="/app/maven.repo"/> <!-- remote repo (indicated by url) of explicit m2 type --> <merc:repo type="m2" id="central" url="http://repo1.maven.org/maven2"/> </merc:config> <merc:config id="home-config"> <!-- local repo (indicated by dir) of default type --> <merc:repo id="localRepo" dir="/app/maven.repo"/> <!-- remote repo (indicated by url) of default type (m2) --> <merc:repo id="central" url="http://localhost:8081/nexus/contents/groups/public"/> </merc:config> <!-- | another way to get configuration | to be implemented later on --> <merc:config id="demo-config" file="~/.m2/settings.xml"/> <!-- | dependency sets, identified and referred to by id - path-like structure declarations --> <merc:dep id="my-libs"> <!-- coordinates as string, explicit default namespace --> <merc:dependency name="ant:ant:1.6.5" xmlns="http://maven.apache.org/mercury/1"/> <!-- | a set of dependencies from a pom | | will be implemented last as mercury does not know | about POMs - this will be a special read-only repository type --> <merc:dependency name="org.apache.maven:maven:3.0-SNAPSHOT" pom="${basedir}/pom.xml"/> </merc:dep> </target> <target name="compile" depends="init"> <!-- | this is the workhorse task - creates a classpath named "compile-path" | and adds all the transitive dependencies from "my-libs" in compile scope --> <merc:resolve pathid="compile-path" depref="my-libs" configref="${config.name}" /> <javac srcdir="${src}" destdir="${target}" classpathref="compile-path" debug="on" source="${java.version}" /> </target> <target name="compile-tests" depends="compile"> <!-- | this is the workhorse task - creates a classpath named "test-path" | and adds all the transitive dependencies from "my-libs" in test scope --> <merc:resolve pathid="test-path" depref="my-libs" configref="${config.name}" scope="test" /> <javac srcdir="${test.src}" destdir="${test.target}" classpathref="test-path" debug="on" source="${java.version}" /> </target> <target name="deploy" depends="compile"> <merc:write repoid="localRepo" bin="${target}/t.jar" name="t:t:1.0" /> </target> </project> {code} was (Author: olle): The proposed syntax looks like this {code:xml|title=build.xml|borderStyle=solid} <project name="test" default="compile-tests" xmlns:merc="antlib:org.apache.maven.mercury.ant.tasks" > <!-- this example does not include <merc:write .../> task, which will be used to install / deploy artifacts into repositories nor this example show how to configure artifact validation - for the sake of simplicity --> <target name="init"> <property name="config.name" value="home-config"/> <property name="java.version" value="1.5"/> <property name="src" value="${basedir}/src/main/java"/> <property name="target" value="${basedir}/target/classes"/> <property name="test.src" value="${basedir}/src/test/java"/> <property name="test.target" value="${basedir}/target/test-classes"/> <!-- | configration: repositories, ?possibly profiles --> <merc:config id="work-config"> <!-- local repo (indicated by dir) of default type --> <merc:repo id="localRepo" dir="/app/maven.repo"/> <!-- remote repo (indicated by url) of explicit m2 type --> <merc:repo type="m2" id="central" url="http://repo1.maven.org/maven2"/> </merc:config> <merc:config id="home-config"> <!-- local repo (indicated by dir) of default type --> <merc:repo id="localRepo" dir="/app/maven.repo"/> <!-- remote repo (indicated by url) of default type (m2) --> <merc:repo id="central" url="http://localhost:8081/nexus/contents/groups/public"/> </merc:config> <!-- | another way to get configuration | to be implemented later on --> <merc:config id="demo-config" file="~/.m2/settings.xml"/> <!-- | dependency sets, identified and referred to by id - path-like structure declarations --> <merc:dep id="my-libs"> <!-- coordinates as string, explicit default namespace --> <merc:dependency name="ant:ant:1.6.5" xmlns="http://maven.apache.org/mercury/1"/> <!-- | a set of dependencies from a pom | | will be implemented last as mercury does not know | about POMs - this will be a special read-only repository type --> <merc:dependency name="org.apache.maven:maven:3.0-SNAPSHOT" pom="${basedir}/pom.xml"/> </merc:dep> </target> <target name="compile" depends="init"> <!-- | this is the workhorse task - creates a classpath named "compile-path" | and adds all the transitive dependencies from "my-libs" in compile scope --> <merc:resolve pathid="compile-path" depref="my-libs" configref="${config.name}" /> <javac srcdir="${src}" destdir="${target}" classpathref="compile-path" debug="on" source="${java.version}" /> </target> <target name="compile-tests" depends="compile"> <!-- | this is the workhorse task - creates a classpath named "test-path" | and adds all the transitive dependencies from "my-libs" in test scope --> <merc:resolve pathid="test-path" depref="my-libs" configref="${config.name}" scope="test" /> <javac srcdir="${test.src}" destdir="${test.target}" classpathref="test-path" debug="on" source="${java.version}" /> </target> </project> {code} > Document and vet the design > --------------------------- > > Key: MERCURY-48 > URL: http://jira.codehaus.org/browse/MERCURY-48 > Project: Mercury > Issue Type: Sub-task > Components: Ant tasks > Reporter: Oleg Gusakov > Assignee: Oleg Gusakov > Original Estimate: 2 days > Time Spent: 1 day > Remaining Estimate: 1 day > -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira