You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-commits@hadoop.apache.org by ni...@apache.org on 2010/11/09 06:24:03 UTC

svn commit: r1032846 - in /hadoop/hdfs/trunk: .eclipse.templates/.classpath .eclipse.templates/.project CHANGES.txt build.xml

Author: nigel
Date: Tue Nov  9 05:24:03 2010
New Revision: 1032846

URL: http://svn.apache.org/viewvc?rev=1032846&view=rev
Log:
HDFS-1035. Generate Eclipse's .classpath file from Ivy config. Contributed by nigel

Removed:
    hadoop/hdfs/trunk/.eclipse.templates/.classpath
    hadoop/hdfs/trunk/.eclipse.templates/.project
Modified:
    hadoop/hdfs/trunk/CHANGES.txt
    hadoop/hdfs/trunk/build.xml

Modified: hadoop/hdfs/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=1032846&r1=1032845&r2=1032846&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Tue Nov  9 05:24:03 2010
@@ -164,6 +164,8 @@ Trunk (unreleased changes)
 
     HDFS-1485. Fix typo in BlockPlacementPolicy. (Jingguo Yao via shv)
 
+    HDFS-1035. Generate Eclipse's .classpath file from Ivy config. (nigel)
+
   OPTIMIZATIONS
 
     HDFS-1140. Speedup INode.getPathComponents. (Dmytro Molkov via shv)

Modified: hadoop/hdfs/trunk/build.xml
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/build.xml?rev=1032846&r1=1032845&r2=1032846&view=diff
==============================================================================
--- hadoop/hdfs/trunk/build.xml (original)
+++ hadoop/hdfs/trunk/build.xml Tue Nov  9 05:24:03 2010
@@ -183,6 +183,13 @@
   <property name="jdiff.jar" value="${jdiff.home}/jdiff-${jdiff.version}.jar"/>
   <property name="xerces.jar" value="${jdiff.home}/xerces-${xerces.version}.jar"/>
 
+  <!-- Eclipse properties -->
+  <property name="build.dir.eclipse" value="${build.dir}/eclipse"/>
+  <property name="build.dir.eclipse-main-classes" value="${build.dir.eclipse}/classes-main"/>
+  <property name="build.dir.eclipse-main-generated-classes" value="${build.dir.eclipse}/classes-main-generated"/>
+  <property name="build.dir.eclipse-test-classes" value="${build.dir.eclipse}/classes-test"/>
+  <property name="build.dir.eclipse-contrib-classes" value="${build.dir.eclipse}/classes-contrib"/>
+
   <property name="clover.jar" location="${clover.home}/lib/clover.jar"/>
   <available property="clover.present" file="${clover.jar}" />
 
@@ -1385,13 +1392,52 @@
   </exec>
 </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">
+  <condition property="ant-eclipse.jar.exists">
+    <available file="${build.dir}/lib/ant-eclipse-1.0-jvm1.2.jar"/>
+  </condition>
+
+  <target name="ant-eclipse-download" unless="ant-eclipse.jar.exists"
+          description="Downloads the ant-eclipse binary.">
+    <get src="http://downloads.sourceforge.net/project/ant-eclipse/ant-eclipse/1.0/ant-eclipse-1.0.bin.tar.bz2"
+         dest="${build.dir}/ant-eclipse-1.0.bin.tar.bz2" usetimestamp="false" />
+
+    <untar src="${build.dir}/ant-eclipse-1.0.bin.tar.bz2"
+           dest="${build.dir}" compression="bzip2">
+      <patternset>
+        <include name="lib/ant-eclipse-1.0-jvm1.2.jar"/>
+      </patternset>
+    </untar>
+    <delete file="${build.dir}/java/ant-eclipse-1.0.bin.tar.bz2" />
+  </target>
+  
+  <target name="eclipse" 
+          depends="init,ant-eclipse-download,ivy-retrieve-common,ivy-retrieve-test"
+          description="Create eclipse project files">
+       <pathconvert property="eclipse.project">
+         <path path="${basedir}"/>
+         <regexpmapper from="^.*/([^/]+)$$" to="\1" handledirsep="yes"/>
+       </pathconvert>
+    <taskdef name="eclipse"
+             classname="prantl.ant.eclipse.EclipseTask"
+             classpath="${build.dir}/lib/ant-eclipse-1.0-jvm1.2.jar" />
+    <eclipse updatealways="true">
+      <project name="${eclipse.project}" />
+      <classpath>
+        <source path="${java.src.dir}"
+                output="${build.dir.eclipse-main-classes}" />
+        <source path="${build.src}"
+                output="${build.dir.eclipse-main-generated-classes}" />
+        <source path="${test.src.dir}/hdfs"
+                output="${build.dir.eclipse-test-classes}" />
+        <source path="${test.src.dir}/unit"
+                output="${build.dir.eclipse-test-classes}" />
+        <output path="${build.dir.eclipse-main-classes}" />
+        <library pathref="ivy-common.classpath" exported="true" />
+        <library pathref="ivy-test.classpath" exported="false" />
+        <library path="${conf.dir}" exported="false" />
+      </classpath>
+    </eclipse>
+	<copy todir="." overwrite="true">
       <fileset dir=".eclipse.templates">
       	<exclude name="**/README.txt"/>
       </fileset>



Re: svn commit: r1032846 - in /hadoop/hdfs/trunk: .eclipse.templates/.classpath .eclipse.templates/.project CHANGES.txt build.xml

Posted by Konstantin Boudnik <co...@apache.org>.
Sanjay.

the generation of the .classpath file has been a pain-point for everybody
committing the code and making dependecy changes in Hadoop.

Everytime new jar has been added to the project one should've remember to
update Eclipse deps even if that person doesn't use that IDE. Otherwise,
Eclipse environment was broken everytime. If you check how many JIRAs about
outdated .classpath file are there - you won't believe it.

Hope it shed some lights on the problem
  Cos

On Tue, Nov 09, 2010 at 11:21AM, Sanjay Radia wrote:
> Nigel
> 
> At my previous company we simply  checked-in the .classpath file and
> the .project file rather then generate it
> through an ant command.
> Folks who were not using eclipse ignored it.
> 
> Should we consider such an approach for eclipse in the future. It is
> much easier to manage.
> 
> 
> sanjay
> 
> On Nov 8, 2010, at 9:24 PM, nigel@apache.org wrote:
> 
> >Author: nigel
> >Date: Tue Nov  9 05:24:03 2010
> >New Revision: 1032846
> >
> >URL: http://svn.apache.org/viewvc?rev=1032846&view=rev
> >Log:
> >HDFS-1035. Generate Eclipse's .classpath file from Ivy config.
> >Contributed by nigel
> >
> >Removed:
> >   hadoop/hdfs/trunk/.eclipse.templates/.classpath
> >   hadoop/hdfs/trunk/.eclipse.templates/.project
> >Modified:
> >   hadoop/hdfs/trunk/CHANGES.txt
> >   hadoop/hdfs/trunk/build.xml
> >
> >Modified: hadoop/hdfs/trunk/CHANGES.txt
> >URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=1032846&r1=1032845&r2=1032846&view=diff
> >==============================================================================
> >--- hadoop/hdfs/trunk/CHANGES.txt (original)
> >+++ hadoop/hdfs/trunk/CHANGES.txt Tue Nov  9 05:24:03 2010
> >@@ -164,6 +164,8 @@ Trunk (unreleased changes)
> >
> >    HDFS-1485. Fix typo in BlockPlacementPolicy. (Jingguo Yao via shv)
> >
> >+    HDFS-1035. Generate Eclipse's .classpath file from Ivy
> >config. (nigel)
> >+
> >  OPTIMIZATIONS
> >
> >    HDFS-1140. Speedup INode.getPathComponents. (Dmytro Molkov via
> >shv)
> >
> >Modified: hadoop/hdfs/trunk/build.xml
> >URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/build.xml?rev=1032846&r1=1032845&r2=1032846&view=diff
> >==============================================================================
> >--- hadoop/hdfs/trunk/build.xml (original)
> >+++ hadoop/hdfs/trunk/build.xml Tue Nov  9 05:24:03 2010
> >@@ -183,6 +183,13 @@
> >  <property name="jdiff.jar" value="${jdiff.home}/jdiff-$
> >{jdiff.version}.jar"/>
> >  <property name="xerces.jar" value="${jdiff.home}/xerces-$
> >{xerces.version}.jar"/>
> >
> >+  <!-- Eclipse properties -->
> >+  <property name="build.dir.eclipse" value="${build.dir}/eclipse"/>
> >+  <property name="build.dir.eclipse-main-classes" value="$
> >{build.dir.eclipse}/classes-main"/>
> >+  <property name="build.dir.eclipse-main-generated-classes"
> >value="${build.dir.eclipse}/classes-main-generated"/>
> >+  <property name="build.dir.eclipse-test-classes" value="$
> >{build.dir.eclipse}/classes-test"/>
> >+  <property name="build.dir.eclipse-contrib-classes" value="$
> >{build.dir.eclipse}/classes-contrib"/>
> >+
> >  <property name="clover.jar" location="${clover.home}/lib/
> >clover.jar"/>
> >  <available property="clover.present" file="${clover.jar}" />
> >
> >@@ -1385,13 +1392,52 @@
> >  </exec>
> ></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">
> >+  <condition property="ant-eclipse.jar.exists">
> >+    <available file="${build.dir}/lib/ant-eclipse-1.0-jvm1.2.jar"/>
> >+  </condition>
> >+
> >+  <target name="ant-eclipse-download" unless="ant-eclipse.jar.exists"
> >+          description="Downloads the ant-eclipse binary.">
> >+    <get src="http://downloads.sourceforge.net/project/ant-eclipse/ant-eclipse/1.0/ant-eclipse-1.0.bin.tar.bz2
> >"
> >+         dest="${build.dir}/ant-eclipse-1.0.bin.tar.bz2"
> >usetimestamp="false" />
> >+
> >+    <untar src="${build.dir}/ant-eclipse-1.0.bin.tar.bz2"
> >+           dest="${build.dir}" compression="bzip2">
> >+      <patternset>
> >+        <include name="lib/ant-eclipse-1.0-jvm1.2.jar"/>
> >+      </patternset>
> >+    </untar>
> >+    <delete file="${build.dir}/java/ant-eclipse-1.0.bin.tar.bz2" />
> >+  </target>
> >+
> >+  <target name="eclipse"
> >+          depends="init,ant-eclipse-download,ivy-retrieve-
> >common,ivy-retrieve-test"
> >+          description="Create eclipse project files">
> >+       <pathconvert property="eclipse.project">
> >+         <path path="${basedir}"/>
> >+         <regexpmapper from="^.*/([^/]+)$$" to="\1"
> >handledirsep="yes"/>
> >+       </pathconvert>
> >+    <taskdef name="eclipse"
> >+             classname="prantl.ant.eclipse.EclipseTask"
> >+             classpath="${build.dir}/lib/ant-eclipse-1.0-
> >jvm1.2.jar" />
> >+    <eclipse updatealways="true">
> >+      <project name="${eclipse.project}" />
> >+      <classpath>
> >+        <source path="${java.src.dir}"
> >+                output="${build.dir.eclipse-main-classes}" />
> >+        <source path="${build.src}"
> >+                output="${build.dir.eclipse-main-generated-
> >classes}" />
> >+        <source path="${test.src.dir}/hdfs"
> >+                output="${build.dir.eclipse-test-classes}" />
> >+        <source path="${test.src.dir}/unit"
> >+                output="${build.dir.eclipse-test-classes}" />
> >+        <output path="${build.dir.eclipse-main-classes}" />
> >+        <library pathref="ivy-common.classpath" exported="true" />
> >+        <library pathref="ivy-test.classpath" exported="false" />
> >+        <library path="${conf.dir}" exported="false" />
> >+      </classpath>
> >+    </eclipse>
> >+	<copy todir="." overwrite="true">
> >      <fileset dir=".eclipse.templates">
> >      	<exclude name="**/README.txt"/>
> >      </fileset>
> >
> >
> 

Re: svn commit: r1032846 - in /hadoop/hdfs/trunk: .eclipse.templates/.classpath .eclipse.templates/.project CHANGES.txt build.xml

Posted by Sanjay Radia <sr...@yahoo-inc.com>.
Nigel

At my previous company we simply  checked-in the .classpath file and  
the .project file rather then generate it
through an ant command.
Folks who were not using eclipse ignored it.

Should we consider such an approach for eclipse in the future. It is  
much easier to manage.


sanjay

On Nov 8, 2010, at 9:24 PM, nigel@apache.org wrote:

> Author: nigel
> Date: Tue Nov  9 05:24:03 2010
> New Revision: 1032846
>
> URL: http://svn.apache.org/viewvc?rev=1032846&view=rev
> Log:
> HDFS-1035. Generate Eclipse's .classpath file from Ivy config.  
> Contributed by nigel
>
> Removed:
>    hadoop/hdfs/trunk/.eclipse.templates/.classpath
>    hadoop/hdfs/trunk/.eclipse.templates/.project
> Modified:
>    hadoop/hdfs/trunk/CHANGES.txt
>    hadoop/hdfs/trunk/build.xml
>
> Modified: hadoop/hdfs/trunk/CHANGES.txt
> URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=1032846&r1=1032845&r2=1032846&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- hadoop/hdfs/trunk/CHANGES.txt (original)
> +++ hadoop/hdfs/trunk/CHANGES.txt Tue Nov  9 05:24:03 2010
> @@ -164,6 +164,8 @@ Trunk (unreleased changes)
>
>     HDFS-1485. Fix typo in BlockPlacementPolicy. (Jingguo Yao via shv)
>
> +    HDFS-1035. Generate Eclipse's .classpath file from Ivy config.  
> (nigel)
> +
>   OPTIMIZATIONS
>
>     HDFS-1140. Speedup INode.getPathComponents. (Dmytro Molkov via  
> shv)
>
> Modified: hadoop/hdfs/trunk/build.xml
> URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/build.xml?rev=1032846&r1=1032845&r2=1032846&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- hadoop/hdfs/trunk/build.xml (original)
> +++ hadoop/hdfs/trunk/build.xml Tue Nov  9 05:24:03 2010
> @@ -183,6 +183,13 @@
>   <property name="jdiff.jar" value="${jdiff.home}/jdiff-$ 
> {jdiff.version}.jar"/>
>   <property name="xerces.jar" value="${jdiff.home}/xerces-$ 
> {xerces.version}.jar"/>
>
> +  <!-- Eclipse properties -->
> +  <property name="build.dir.eclipse" value="${build.dir}/eclipse"/>
> +  <property name="build.dir.eclipse-main-classes" value="$ 
> {build.dir.eclipse}/classes-main"/>
> +  <property name="build.dir.eclipse-main-generated-classes" value="$ 
> {build.dir.eclipse}/classes-main-generated"/>
> +  <property name="build.dir.eclipse-test-classes" value="$ 
> {build.dir.eclipse}/classes-test"/>
> +  <property name="build.dir.eclipse-contrib-classes" value="$ 
> {build.dir.eclipse}/classes-contrib"/>
> +
>   <property name="clover.jar" location="${clover.home}/lib/ 
> clover.jar"/>
>   <available property="clover.present" file="${clover.jar}" />
>
> @@ -1385,13 +1392,52 @@
>   </exec>
> </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">
> +  <condition property="ant-eclipse.jar.exists">
> +    <available file="${build.dir}/lib/ant-eclipse-1.0-jvm1.2.jar"/>
> +  </condition>
> +
> +  <target name="ant-eclipse-download" unless="ant-eclipse.jar.exists"
> +          description="Downloads the ant-eclipse binary.">
> +    <get src="http://downloads.sourceforge.net/project/ant-eclipse/ant-eclipse/1.0/ant-eclipse-1.0.bin.tar.bz2 
> "
> +         dest="${build.dir}/ant-eclipse-1.0.bin.tar.bz2"  
> usetimestamp="false" />
> +
> +    <untar src="${build.dir}/ant-eclipse-1.0.bin.tar.bz2"
> +           dest="${build.dir}" compression="bzip2">
> +      <patternset>
> +        <include name="lib/ant-eclipse-1.0-jvm1.2.jar"/>
> +      </patternset>
> +    </untar>
> +    <delete file="${build.dir}/java/ant-eclipse-1.0.bin.tar.bz2" />
> +  </target>
> +
> +  <target name="eclipse"
> +          depends="init,ant-eclipse-download,ivy-retrieve- 
> common,ivy-retrieve-test"
> +          description="Create eclipse project files">
> +       <pathconvert property="eclipse.project">
> +         <path path="${basedir}"/>
> +         <regexpmapper from="^.*/([^/]+)$$" to="\1"  
> handledirsep="yes"/>
> +       </pathconvert>
> +    <taskdef name="eclipse"
> +             classname="prantl.ant.eclipse.EclipseTask"
> +             classpath="${build.dir}/lib/ant-eclipse-1.0- 
> jvm1.2.jar" />
> +    <eclipse updatealways="true">
> +      <project name="${eclipse.project}" />
> +      <classpath>
> +        <source path="${java.src.dir}"
> +                output="${build.dir.eclipse-main-classes}" />
> +        <source path="${build.src}"
> +                output="${build.dir.eclipse-main-generated- 
> classes}" />
> +        <source path="${test.src.dir}/hdfs"
> +                output="${build.dir.eclipse-test-classes}" />
> +        <source path="${test.src.dir}/unit"
> +                output="${build.dir.eclipse-test-classes}" />
> +        <output path="${build.dir.eclipse-main-classes}" />
> +        <library pathref="ivy-common.classpath" exported="true" />
> +        <library pathref="ivy-test.classpath" exported="false" />
> +        <library path="${conf.dir}" exported="false" />
> +      </classpath>
> +    </eclipse>
> +	<copy todir="." overwrite="true">
>       <fileset dir=".eclipse.templates">
>       	<exclude name="**/README.txt"/>
>       </fileset>
>
>