You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ja...@apache.org on 2014/11/04 15:41:22 UTC

[2/2] git commit: Attach existing sources to "Referenced libraries" in Eclipse

Attach existing sources to "Referenced libraries" in Eclipse

Patch by Mikhail Stepura; reviewed by tjake for CASSANDRA-8240


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/0bc1ea38
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/0bc1ea38
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/0bc1ea38

Branch: refs/heads/cassandra-2.1
Commit: 0bc1ea385e739c4fdcb3d372b7863570d5b83f10
Parents: a6c58f8
Author: Mikhail Stepura <mi...@apache.org>
Authored: Sat Nov 1 10:19:50 2014 -0700
Committer: T Jake Luciani <ja...@apache.org>
Committed: Tue Nov 4 09:34:05 2014 -0500

----------------------------------------------------------------------
 build.xml | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0bc1ea38/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index 29e4121..e94ded8 100644
--- a/build.xml
+++ b/build.xml
@@ -1522,13 +1522,22 @@
   	 </fileset>
   	</path>
   	<property name="eclipse-project-libs" refid="eclipse-project-libs-path"/>
-  	<script language="javascript"> <![CDATA[
+  	<script language="javascript" classpathref="cassandra.classpath"> <![CDATA[
   		var File = java.io.File;
+  		var FilenameUtils = Packages.org.apache.commons.io.FilenameUtils;
   		jars = project.getProperty("eclipse-project-libs").split(project.getProperty("path.separator"));
   		
   		cp = "";
   	    for (i=0; i< jars.length; i++) {
-  	       cp += ' <classpathentry kind="lib" path="'+jars[i]+'"/>\n';
+  	       srcjar = FilenameUtils.getBaseName(jars[i]) + '-sources.jar';
+  		   srcdir = FilenameUtils.concat(project.getProperty("build.dir.lib"), 'sources');
+  		   srcfile = new File(FilenameUtils.concat(srcdir, srcjar));
+  		
+  		   cp += ' <classpathentry kind="lib" path="' + jars[i] + '"';
+  		   if (srcfile.exists()) {
+  		      cp += ' sourcepath="' + srcfile.getAbsolutePath() + '"';
+  		   }
+  		   cp += '/>\n';
   		}
   		
   		cp += '</classpath>';