notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r1939 - in development/laboratory/ide/eclipse/TransitPlugin: . META-INF src/net/dpml/ide/eclipse/plugins/magic
- From: pneubauer AT netcompartner.com
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r1939 - in development/laboratory/ide/eclipse/TransitPlugin: . META-INF src/net/dpml/ide/eclipse/plugins/magic
- Date: Thu, 03 Mar 2005 23:36:23 +0100
Author: pneubauer
Date: Thu Mar 3 23:36:21 2005
New Revision: 1939
Removed:
development/laboratory/ide/eclipse/TransitPlugin/META-INF/
Modified:
development/laboratory/ide/eclipse/TransitPlugin/.classpath
development/laboratory/ide/eclipse/TransitPlugin/plugin.xml
development/laboratory/ide/eclipse/TransitPlugin/src/net/dpml/ide/eclipse/plugins/magic/MagicContainer.java
Log:
handles source folders now
Modified: development/laboratory/ide/eclipse/TransitPlugin/.classpath
==============================================================================
--- development/laboratory/ide/eclipse/TransitPlugin/.classpath (original)
+++ development/laboratory/ide/eclipse/TransitPlugin/.classpath Thu Mar 3
23:36:21 2005
@@ -1,12 +1,12 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/"/>
- <classpathentry kind="src" path="lib/"/>
- <classpathentry exported="true" kind="lib"
path="lib/dpml-ide-common-magic-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/dpml-magic-core-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/dpml-transit-main.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/dpml-transit-tools.jar"/>
- <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry exported="true" kind="lib"
path="lib/dpml-ide-common-magic-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/dpml-magic-core-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/dpml-transit-main.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/dpml-transit-tools.jar"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="src" path="/org.eclipse.jdt.ui"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Modified: development/laboratory/ide/eclipse/TransitPlugin/plugin.xml
==============================================================================
--- development/laboratory/ide/eclipse/TransitPlugin/plugin.xml (original)
+++ development/laboratory/ide/eclipse/TransitPlugin/plugin.xml Thu Mar 3
23:36:21 2005
@@ -6,7 +6,6 @@
version="1.0.0"
provider-name="DPML"
class="net.dpml.ide.eclipse.plugins.magic.MagicPlugin">
-
<runtime>
<library name="TransitPlugin.jar">
<export name="*"/>
@@ -34,6 +33,7 @@
<import plugin="org.eclipse.platform"/>
<import plugin="org.eclipse.jdt.core"/>
<import plugin="org.eclipse.core.resources"/>
+ <import plugin="org.eclipse.debug.core"/>
</requires>
<extension
point="org.eclipse.jdt.core.classpathContainerInitializer">
@@ -42,17 +42,4 @@
class="net.dpml.ide.eclipse.plugins.magic.MagicClasspathInitializer"
/>
</extension>
- <extension
- point="org.eclipse.ui.preferencePages">
- <page
- category="Java"
-
class="net.dpml.ide.eclipse.plugins.magic.preferences.MagicPreferencePage"
- id="MagicPreferencePage"
- name="Magic"/>
- </extension>
- <extension
- point="org.eclipse.core.runtime.preferences">
- <initializer
class="net.dpml.ide.eclipse.plugins.magic.preferences.MagicPreferenceInitializer"/>
- </extension>
-
</plugin>
Modified:
development/laboratory/ide/eclipse/TransitPlugin/src/net/dpml/ide/eclipse/plugins/magic/MagicContainer.java
==============================================================================
---
development/laboratory/ide/eclipse/TransitPlugin/src/net/dpml/ide/eclipse/plugins/magic/MagicContainer.java
(original)
+++
development/laboratory/ide/eclipse/TransitPlugin/src/net/dpml/ide/eclipse/plugins/magic/MagicContainer.java
Thu Mar 3 23:36:21 2005
@@ -43,6 +43,8 @@
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.core.ClasspathEntry;
import org.eclipse.ui.internal.Workbench;
public class MagicContainer implements IClasspathContainer
@@ -53,9 +55,12 @@
private ILog log;
public final static String ID = "net.dpml.MAGIC";
private IFile indexFile;
+ private IJavaProject javaProject;
+ private IProject proj;
public MagicContainer( IJavaProject project, IPath containerPath )
{
+ this.javaProject = project;
log = MagicPlugin.getDefault().getLog();
log.log(new Status(Status.INFO, "net.dpml.MagicPlugin", 0,
"ContainerPath: " + containerPath, null));
this.path = containerPath;
@@ -63,7 +68,7 @@
{
return;
}
- IProject proj =
ResourcesPlugin.getWorkspace().getRoot().getProject(project.getElementName());
+ proj =
ResourcesPlugin.getWorkspace().getRoot().getProject(project.getElementName());
log.log(new Status(Status.INFO, "net.dpml.MagicPlugin", 0,
"Project: " + proj, null));
indexFile = proj.getFile(new
Path(containerPath.removeFirstSegments(1).toString()));
try
@@ -77,10 +82,45 @@
{
log.log(new Status(Status.WARNING, "net.dpml.MagicPlugin",
0, "Could not initialize MagicContainer ", npe));
}
+ setProjetSources();
}
+ private void setProjetSources()
+ {
+ TreeMap collectedSources = new TreeMap();
+ IdeProjectDefinition[] projects = index.getProjectDefinitions();
+ for ( int i = 0; i < projects.length; i++ ) {
+ IdeProjectDefinition project = projects[i];
+ System.out.println( "Checking project " + project.getName());
+ collectSources(project, collectedSources);
+ }
+
+ List sourceEntries = new ArrayList();
+
+ Iterator collSources = collectedSources.values().iterator();
+ while (collSources.hasNext())
+ {
+ IClasspathEntry srcDir = (IClasspathEntry) collSources.next();
+ sourceEntries.add(srcDir);
+ }
+ IClasspathEntry[]
sourcePath=(IClasspathEntry[])sourceEntries.toArray(new
IClasspathEntry[sourceEntries.size()]);
+ try
+ {
+ javaProject.setRawClasspath(sourcePath,
proj.getFullPath().append(new Path("bin")), null);
+ }
+ catch ( JavaModelException e )
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+
+ }
+
+
+
public IClasspathEntry[] getClasspathEntries()
{
if(index==null)
@@ -97,10 +137,10 @@
e.printStackTrace();
}
TreeMap collectedDeps = new TreeMap();
+ TreeMap collectedSources = new TreeMap();
IdeProjectDefinition[] projects = index.getProjectDefinitions();
for ( int i = 0; i < projects.length; i++ ) {
IdeProjectDefinition project = projects[i];
- System.out.println( "Checking project " + project.getName());
try
{
String basedir =
project.getFullBaseFile().getCanonicalPath();
@@ -133,22 +173,41 @@
return (IClasspathEntry[])entries.toArray(new
IClasspathEntry[entries.size()]);
}
+ private void collectSources( IdeProjectDefinition project, TreeMap
collectedSources )
+ {
+ IPath basePath = new Path(project.getBasePath());
+ IPath main = basePath.append("src/main");
+ IPath test = basePath.append("src/test");
+ IPath java = basePath.append("src/java");
+ if (proj.exists(main))
+ {
+ IPath source =
proj.getFullPath().append(proj.getFile(main).getProjectRelativePath());
+
collectedSources.put(main.toString(),JavaCore.newSourceEntry(source));
+ }
+ /**
+ if (proj.exists(test))
+ {
+
collectedSources.put(test.toString(),JavaCore.newSourceEntry(proj.getFolder(test).getProjectRelativePath()));
+ }
+ if (proj.exists(java))
+ {
+
collectedSources.put(java.toString(),JavaCore.newSourceEntry(proj.getFolder(java).getProjectRelativePath()));
+ }*/
+ }
+
+
+
private File getDependencyPath( IdeDefinition resolved )
{
File resolvedPath = null;
if ( resolved != null ) {
if ( resolved.isProjectDefinition() ) {
IdeProjectDefinition projectDependency =
(IdeProjectDefinition)resolved;
- //not handled right now
resolvedPath = null;
}
else {
IdeResourceDefinition resource =
(IdeResourceDefinition)resolved;
resolvedPath = resource.getFullPath();
- String libName = resource.getGroup().replace('/', '.')
- + "." + resource.getName()
- + "." + resource.getType()
- + "#" + resource.getVersion();
}
}
return resolvedPath;
- svn commit: r1939 - in development/laboratory/ide/eclipse/TransitPlugin: . META-INF src/net/dpml/ide/eclipse/plugins/magic, pneubauer, 03/03/2005
Archive powered by MHonArc 2.6.24.