notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r1789 - development/laboratory/ide/idea-plugin/magic/src/main/net/dpml/ide/idea/plugin/magic
- From: herzog AT raffael.ch
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r1789 - development/laboratory/ide/idea-plugin/magic/src/main/net/dpml/ide/idea/plugin/magic
- Date: Wed, 16 Feb 2005 16:15:37 +0100
Author: herzog AT raffael.ch
Date: Wed Feb 16 16:15:36 2005
New Revision: 1789
Modified:
development/laboratory/ide/idea-plugin/magic/src/main/net/dpml/ide/idea/plugin/magic/Configuration.java
development/laboratory/ide/idea-plugin/magic/src/main/net/dpml/ide/idea/plugin/magic/ProjectBuilder.java
development/laboratory/ide/idea-plugin/magic/src/main/net/dpml/ide/idea/plugin/magic/SettingsForm.form
development/laboratory/ide/idea-plugin/magic/src/main/net/dpml/ide/idea/plugin/magic/SettingsForm.java
Log:
Fixed strict syncronization (unneeded dependencies weren't removed) and added
options to include/exclude build, test or runtime dependencies.
Modified:
development/laboratory/ide/idea-plugin/magic/src/main/net/dpml/ide/idea/plugin/magic/Configuration.java
==============================================================================
---
development/laboratory/ide/idea-plugin/magic/src/main/net/dpml/ide/idea/plugin/magic/Configuration.java
(original)
+++
development/laboratory/ide/idea-plugin/magic/src/main/net/dpml/ide/idea/plugin/magic/Configuration.java
Wed Feb 16 16:15:36 2005
@@ -67,6 +67,9 @@
.append(holder.syncWithMagic)
.append(holder.strictSyncing)
.append(holder.recursiveDependencies)
+ .append(holder.includeBuildDependencies)
+ .append(holder.includeTestDependencies)
+ .append(holder.includeRuntimeDependencies)
.append(holder.jUnitLibrary)
.append(holder.cacheDir)
.toHashCode();
@@ -88,6 +91,9 @@
.append(holder.syncWithMagic, h.syncWithMagic)
.append(holder.strictSyncing, h.strictSyncing)
.append(holder.recursiveDependencies,
h.recursiveDependencies)
+ .append(holder.includeBuildDependencies,
h.includeBuildDependencies)
+ .append(holder.includeTestDependencies,
h.includeTestDependencies)
+ .append(holder.includeRuntimeDependencies,
h.includeRuntimeDependencies)
.append(holder.jUnitLibrary, h.jUnitLibrary)
.append(holder.cacheDir, h.cacheDir)
.isEquals();
@@ -155,6 +161,30 @@
holder.recursiveDependencies = recursiveDependencies;
}
+ public boolean getIncludeBuildDependencies() {
+ return holder.includeBuildDependencies;
+ }
+
+ public void setIncludeBuildDependencies(boolean includeBuild) {
+ holder.includeBuildDependencies = includeBuild;
+ }
+
+ public boolean getIncludeTestDependencies() {
+ return holder.includeTestDependencies;
+ }
+
+ public void setIncludeTestDependencies(boolean includeTest) {
+ holder.includeTestDependencies = includeTest;
+ }
+
+ public boolean getIncludeRuntimeDependencies() {
+ return holder.includeRuntimeDependencies;
+ }
+
+ public void setIncludeRuntimeDependencies(boolean includeRuntime) {
+ holder.includeRuntimeDependencies = includeRuntime;
+ }
+
public String getJUnitLibrary() {
return holder.jUnitLibrary;
}
@@ -205,6 +235,9 @@
holder.syncWithMagic = c.holder.syncWithMagic;
holder.strictSyncing = c.holder.strictSyncing;
holder.recursiveDependencies = c.holder.recursiveDependencies;
+ holder.includeBuildDependencies = c.holder.includeBuildDependencies;
+ holder.includeTestDependencies = c.holder.includeTestDependencies;
+ holder.includeRuntimeDependencies =
c.holder.includeRuntimeDependencies;
holder.jUnitLibrary = c.holder.jUnitLibrary;
holder.cacheDir = c.holder.cacheDir;
}
@@ -236,6 +269,18 @@
*/
public boolean recursiveDependencies = true;
/**
+ * Include build dependencies?
+ */
+ public boolean includeBuildDependencies = true;
+ /**
+ * Include test dependencies?
+ */
+ public boolean includeTestDependencies = true;
+ /**
+ * Include runtime dependencies?
+ */
+ public boolean includeRuntimeDependencies = false;
+ /**
* The name of the system level library containing the JUnit
classes. Each module will depend on this.
*/
public String jUnitLibrary = null;
Modified:
development/laboratory/ide/idea-plugin/magic/src/main/net/dpml/ide/idea/plugin/magic/ProjectBuilder.java
==============================================================================
---
development/laboratory/ide/idea-plugin/magic/src/main/net/dpml/ide/idea/plugin/magic/ProjectBuilder.java
(original)
+++
development/laboratory/ide/idea-plugin/magic/src/main/net/dpml/ide/idea/plugin/magic/ProjectBuilder.java
Wed Feb 16 16:15:36 2005
@@ -488,7 +488,7 @@
while ( iter.hasNext() ) {
Dependency dep = (Dependency)iter.next();
//DependentObject d = resolve(dep.getKey());
- if ( !root.getName().equals(dep.getKey()) && !deps.contains(dep)
) {
+ if ( !root.getName().equals(dep.getKey()) && !deps.contains(dep)
&& getIncludeDependency(dep) ) {
deps.add(dep);
//root.addDependency(dep);
DependentObject resolved = resolve(dep.getKey());
@@ -709,19 +709,20 @@
rootModel.setCompilerOutputPath(basedir+"/target/classes");
rootModel.setCompilerOutputPathForTests(basedir+"/target/test-classes");
- Set currentOrderEntries = new HashSet();
+ Map currentOrderEntries = new HashMap();
OrderEntry[] orderEntries = rootModel.getOrderEntries();
for ( int i = 0; i < orderEntries.length; i++ ) {
if ( orderEntries[i] instanceof ModuleOrderEntry ) {
-
currentOrderEntries.add(((ModuleOrderEntry)orderEntries[i]).getModule());
+
currentOrderEntries.put(((ModuleOrderEntry)orderEntries[i]).getModule(),
orderEntries[i]);
}
else if ( orderEntries[i] instanceof LibraryOrderEntry ) {
-
currentOrderEntries.add(((LibraryOrderEntry)orderEntries[i]).getLibrary());
+
currentOrderEntries.put(((LibraryOrderEntry)orderEntries[i]).getLibrary(),
orderEntries[i]);
}
}
Iterator deps = magicProject.getDependencies().iterator();
while ( deps.hasNext() ) {
Dependency d = (Dependency)deps.next();
+ boolean include = getIncludeDependency(d);
DependentObject resolved = resolve(d.getKey());
// FIXME: doesn't look right
if ( resolved == null ) continue;
@@ -732,9 +733,16 @@
addMessage(Message.MSG_WARNING, "No module found for
project " + projectDependency);
}
else {
- if ( !currentOrderEntries.contains(other) ) {
- addMessage(Message.MSG_INFO, "Adding module " +
projectDependency.getModuleName());
- rootModel.addModuleOrderEntry(other);
+ if ( include ) {
+ if ( !currentOrderEntries.containsKey(other) ) {
+ addMessage(Message.MSG_INFO, "Adding module " +
projectDependency.getModuleName());
+ rootModel.addModuleOrderEntry(other);
+ }
+ else {
+ // remove from current order entries -- we'll
delete the remaining dependencies afterwards,
+ // if strict syncing is enabled
+ currentOrderEntries.remove(other);
+ }
}
}
}
@@ -777,8 +785,15 @@
lib.model.addRoot(url, OrderRootType.CLASSES);
}
}
- if ( !currentOrderEntries.contains(lib.lib) ) {
- rootModel.addLibraryEntry(lib.lib);
+ if ( include ) {
+ if ( !currentOrderEntries.containsKey(lib.lib) ) {
+ rootModel.addLibraryEntry(lib.lib);
+ }
+ else {
+ // remove from current order entries -- we'll delete
the remaining dependencies afterwards,
+ // if strict syncing is enabled
+ currentOrderEntries.remove(lib.lib);
+ }
}
}
else {
@@ -790,9 +805,32 @@
if ( config.getJUnitLibrary() != null ) {
Library junit =
LibraryTableUtil.getLibraryTable().getLibraryByName(config.getJUnitLibrary());
if ( junit != null ) {
- if ( !currentOrderEntries.contains(junit) ) {
+ if ( !currentOrderEntries.containsKey(junit) ) {
rootModel.addLibraryEntry(junit);
}
+ else {
+ currentOrderEntries.remove(junit);
+ }
+ }
+ }
+
+ if ( config.getStrictSyncing() ) {
+ // remove remaining order entries
+ Iterator orderEntryIter =
currentOrderEntries.values().iterator();
+ while ( orderEntryIter.hasNext() ) {
+ OrderEntry entry = (OrderEntry)orderEntryIter.next();
+ if ( entry instanceof ModuleOrderEntry ) {
+ addMessage(Message.MSG_INFO, "Removing module dependency
from module "
+
+((ModuleOrderEntry)entry).getModuleName());
+ }
+ else if ( entry instanceof LibraryOrderEntry ) {
+ addMessage(Message.MSG_INFO, "Removing library
dependency from library "
+ +
((LibraryOrderEntry)entry).getLibraryName());
+ }
+ else {
+ addMessage(Message.MSG_INFO, "Removing order entry " +
entry);
+ }
+ rootModel.removeOrderEntry(entry);
}
}
}
@@ -858,6 +896,12 @@
}
}
+ private boolean getIncludeDependency(Dependency dep) {
+ return (config.getIncludeBuildDependencies() && dep.isBuild())
+ || (config.getIncludeTestDependencies() && dep.isTest())
+ || (config.getIncludeRuntimeDependencies() &&
dep.isRuntime());
+ }
+
/**
* Cleanup the project rebuild, i.e. commit or dispose all root/library
models.
*
Modified:
development/laboratory/ide/idea-plugin/magic/src/main/net/dpml/ide/idea/plugin/magic/SettingsForm.form
==============================================================================
---
development/laboratory/ide/idea-plugin/magic/src/main/net/dpml/ide/idea/plugin/magic/SettingsForm.form
(original)
+++
development/laboratory/ide/idea-plugin/magic/src/main/net/dpml/ide/idea/plugin/magic/SettingsForm.form
Wed Feb 16 16:15:36 2005
@@ -18,7 +18,7 @@
<text value="Synchronize with Magic"/>
</properties>
</component>
- <grid id="c8c2f" binding="optionsPanel" row-count="4" column-count="2"
same-size-horizontally="false" same-size-vertically="false" hgap="-1"
vgap="-1">
+ <grid id="c8c2f" binding="optionsPanel" row-count="7" column-count="2"
same-size-horizontally="false" same-size-vertically="false" hgap="-1"
vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="5" y="35" width="455" height="281"/>
@@ -48,11 +48,40 @@
<text value="Apply Dependencies Recursively"/>
</properties>
</component>
+ <component id="ef2e3" class="javax.swing.JCheckBox"
binding="includeRuntime">
+ <constraints>
+ <xy x="5" y="99" width="203" height="23"/>
+ <grid row="4" column="0" row-span="1" col-span="1"
vsize-policy="0" hsize-policy="3" anchor="8" fill="0"/>
+ </constraints>
+ <properties>
+ <text value="Include Runtime Dependencies"/>
+ </properties>
+ </component>
+ <component id="450d2" class="javax.swing.JCheckBox"
binding="includeTest">
+ <constraints>
+ <xy x="4" y="78" width="181" height="23"/>
+ <grid row="3" column="0" row-span="1" col-span="1"
vsize-policy="0" hsize-policy="3" anchor="8" fill="0"/>
+ </constraints>
+ <properties>
+ <selected value="true"/>
+ <text value="Include Test Dependencies"/>
+ </properties>
+ </component>
+ <component id="2c8fb" class="javax.swing.JCheckBox"
binding="includeBuild">
+ <constraints>
+ <xy x="1" y="56" width="184" height="23"/>
+ <grid row="2" column="0" row-span="1" col-span="1"
vsize-policy="0" hsize-policy="3" anchor="8" fill="0"/>
+ </constraints>
+ <properties>
+ <selected value="true"/>
+ <text value="Include Build Dependencies"/>
+ </properties>
+ </component>
<grid id="be1e" binding="optionsPanel2" row-count="2"
column-count="3" same-size-horizontally="false" same-size-vertically="false"
hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
- <xy x="2" y="58" width="451" height="52"/>
- <grid row="2" column="0" row-span="1" col-span="2"
vsize-policy="3" hsize-policy="3" anchor="0" fill="3"/>
+ <xy x="2" y="126" width="451" height="52"/>
+ <grid row="5" column="0" row-span="1" col-span="2"
vsize-policy="3" hsize-policy="3" anchor="0" fill="3"/>
</constraints>
<properties/>
<border type="none"/>
@@ -105,8 +134,8 @@
</grid>
<vspacer id="72cc8">
<constraints>
- <xy x="437" y="110" width="11" height="169"/>
- <grid row="3" column="1" row-span="1" col-span="1"
vsize-policy="6" hsize-policy="1" anchor="0" fill="2"/>
+ <xy x="240" y="186" width="11" height="90"/>
+ <grid row="6" column="1" row-span="1" col-span="1"
vsize-policy="6" hsize-policy="1" anchor="0" fill="2"/>
</constraints>
</vspacer>
</children>
Modified:
development/laboratory/ide/idea-plugin/magic/src/main/net/dpml/ide/idea/plugin/magic/SettingsForm.java
==============================================================================
---
development/laboratory/ide/idea-plugin/magic/src/main/net/dpml/ide/idea/plugin/magic/SettingsForm.java
(original)
+++
development/laboratory/ide/idea-plugin/magic/src/main/net/dpml/ide/idea/plugin/magic/SettingsForm.java
Wed Feb 16 16:15:36 2005
@@ -54,6 +54,9 @@
private JPanel optionsPanel;
private JCheckBox strict;
private JCheckBox recursiveDependencies;
+ private JCheckBox includeBuild;
+ private JCheckBox includeTest;
+ private JCheckBox includeRuntime;
private JPanel optionsPanel2;
private JLabel junitLabel;
@@ -64,6 +67,8 @@
private final Map libraries;
+
+
public SettingsForm(Project project, Logger log, Configuration config) {
this.project = project;
this.log = log;
@@ -119,6 +124,9 @@
sync.setSelected(config.getSyncWithMagic());
strict.setSelected(config.getStrictSyncing());
recursiveDependencies.setSelected(config.getRecursiveDependencies());
+ includeBuild.setSelected(config.getIncludeBuildDependencies());
+ includeTest.setSelected(config.getIncludeTestDependencies());
+ includeRuntime.setSelected(config.getIncludeRuntimeDependencies());
cache.setText(config.getCacheDir());
if ( config.getJUnitLibrary() != null ) {
junit.setSelectedItem(libraries.get(config.getJUnitLibrary()));
@@ -138,6 +146,9 @@
config.setSyncWithMagic(sync.isSelected());
config.setStrictSyncing(strict.isSelected());
config.setRecursiveDependencies(recursiveDependencies.isSelected());
+ config.setIncludeBuildDependencies(includeBuild.isSelected());
+ config.setIncludeTestDependencies(includeTest.isSelected());
+ config.setIncludeRuntimeDependencies(includeRuntime.isSelected());
config.setJUnitLibrary((String)junit.getSelectedItem());
if ( defaultCache.isSelected() ) {
config.setCacheDir(null);
@@ -192,7 +203,7 @@
optionsPanel = new javax.swing.JPanel();
optionsPanel.setVisible(true);
- optionsPanel.setLayout(new
com.intellij.uiDesigner.core.GridLayoutManager(4, 2,
+ optionsPanel.setLayout(new
com.intellij.uiDesigner.core.GridLayoutManager(7, 2,
new Insets(0, 0, 0, 0), -1, -1));
optionsPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
rootPanel.add(optionsPanel, new
com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 3, 0, 3, 7, 7,
@@ -211,10 +222,30 @@
new java.awt.Dimension(-1, -1), new
java.awt.Dimension(-1, -1), new java.awt.Dimension(-1, -1)));
+ includeRuntime = new javax.swing.JCheckBox();
+ includeRuntime.setText("Include Runtime Dependencies");
+ optionsPanel.add(includeRuntime, new
com.intellij.uiDesigner.core.GridConstraints(4, 0, 1, 1, 8, 0, 3, 0,
+ new java.awt.Dimension(-1, -1), new
java.awt.Dimension(-1, -1), new java.awt.Dimension(-1, -1)));
+
+
+ includeTest = new javax.swing.JCheckBox();
+ includeTest.setText("Include Test Dependencies");
+ includeTest.setSelected(true);
+ optionsPanel.add(includeTest, new
com.intellij.uiDesigner.core.GridConstraints(3, 0, 1, 1, 8, 0, 3, 0,
+ new java.awt.Dimension(-1, -1), new
java.awt.Dimension(-1, -1), new java.awt.Dimension(-1, -1)));
+
+
+ includeBuild = new javax.swing.JCheckBox();
+ includeBuild.setText("Include Build Dependencies");
+ includeBuild.setSelected(true);
+ optionsPanel.add(includeBuild, new
com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 1, 8, 0, 3, 0,
+ new java.awt.Dimension(-1, -1), new
java.awt.Dimension(-1, -1), new java.awt.Dimension(-1, -1)));
+
+
optionsPanel2 = new javax.swing.JPanel();
optionsPanel2.setLayout(new
com.intellij.uiDesigner.core.GridLayoutManager(2, 3,
new Insets(0, 0, 0, 0), -1, -1));
- optionsPanel.add(optionsPanel2, new
com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 2, 0, 3, 3, 3,
+ optionsPanel.add(optionsPanel2, new
com.intellij.uiDesigner.core.GridConstraints(5, 0, 1, 2, 0, 3, 3, 3,
new java.awt.Dimension(-1, -1), new
java.awt.Dimension(-1, -1), new java.awt.Dimension(-1, -1)));
@@ -246,7 +277,7 @@
new java.awt.Dimension(-1, -1), new
java.awt.Dimension(-1, -1), new java.awt.Dimension(-1, -1)));
tmpSpacer = new com.intellij.uiDesigner.core.Spacer();
- optionsPanel.add(tmpSpacer, new
com.intellij.uiDesigner.core.GridConstraints(3, 1, 1, 1, 0, 2, 1, 6,
+ optionsPanel.add(tmpSpacer, new
com.intellij.uiDesigner.core.GridConstraints(6, 1, 1, 1, 0, 2, 1, 6,
new java.awt.Dimension(-1, -1), new
java.awt.Dimension(-1, -1), new java.awt.Dimension(-1, -1)));
- svn commit: r1789 - development/laboratory/ide/idea-plugin/magic/src/main/net/dpml/ide/idea/plugin/magic, herzog, 02/16/2005
Archive powered by MHonArc 2.6.24.