You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Gianmarco De Francisci Morales (Created) (JIRA)" <ji...@apache.org> on 2011/11/14 17:09:51 UTC

[jira] [Created] (PIG-2362) Rework Ant build.xml to use macrodef instead of antcall

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


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

        

[jira] [Updated] (PIG-2362) Rework Ant build.xml to use macrodef instead of antcall

Posted by "Gianmarco De Francisci Morales (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gianmarco De Francisci Morales updated PIG-2362:
------------------------------------------------

    Attachment: PIG-2362.4.patch

Rebased once again :)

                
> 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.11
>
>         Attachments: PIG-2362.1.patch, PIG-2362.2.patch, PIG-2362.3.patch, PIG-2362.4.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

        

[jira] [Updated] (PIG-2362) Rework Ant build.xml to use macrodef instead of antcall

Posted by "Cheolsoo Park (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Cheolsoo Park updated PIG-2362:
-------------------------------

    Fix Version/s:     (was: 0.11)

I don't think that we want to backport this to branch-0.11, so I am un-linking from 0.11. Please let me know if anyone think otherwise. I will post a patch for 0.11.

p.s. A typo correction in my previous comment. The command which I compared the diff of is:
{code}
jar -tvf pig-withouthadoop.jar | awk '{print $8}'
{code}
Pig.jar has extra contents because I incorporated PIG-2979.
                
> 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.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
>
>
> 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

[jira] [Updated] (PIG-2362) Rework Ant build.xml to use macrodef instead of antcall

Posted by "Gianmarco De Francisci Morales (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gianmarco De Francisci Morales updated PIG-2362:
------------------------------------------------

    Attachment: PIG-2362.2.patch

Attaching PIG-2362.2.patch
Removed all ant-calls.
Tested with jar, jar-withouthadoop, test, test-e2e, package, docs.

The patch is ready for review.
                
> 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.11
>
>         Attachments: PIG-2362.1.patch, PIG-2362.2.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

        

[jira] [Commented] (PIG-2362) Rework Ant build.xml to use macrodef instead of antcall

Posted by "Gianmarco De Francisci Morales (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13187877#comment-13187877 ] 

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

Fixed the issue for "include-meta" and removed another antcall in the process.
I am waiting for PIG-2349 to be committed in order to rebase the patch as they will most likely step on each other's toes.
                
> 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.11
>
>         Attachments: PIG-2362.1.patch, PIG-2362.2.patch, PIG-2362.3.patch, PIG-2362.4.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

        

[jira] [Commented] (PIG-2362) Rework Ant build.xml to use macrodef instead of antcall

Posted by "Daniel Dai (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13188963#comment-13188963 ] 

Daniel Dai commented on PIG-2362:
---------------------------------

Seems still get some problem with hadoop 23 local mode. To reproduce, run Pig with hadoop23 in local mode:
ant -Dhadoopversion=23
pig -x local

Then run a trivial load/dump. 

Here is the error I see:
Caused by: java.io.IOException: Cannot initialize Cluster. Please check your configuration for mapreduce.framework.name and the correspond server addresses.
        at org.apache.hadoop.mapreduce.Cluster.initialize(Cluster.java:123)
        at org.apache.hadoop.mapreduce.Cluster.<init>(Cluster.java:85)
        at org.apache.hadoop.mapreduce.Cluster.<init>(Cluster.java:78)
        at org.apache.hadoop.mapred.JobClient.init(JobClient.java:476)
        at org.apache.hadoop.mapred.JobClient.<init>(JobClient.java:455)
        at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher.launchPig(MapReduceLauncher.java:155)
        at org.apache.pig.PigServer.launchPlan(PigServer.java:1271)
        ... 11 more

Seems it still has something to do with include-meta. 
                
> 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.11
>
>         Attachments: PIG-2362.1.patch, PIG-2362.2.patch, PIG-2362.3.patch, PIG-2362.4.patch, PIG-2362.5.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

        

[jira] [Updated] (PIG-2362) Rework Ant build.xml to use macrodef instead of antcall

Posted by "Cheolsoo Park (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Cheolsoo Park updated PIG-2362:
-------------------------------

    Fix Version/s: 0.12
    
> 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.11, 0.12
>
>         Attachments: 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
>
>
> 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

[jira] [Commented] (PIG-2362) Rework Ant build.xml to use macrodef instead of antcall

Posted by "Alan Gates (Commented) (JIRA)" <ji...@apache.org>.
    [ 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

        

[jira] [Updated] (PIG-2362) Rework Ant build.xml to use macrodef instead of antcall

Posted by "Cheolsoo Park (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Cheolsoo Park updated PIG-2362:
-------------------------------

    Attachment: PIG-2362.7.patch

I updated the patch based to trunk and fixed a few minor issues. Here is what I did:
- Re-based to trunk.
- Incorporated PIG-2979 to get local mode working with hadoop 2.0.x.
- Incorporated PIG-2885 to preserve it.
- Removed duplicate code in the fileset definitions of included jars for w/ and w/o dependencies using patternset.
- Included joda-time.jar in pig-withouthadoop.jar as well as in pig.jar. It should but wasn't included.
- Fixed a typo in the buildJar macrodef: conf/pig-default.properties => src/pig-default.properties. This was causing e2e test to fail.

Testing done:
- ant jar -Dhadoopversion=[20|23]
- ant test -Dhadoopversion=[20|23]
- ant test-e2e-local -Dhadoopversion=[20|23]
- ant test-e2e -Dhadoopversion=[20|23]
- ant clean
- ant docs

I also confirmed that there is no diff of the following command between before and after:
{code}
jar -tvf pig.jar | awk '{print $8}'
{code}

Thanks!
                
> 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.11
>
>         Attachments: 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
>
>
> 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

[jira] [Commented] (PIG-2362) Rework Ant build.xml to use macrodef instead of antcall

Posted by "Daniel Dai (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13176520#comment-13176520 ] 

Daniel Dai commented on PIG-2362:
---------------------------------

I guess you need to resync again :)
                
> 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.11
>
>         Attachments: PIG-2362.1.patch, PIG-2362.2.patch, PIG-2362.3.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

        

[jira] [Commented] (PIG-2362) Rework Ant build.xml to use macrodef instead of antcall

Posted by "Dmitriy V. Ryaboy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447051#comment-13447051 ] 

Dmitriy V. Ryaboy commented on PIG-2362:
----------------------------------------

Gianmarco, since we have made no progress on mavenizing Pig.. mind taking another crack at this? Seems like we were almost there.
                
> 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.11
>
>         Attachments: PIG-2362.1.patch, PIG-2362.2.patch, PIG-2362.3.patch, PIG-2362.4.patch, PIG-2362.5.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
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (PIG-2362) Rework Ant build.xml to use macrodef instead of antcall

Posted by "Daniel Dai (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13178253#comment-13178253 ] 

Daniel Dai commented on PIG-2362:
---------------------------------

Seems "include-meta" is not being called after patch? This is necessary for hadoop 23.
                
> 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.11
>
>         Attachments: PIG-2362.1.patch, PIG-2362.2.patch, PIG-2362.3.patch, PIG-2362.4.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

        

[jira] [Updated] (PIG-2362) Rework Ant build.xml to use macrodef instead of antcall

Posted by "Gianmarco De Francisci Morales (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gianmarco De Francisci Morales updated PIG-2362:
------------------------------------------------

    Attachment: PIG-2362.6.patch

On trunk, if I compile with -Dhadoopversion=23 and I launch bin/pig -x local I get the following error repeated continuously:
{code}
2012-09-17 22:44:54,287 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2998: Unhandled internal error. Could not initialize class org.apache.pig.tools.pigstats.PigStatsUtil
Details at logfile: /Users/gdfm/workspace/pig/git/pig_1347914693509.log
{code}

Here the stack trace:
{code}
Pig Stack Trace
---------------
ERROR 2998: Unhandled internal error. org/apache/hadoop/mapreduce/task/JobContextImpl

java.lang.NoClassDefFoundError: org/apache/hadoop/mapreduce/task/JobContextImpl
        at org.apache.pig.tools.pigstats.PigStatsUtil.<clinit>(PigStatsUtil.java:54)
        at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:67)
        at org.apache.pig.Main.run(Main.java:538)
        at org.apache.pig.Main.main(Main.java:154)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.mapreduce.task.JobContextImpl
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        ... 9 more
================================================================================
Pig Stack Trace
---------------
ERROR 2998: Unhandled internal error. Could not initialize class org.apache.pig.tools.pigstats.PigStatsUtil
{code}

So I am unable to test if the new build works with Hadoop 23.

This patch produces a new file, pig-core.jar, in the top level directory.
pig-core.jar is just a copy of pig-0.11.0-SNAPSHOT.jar in build/.
This is done just for convenience. Once we get rid of compatibility we can remove all the pig jars from the top level directory.
                
> 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.11
>
>         Attachments: PIG-2362.1.patch, PIG-2362.2.patch, PIG-2362.3.patch, PIG-2362.4.patch, PIG-2362.5.patch, PIG-2362.6.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
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (PIG-2362) Rework Ant build.xml to use macrodef instead of antcall

Posted by "Gianmarco De Francisci Morales (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gianmarco De Francisci Morales updated PIG-2362:
------------------------------------------------

    Attachment: PIG-2362.3.patch

Attaching PIG-2362.3.patch
Rebased patch on latest trunk.
Ready for review.
                
> 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.11
>
>         Attachments: PIG-2362.1.patch, PIG-2362.2.patch, PIG-2362.3.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

        

[jira] [Updated] (PIG-2362) Rework Ant build.xml to use macrodef instead of antcall

Posted by "Gianmarco De Francisci Morales (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gianmarco De Francisci Morales updated PIG-2362:
------------------------------------------------

    Fix Version/s: 0.11
           Status: Patch Available  (was: Open)
    
> 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.11
>
>         Attachments: PIG-2362.1.patch, PIG-2362.2.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

        

[jira] [Updated] (PIG-2362) Rework Ant build.xml to use macrodef instead of antcall

Posted by "Cheolsoo Park (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Cheolsoo Park updated PIG-2362:
-------------------------------

    Attachment: PIG-2362.8.patch

Rebased to trunk again.
                
> 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.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
>
>
> 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

[jira] [Updated] (PIG-2362) Rework Ant build.xml to use macrodef instead of antcall

Posted by "Gianmarco De Francisci Morales (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gianmarco De Francisci Morales updated PIG-2362:
------------------------------------------------

    Attachment: PIG-2362.1.patch

First attempt PIG-2362.1.patch.
I removed much of the duplicated code and the bloat in build.xml
There are still more <antcall> to evict.

This patch also removes 1 useless call to ivy:resolve.

I just wanted to have some feedback from the community before I go on.

Also, do we still need the JavaCC part now that we use ANTLR?
                
> 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

        

[jira] [Updated] (PIG-2362) Rework Ant build.xml to use macrodef instead of antcall

Posted by "Gianmarco De Francisci Morales (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gianmarco De Francisci Morales updated PIG-2362:
------------------------------------------------

    Attachment: PIG-2362.5.patch

Attaching PIG-2362.5.patch
This solves the include-meta issue, even though I had to keep the antcall for it.
I will refactor it in a separate ticket.
                
> 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.11
>
>         Attachments: PIG-2362.1.patch, PIG-2362.2.patch, PIG-2362.3.patch, PIG-2362.4.patch, PIG-2362.5.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

        

[jira] [Commented] (PIG-2362) Rework Ant build.xml to use macrodef instead of antcall

Posted by "Gianmarco De Francisci Morales (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447179#comment-13447179 ] 

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

Too bad we didn't manage to mavenize Pig.
Yes, I will take another crack at it later this week.
                
> 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.11
>
>         Attachments: PIG-2362.1.patch, PIG-2362.2.patch, PIG-2362.3.patch, PIG-2362.4.patch, PIG-2362.5.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
For more information on JIRA, see: http://www.atlassian.com/software/jira