You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Alan Gates (Commented) (JIRA)" <ji...@apache.org> on 2011/11/22 18:58:40 UTC
[jira] [Commented] (PIG-2362) Rework Ant build.xml to use macrodef
instead of antcall
[ https://issues.apache.org/jira/browse/PIG-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13155302#comment-13155302 ]
Alan Gates commented on PIG-2362:
---------------------------------
+1, patch looks good. Runs fine with jar, jar-withouthadoop, clean, test, docs, test-e2e, and package
> Rework Ant build.xml to use macrodef instead of antcall
> -------------------------------------------------------
>
> Key: PIG-2362
> URL: https://issues.apache.org/jira/browse/PIG-2362
> Project: Pig
> Issue Type: Improvement
> Reporter: Gianmarco De Francisci Morales
> Assignee: Gianmarco De Francisci Morales
> Priority: Minor
> Attachments: PIG-2362.1.patch
>
>
> Antcall is evil: http://www.build-doctor.com/2008/03/13/antcall-is-evil/
> We'd better use macrodef and let Ant build a clean dependency graph.
> http://ant.apache.org/manual/Tasks/macrodef.html
> Right now we do like this:
> {code}
> <target name="buildAllJars">
> <antcall target="buildJar">
> <param name="build.dir" value="jar-A"/>
> </antcall>
> <antcall target="buildJar">
> <param name="build.dir" value="jar-B"/>
> </antcall>
> <antcall target="buildJar">
> <param name="build.dir" value="jar-C"/>
> </antcall>
> </target>
> <target name="buildJar">
> <jar destfile="target/${build.dir}.jar" basedir="${build.dir}/classfiles"/>
> </target>
> {code}
> But it would be better if we did like this:
> {code}
> <target name="buildAllJars">
> <buildJar build.dir="jar-A"/>
> <buildJar build.dir="jar-B"/>
> <buildJar build.dir="jar-C"/>
> </target>
> <macrodef name="buildJar">
> <attribute name="build.dir"/>
> <jar destfile="target/${build.dir}.jar" basedir="${build.dir}/classfiles"/>
> </macrodef>
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira