notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r1929 - in development/laboratory/ide/eclipse/TransitPlugin: . META-INF lib src/net/dpml/transit
- From: pneubauer AT netcompartner.com
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r1929 - in development/laboratory/ide/eclipse/TransitPlugin: . META-INF lib src/net/dpml/transit
- Date: Wed, 02 Mar 2005 23:03:35 +0100
Author: pneubauer
Date: Wed Mar 2 23:03:34 2005
New Revision: 1929
Added:
development/laboratory/ide/eclipse/TransitPlugin/lib/
development/laboratory/ide/eclipse/TransitPlugin/lib/ant-1.6.2.jar
(contents, props changed)
development/laboratory/ide/eclipse/TransitPlugin/lib/dpml-ide-common-magic-SNAPSHOT.jar
(contents, props changed)
development/laboratory/ide/eclipse/TransitPlugin/lib/dpml-magic-core-SNAPSHOT.jar
(contents, props changed)
development/laboratory/ide/eclipse/TransitPlugin/lib/dpml-transit-main.jar
(contents, props changed)
development/laboratory/ide/eclipse/TransitPlugin/lib/dpml-transit-tools.jar
(contents, props changed)
Removed:
development/laboratory/ide/eclipse/TransitPlugin/ant-1.6.2.jar
development/laboratory/ide/eclipse/TransitPlugin/dpml-magic-core-SNAPSHOT.jar
development/laboratory/ide/eclipse/TransitPlugin/dpml-transit-main.jar
development/laboratory/ide/eclipse/TransitPlugin/dpml-transit-tools.jar
Modified:
development/laboratory/ide/eclipse/TransitPlugin/.classpath
development/laboratory/ide/eclipse/TransitPlugin/META-INF/MANIFEST.MF
development/laboratory/ide/eclipse/TransitPlugin/src/net/dpml/transit/MagicContainer.java
Log:
using ide-commons now, great work Raffael!
Modified: development/laboratory/ide/eclipse/TransitPlugin/.classpath
==============================================================================
--- development/laboratory/ide/eclipse/TransitPlugin/.classpath (original)
+++ development/laboratory/ide/eclipse/TransitPlugin/.classpath Wed Mar 2
23:03:34 2005
@@ -7,5 +7,10 @@
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="dpml-magic-core-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="ant-1.6.2.jar"/>
+ <classpathentry kind="lib" path="lib/ant-1.6.2.jar"/>
+ <classpathentry kind="lib"
path="lib/dpml-ide-common-magic-SNAPSHOT.jar"/>
+ <classpathentry kind="lib" path="lib/dpml-magic-core-SNAPSHOT.jar"/>
+ <classpathentry kind="lib" path="lib/dpml-transit-main.jar"/>
+ <classpathentry kind="lib" path="lib/dpml-transit-tools.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified:
development/laboratory/ide/eclipse/TransitPlugin/META-INF/MANIFEST.MF
==============================================================================
--- development/laboratory/ide/eclipse/TransitPlugin/META-INF/MANIFEST.MF
(original)
+++ development/laboratory/ide/eclipse/TransitPlugin/META-INF/MANIFEST.MF
Wed Mar 2 23:03:34 2005
@@ -3,11 +3,12 @@
Bundle-Name: TransitPlugin Plug-in
Bundle-SymbolicName: TransitPlugin
Bundle-Version: 1.0.0
-Bundle-ClassPath: ant-1.6.2.jar,
- TransitPlugin.jar,
- dpml-transit-main.jar,
- dpml-transit-tools.jar,
- dpml-magic-core-SNAPSHOT.jar
+Bundle-ClassPath: TransitPlugin.jar,
+ lib/ant-1.6.2.jar,
+ lib/dpml-ide-common-magic-SNAPSHOT.jar,
+ lib/dpml-magic-core-SNAPSHOT.jar,
+ lib/dpml-transit-main.jar,
+ lib/dpml-transit-tools.jar
Bundle-Activator: transitPlugin.TransitPlugin
Bundle-Localization: plugin
Export-Package: transitPlugin
Added: development/laboratory/ide/eclipse/TransitPlugin/lib/ant-1.6.2.jar
==============================================================================
Binary file. No diff available.
Added:
development/laboratory/ide/eclipse/TransitPlugin/lib/dpml-ide-common-magic-SNAPSHOT.jar
==============================================================================
Binary file. No diff available.
Added:
development/laboratory/ide/eclipse/TransitPlugin/lib/dpml-magic-core-SNAPSHOT.jar
==============================================================================
Binary file. No diff available.
Added:
development/laboratory/ide/eclipse/TransitPlugin/lib/dpml-transit-main.jar
==============================================================================
Binary file. No diff available.
Added:
development/laboratory/ide/eclipse/TransitPlugin/lib/dpml-transit-tools.jar
==============================================================================
Binary file. No diff available.
Modified:
development/laboratory/ide/eclipse/TransitPlugin/src/net/dpml/transit/MagicContainer.java
==============================================================================
---
development/laboratory/ide/eclipse/TransitPlugin/src/net/dpml/transit/MagicContainer.java
(original)
+++
development/laboratory/ide/eclipse/TransitPlugin/src/net/dpml/transit/MagicContainer.java
Wed Mar 2 23:03:34 2005
@@ -17,9 +17,20 @@
*/
package net.dpml.transit;
+import java.io.File;
+import java.io.IOException;
import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
+import java.util.Set;
+import net.dpml.ide.common.magic.IdeDefinition;
+import net.dpml.ide.common.magic.IdeDependency;
+import net.dpml.ide.common.magic.IdeIndex;
+import net.dpml.ide.common.magic.IdeProjectDefinition;
+import net.dpml.ide.common.magic.IdeResourceDefinition;
+import net.dpml.ide.common.magic.UnresolvedDependencyException;
import net.dpml.magic.Index;
import net.dpml.magic.model.Definition;
import net.dpml.magic.model.Resource;
@@ -33,36 +44,93 @@
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.JavaCore;
-public class MagicContainer extends ContextualTask implements
IClasspathContainer
+public class MagicContainer implements IClasspathContainer
{
private IPath path;
- private Definition definition;
+ private IdeIndex index = new IdeIndex();
public MagicContainer( IPath containerPath )
{
this.path = containerPath;
- this.definition = getProjectDefinition();
+ File indexFile = new File( containerPath.toOSString() );
+ index.loadIndex( indexFile );
+
}
public IClasspathEntry[] getClasspathEntries()
{
- List entries = new ArrayList();
- ResourceRef[] rrs = definition.getResourceRefs();
- ArrayList resources = getResources(rrs);
+ try
+ {
+ index.flattenProjectDependencies();
+ }
+ catch ( UnresolvedDependencyException e )
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ HashMap collectedDeps = new HashMap();
+ 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();
+ }
+ catch ( IOException e )
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ IdeDependency[] deps = project.getDependencies();
+ for (int k= 0; k<deps.length;k++ )
+ {
+ IdeDependency dep = deps[k];
+ IdeDefinition resolved = index.resolve(dep.getKey());
+ File depPath = getDependencyPath( resolved );
+ if (depPath!=null)
+ {
+ collectedDeps.put(dep.getKey(), depPath);
+ }
+ }
+ }
+ List entries = new ArrayList();
+ Iterator collEntries = collectedDeps.values().iterator();
//for (int i = 0; i < rs.length; i++) {
- for(int i=0,n=resources.size();i<n;i++){
- Resource resource = (Resource) resources.get(i);
- org.apache.tools.ant.types.Path resourcePath =
resource.getPath(getIndex().getProject(), 0);
- entries.add(JavaCore.newLibraryEntry(new
Path(resourcePath.toString()), null, null));
+ while (collEntries.hasNext())
+ {
+ File dep = (File) collEntries.next();
+ entries.add(JavaCore.newLibraryEntry(new
Path(dep.getAbsolutePath()), null, null));
}
return (IClasspathEntry[])entries.toArray(new
IClasspathEntry[entries.size()]);
}
+ 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;
+ }
+
public String getDescription()
{
- return "Deps [" + definition.getKey() + "]";
+ return "Deps [" +path + "]";
}
public int getKind()
@@ -75,23 +143,5 @@
return path;
}
- private Definition getProjectDefinition() {
- Context ctx = getContext();
- String key = ctx.getKey();
- ResourceRef ref = new ResourceRef(key);
- Index index = getIndex();
- return index.getDefinition(ref);
- }
-
- private ArrayList getResources(ResourceRef[] rrs) {
- ArrayList resources = new ArrayList();
- for (int i = 0; i < rrs.length; i++) {
-// rs[i] = getHome().getResource(rrs[i]);
- Resource r = getIndex().getResource(rrs[i]);
- resources.add(r);
- resources.addAll( getResources( r.getResourceRefs() ) ); //
recursive
- }
- return resources;
- }
}
- svn commit: r1929 - in development/laboratory/ide/eclipse/TransitPlugin: . META-INF lib src/net/dpml/transit, pneubauer, 03/02/2005
Archive powered by MHonArc 2.6.24.