Update of /cvsroot/metamorphosis/ruper2/src/java/eclipse/org/krysalis/ruper2/eclipse/util
In directory sc8-pr-cvs1:/tmp/cvs-serv14434/src/java/eclipse/org/krysalis/ruper2/eclipse/util
Modified Files:
RuperEclipseHelper.java
Log Message:
Tweaks.
Index: RuperEclipseHelper.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/eclipse/org/krysalis/ruper2/eclipse/util/RuperEclipseHelper.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** RuperEclipseHelper.java 13 Oct 2003 21:14:01 -0000 1.3
--- RuperEclipseHelper.java 17 Oct 2003 19:33:28 -0000 1.4
***************
*** 3,9 ****
*
*/
!
package org.krysalis.ruper2.eclipse.util;
!
import java.util.ArrayList;
import java.util.Iterator;
--- 3,9 ----
*
*/
!
package org.krysalis.ruper2.eclipse.util;
!
import java.util.ArrayList;
import java.util.Iterator;
***************
*** 20,89 ****
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.pde.internal.core.PDECore;
! import org.krysalis.ruper2.util.FileHelper;
/**
* @author Anou Manavalan
*/
! public class RuperEclipseHelper
! {
! private String m_eclipsePathStr = null;
/**
*
*/
! public RuperEclipseHelper()
! {
super();
setEclipsePathString();
}
!
! public void setEclipsePathString()
! {
Preferences preferences = PDECore.getDefault().getPluginPreferences();
String PLATFORM_PATH = "platform_path";
IPath eclipsePath = new Path(preferences.getString(PLATFORM_PATH));
!
//IPath eclipsePath = JavaCore.getClasspathVariable(TSConstants.ECLIPSE_HOME);
!
StringBuffer buff = new StringBuffer();
buff.append(eclipsePath.toOSString());
buff.append("\\plugins\\");
! m_eclipsePathStr = FileHelper.createURLForPath(buff.toString()) ;
!
}
!
! public ArrayList getBuildTimeLibraries(IProject project) throws JavaModelException
! {
setEclipsePathString();
!
! IPath jreLibPath = JavaCore.getClasspathVariable(RuperEclipseConstants.JRE_LIB);
String jreLibPathStr = jreLibPath.toOSString();
! String jrePath = jreLibPathStr.substring(0,jreLibPathStr.lastIndexOf("\\"));
//TSHelperLog.traceMessage("JRE Path :[" + jrePath + "]");
!
//TSHelperLog.traceMessage("Eclipse Path :[" + m_eclipsePathStr + "]");
!
IJavaElement jElement = JavaCore.create((IResource) (project));
IJavaProject jProject = jElement.getJavaProject();
!
IClasspathEntry cpEntries[];
cpEntries = jProject.getResolvedClasspath(true);
!
ArrayList requiredJars = null;
!
! String pathString, pluginName,jarString,jarName,tmp;
!
! for (int i = 0; i < cpEntries.length; i++)
! {
int cpEntryKind = cpEntries[i].getEntryKind();
IPath path = cpEntries[i].getPath();
! pathString = FileHelper.createURLForPath(path.toOSString());
!
! if( cpEntryKind == IClasspathEntry.CPE_LIBRARY )
! {
! if(! pathString.startsWith(jrePath))
! {
! if(requiredJars == null)
requiredJars = new ArrayList();
requiredJars.add(pathString);
--- 20,84 ----
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.pde.internal.core.PDECore;
! import org.krysalis.ruper2.util.io.FileUtils;
/**
* @author Anou Manavalan
*/
! public class RuperEclipseHelper {
! private String m_eclipsePathStr = null;
/**
*
*/
! public RuperEclipseHelper() {
super();
setEclipsePathString();
}
!
! public void setEclipsePathString() {
Preferences preferences = PDECore.getDefault().getPluginPreferences();
String PLATFORM_PATH = "platform_path";
IPath eclipsePath = new Path(preferences.getString(PLATFORM_PATH));
!
//IPath eclipsePath = JavaCore.getClasspathVariable(TSConstants.ECLIPSE_HOME);
!
StringBuffer buff = new StringBuffer();
buff.append(eclipsePath.toOSString());
buff.append("\\plugins\\");
! m_eclipsePathStr = FileUtils.toURI(buff.toString());
}
!
! public ArrayList getBuildTimeLibraries(IProject project)
! throws JavaModelException {
setEclipsePathString();
!
! IPath jreLibPath =
! JavaCore.getClasspathVariable(RuperEclipseConstants.JRE_LIB);
String jreLibPathStr = jreLibPath.toOSString();
! String jrePath =
! jreLibPathStr.substring(0, jreLibPathStr.lastIndexOf("\\"));
//TSHelperLog.traceMessage("JRE Path :[" + jrePath + "]");
!
//TSHelperLog.traceMessage("Eclipse Path :[" + m_eclipsePathStr + "]");
!
IJavaElement jElement = JavaCore.create((IResource) (project));
IJavaProject jProject = jElement.getJavaProject();
!
IClasspathEntry cpEntries[];
cpEntries = jProject.getResolvedClasspath(true);
!
ArrayList requiredJars = null;
!
! String pathString, pluginName, jarString, jarName, tmp;
!
! for (int i = 0; i < cpEntries.length; i++) {
int cpEntryKind = cpEntries[i].getEntryKind();
IPath path = cpEntries[i].getPath();
! pathString = FileUtils.toURI(path.toOSString());
!
! if (cpEntryKind == IClasspathEntry.CPE_LIBRARY) {
! if (!pathString.startsWith(jrePath)) {
! if (requiredJars == null)
requiredJars = new ArrayList();
requiredJars.add(pathString);
***************
*** 92,149 ****
}
return requiredJars;
! }
! public ArrayList getBuildTimeJarNames(IProject project) throws JavaModelException
! {
ArrayList requiredJars = null;
ArrayList libraries = getBuildTimeLibraries(project);
!
! for(Iterator iterator = libraries.iterator(); iterator.hasNext();){
! if(requiredJars == null)
requiredJars = new ArrayList();
!
! String pathString = (String)iterator.next();
! String jarString = pathString.substring(
! pathString.lastIndexOf("\\")+1,
! pathString.length() );
!
! String jarName = jarString.substring(0,jarString.indexOf(".jar"));
!
// get the requiredEclipsePlugins
! if(pathString.startsWith(m_eclipsePathStr))
! {
! String tmp = pathString.substring(m_eclipsePathStr.length(),
! pathString.length() );
!
// remove the eclipse version part from the project names xyz_1.2
! String[] pluginNames = tmp.split("_\\d");
! if(pluginNames != null)
! {
//requiredEclipsePlugins.add(pluginNames[0]);
requiredJars.add(pluginNames[0]);
}
!
}
! else
! {
// remove the version part xyz-1.2
! String[]jars = jarName.split("-\\d");
jarName = jars[0];
//TSHelperLog.traceMessage("version removed jar name [" + jarName + "]");
}
!
requiredJars.add(jarName);
}
return requiredJars;
}
!
! public String getProjectDirectory(IProject project)
! {
String projectDir = project.getLocation().toOSString();
return projectDir;
}
! public static void main(String[] args)
! {
}
/**
--- 87,142 ----
}
return requiredJars;
! }
! public ArrayList getBuildTimeJarNames(IProject project)
! throws JavaModelException {
ArrayList requiredJars = null;
ArrayList libraries = getBuildTimeLibraries(project);
!
! for (Iterator iterator = libraries.iterator(); iterator.hasNext();) {
! if (requiredJars == null)
requiredJars = new ArrayList();
!
! String pathString = (String) iterator.next();
! String jarString =
! pathString.substring(
! pathString.lastIndexOf("\\") + 1,
! pathString.length());
!
! String jarName = jarString.substring(0, jarString.indexOf(".jar"));
!
// get the requiredEclipsePlugins
! if (pathString.startsWith(m_eclipsePathStr)) {
! String tmp =
! pathString.substring(
! m_eclipsePathStr.length(),
! pathString.length());
!
// remove the eclipse version part from the project names xyz_1.2
! String[] pluginNames = tmp.split("_\\d");
! if (pluginNames != null) {
//requiredEclipsePlugins.add(pluginNames[0]);
requiredJars.add(pluginNames[0]);
}
!
}
! else {
// remove the version part xyz-1.2
! String[] jars = jarName.split("-\\d");
jarName = jars[0];
//TSHelperLog.traceMessage("version removed jar name [" + jarName + "]");
}
!
requiredJars.add(jarName);
}
return requiredJars;
}
!
! public String getProjectDirectory(IProject project) {
String projectDir = project.getLocation().toOSString();
return projectDir;
}
! public static void main(String[] args) {
}
/**
-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
The Event For Linux Datacenter Solutions & Strategies in The Enterprise
Linux in the Boardroom; in the Front Office; & in the Server Room
http://www.enterpriselinuxforum.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.