pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gianmarco De Francisci Morales (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PIG-2362) Rework Ant build.xml to use macrodef instead of antcall
Date Fri, 04 Jan 2013 09:16:16 GMT

    [ https://issues.apache.org/jira/browse/PIG-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13543726#comment-13543726
] 

Gianmarco De Francisci Morales commented on PIG-2362:
-----------------------------------------------------

Hi Cheolsoo,

Good catch, thanks. I wasn't familiar with PIG-2748.
I verified that {{ant mvn-jar}} passes.
Also ran the {{eclipse-files}}, {{src-release}}, {{tar-release}} targets and verified their
output.

+1 to the last patch
                
> 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
>             Fix For: 0.12
>
>         Attachments: PIG-2362.10.patch, PIG-2362.1.patch, PIG-2362.2.patch, PIG-2362.3.patch,
PIG-2362.4.patch, PIG-2362.5.patch, PIG-2362.6.patch, PIG-2362.7.patch, PIG-2362.8.patch,
PIG-2362.9.patch, PIG-2362.9.patch.nowhitespace
>
>
> 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
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message