cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [3/4] git commit: Attach existing sources to "Referenced libraries" in Eclipse
Date Tue, 04 Nov 2014 14:42:30 GMT
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/trunk
Commit: 0bc1ea385e739c4fdcb3d372b7863570d5b83f10
Parents: a6c58f8
Author: Mikhail Stepura <mishail@apache.org>
Authored: Sat Nov 1 10:19:50 2014 -0700
Committer: T Jake Luciani <jake@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>';


Mime
View raw message