Attached here is the patch with the "eclipse-files" target. On Thu, Apr 22, 2010 at 1:54 PM, Dmitriy Ryaboy <dvrya...@gmail.com> wrote:
> At some point you need to run "ant" so that it pulls down various > dependencies and autogenerate some code -- this is probably the step that > was missing when you used the subclipse plugin. I know people have used > subclipse successfully before (me, I'm more of a command-line type). > > An ant target that took care of that and setting classpaths, etc, would be > a > great contribution! > > -Dmitriy > > On Wed, Apr 21, 2010 at 9:23 PM, chaitanya krishna < > chaitanyavv.ii...@gmail.com> wrote: > > > Hi Ashutosh, > > > > Thanks for the reply. > > I guess i got carried away with subclipse plugin. It works for me when i > > checkout outside eclipse and then create a new java project out of it. > > However, it doesnt seem to work when i try to checkout using the > subclipse > > plugin in eclipse. I'm not really sure the reason for this. > > Regarding ant target, I would love to be a contributor to pig :) > > I would try to work out a patch for the ant target. > > > > Regards, > > V.V.Chaitanya. > > > > On Thu, Apr 22, 2010 at 9:40 AM, Ashutosh Chauhan < > > ashutosh.chau...@gmail.com> wrote: > > > > > Hi Chaitanya, > > > > > > What didn't work ? That page describes the steps that you need to take > > > to set up the eclipse environment for pig. If you can spell out your > > > problems, then we can improve the wiki so others dont face it next > > > time. > > > > > > For ant target, that will be useful, if you can work on it and submit > > > a patch, that will certainly be appreciated. > > > > > > Ashutosh > > > > > > On Wed, Apr 21, 2010 at 20:24, chaitanya krishna > > > <chaitanyavv.ii...@gmail.com> wrote: > > > > Hi, > > > > > > > > I'm a newbie to Pig and would like to look at its source code. I > tried > > > to > > > > get it into Eclipse environment by following the steps mentioned in > > > > http://wiki.apache.org/pig/Eclipse_Environment but it didn't work. > > > > > > > > This is unlike Hadoop, where there is a simple ant target > > > > ("eclipse-files") to get it into eclipse. Is there any such way in > pig? > > > (If > > > > not, I think there should be) or is there some way to get the > > > package-view > > > > of pig in eclipse? > > > > > > > > > > > > Thanks, > > > > V.V.Chaitanya > > > > > > > > > >
Index: build.xml =================================================================== --- build.xml (revision 936822) +++ build.xml (working copy) @@ -232,6 +232,22 @@ <delete dir="${build.dir}" /> <delete dir="${src.gen.dot.parser.dir}" /> </target> + + <target name="eclipse-files" depends="init" + description="Generate files for Eclipse"> + <pathconvert property="eclipse.project"> + <path path="${basedir}"/> + <regexpmapper from="^.*/([^/]+)$$" to="\1" handledirsep="yes"/> + </pathconvert> + <copy todir="." overwrite="true"> + <fileset dir=".eclipse.templates"> + <exclude name="**/README.txt"/> + </fileset> + <filterset> + <filter token="PROJECT" value="${eclipse.project}"/> + </filterset> + </copy> + </target> <!-- ================================================================== --> <!-- Java Compiler Compiler, generate Parsers --> Index: .eclipse.templates/.classpath =================================================================== --- .eclipse.templates/.classpath (revision 0) +++ .eclipse.templates/.classpath (revision 0) @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF=8"?> +<classpath> + <classpathentry kind="src" path="contrib/owl/java/main"/> + <classpathentry kind="src" path="contrib/owl/java/test"/> + <classpathentry kind="src" path="contrib/piggybank/java/src/main/java"/> + <classpathentry kind="src" path="contrib/piggybank/java/src/test/java"/> + <classpathentry kind="src" path="contrib/zebra/src/java"/> + <classpathentry kind="src" path="contrib/zebra/src/test"/> + <classpathentry kind="src" path="lib-src/bzip2"/> + <classpathentry kind="src" path="lib-src/shock"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="src" path="src-gen"/> + <classpathentry kind="src" path="test"/> + <classpathentry kind="src" path="test/org/apache/pig/test"/> + <classpathentry kind="src" path="tutorial/src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="var" path="ANT_HOME/lib/ant.jar"/> + <classpathentry kind="lib" path="build/ivy/lib/Pig/jackson-core-asl-1.0.1.jar"/> + <classpathentry kind="lib" path="build/ivy/lib/Pig/jackson-mapper-asl-1.0.1.jar"/> + <classpathentry kind="lib" path="build/ivy/lib/Pig/javacc-4.2.jar"/> + <classpathentry kind="lib" path="build/ivy/lib/Pig/javacc.jar"/> + <classpathentry kind="lib" path="build/ivy/lib/Pig/jline-0.9.94.jar"/> + <classpathentry kind="lib" path="build/ivy/lib/Pig/joda-time-1.6.jar"/> + <classpathentry kind="lib" path="build/ivy/lib/Pig/jsch-0.1.38.jar"/> + <classpathentry kind="lib" path="build/ivy/lib/Pig/junit-4.5.jar"/> + <classpathentry kind="output" path="build/eclipse-classes"/> +</classpath> Index: .eclipse.templates/.project =================================================================== --- .eclipse.templates/.project (revision 0) +++ .eclipse.templates/.project (revision 0) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>@PROJECT@</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Index: .eclipse.templates/README.txt =================================================================== --- .eclipse.templates/README.txt (revision 0) +++ .eclipse.templates/README.txt (revision 0) @@ -0,0 +1,2 @@ +This directory contains templates for generating Eclipse files to configure +Eclipse for Pig development.