Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1970 - development/laboratory/ide/common/magic/src/main/net/dpml/ide/common/magic

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: herzog AT raffael.ch
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r1970 - development/laboratory/ide/common/magic/src/main/net/dpml/ide/common/magic
  • Date: Mon, 07 Mar 2005 21:44:10 -0500

Author: herzog AT raffael.ch
Date: Mon Mar 7 21:44:10 2005
New Revision: 1970

Modified:

development/laboratory/ide/common/magic/src/main/net/dpml/ide/common/magic/IdeIndex.java
Log:
Ignore duplicate projects as these often occur when doing heavy importing (as
Metro does), only load modules of type jar, so we can throw an exception, if
a dependency can't be resolved.

Modified:
development/laboratory/ide/common/magic/src/main/net/dpml/ide/common/magic/IdeIndex.java
==============================================================================
---
development/laboratory/ide/common/magic/src/main/net/dpml/ide/common/magic/IdeIndex.java
(original)
+++
development/laboratory/ide/common/magic/src/main/net/dpml/ide/common/magic/IdeIndex.java
Mon Mar 7 21:44:10 2005
@@ -102,29 +102,28 @@
Definition[] defs = index.getDefinitions();
for ( int i = 0; i < defs.length; i++ ) {
Definition def = defs[i];
- if ( projectDefs.containsKey(def.getInfo().getName()) ) {
- throw new BuildException("Duplicate project definition: " +
def.getInfo().getName());
- }
- IdeProjectDefinition prj = new
IdeProjectDefinition(file.getParent(), def);
- ResourceRef[] parts = def.getPartRefs();
- for ( int j = 0; j < parts.length; j++ ) {
- ResourceRef part = parts[j];
- IdeDependency dep = new IdeDependency(part.getKey(), true);
- dep.setBuildEnabled(part.getPolicy().isBuildEnabled());
- dep.setTestEnabled(part.getPolicy().isTestEnabled());
- dep.setRuntimeEnabled(part.getPolicy().isRuntimeEnabled());
- prj.addDependency(dep);
- }
- ResourceRef[] resources = def.getResourceRefs();
- for ( int j = 0; j < resources.length; j++ ) {
- ResourceRef resource = resources[j];
- IdeDependency dep = new IdeDependency(resource.getKey(),
false);
- dep.setBuildEnabled(resource.getPolicy().isBuildEnabled());
- dep.setTestEnabled(resource.getPolicy().isTestEnabled());
-
dep.setRuntimeEnabled(resource.getPolicy().isRuntimeEnabled());
- prj.addDependency(dep);
+ if ( def.getInfo().getType().equals("jar") &&
!projectDefs.containsKey(def.getInfo().getName()) ) {
+ IdeProjectDefinition prj = new
IdeProjectDefinition(file.getParent(), def);
+ ResourceRef[] parts = def.getPartRefs();
+ for ( int j = 0; j < parts.length; j++ ) {
+ ResourceRef part = parts[j];
+ IdeDependency dep = new IdeDependency(part.getKey(),
true);
+ dep.setBuildEnabled(part.getPolicy().isBuildEnabled());
+ dep.setTestEnabled(part.getPolicy().isTestEnabled());
+
dep.setRuntimeEnabled(part.getPolicy().isRuntimeEnabled());
+ prj.addDependency(dep);
+ }
+ ResourceRef[] resources = def.getResourceRefs();
+ for ( int j = 0; j < resources.length; j++ ) {
+ ResourceRef resource = resources[j];
+ IdeDependency dep = new IdeDependency(resource.getKey(),
false);
+
dep.setBuildEnabled(resource.getPolicy().isBuildEnabled());
+ dep.setTestEnabled(resource.getPolicy().isTestEnabled());
+
dep.setRuntimeEnabled(resource.getPolicy().isRuntimeEnabled());
+ prj.addDependency(dep);
+ }
+ projectDefs.put(prj.getName(), prj);
}
- projectDefs.put(prj.getName(), prj);
}
Resource[] resources = index.getResources();
for ( int i = 0; i < resources.length; i++ ) {
@@ -224,9 +223,7 @@
private void flattenProjectDependencies(IdeProjectDefinition root,
IdeDependency dependency, Set visited) throws UnresolvedDependencyException {
IdeDefinition resource = resolve(dependency.getKey());
if ( resource == null ) {
- // FIXME: this doesn't look right
- //throw new UnresolvedDependencyException(dependency.getKey());
- return;
+ throw new UnresolvedDependencyException(dependency.getKey());
}
if ( !visited.contains(resource) ) {
visited.add(resource);



  • svn commit: r1970 - development/laboratory/ide/common/magic/src/main/net/dpml/ide/common/magic, herzog, 03/07/2005

Archive powered by MHonArc 2.6.24.

Top of Page