Author: hibou
Date: Tue Oct 13 13:07:23 2009
New Revision: 824737
URL: http://svn.apache.org/viewvc?rev=824737&view=rev
Log:
IVYDE-187: allow to skip the version matching, with a warning about its use
(thanks to Phillip Webb)
Modified:
ant/ivy/ivyde/trunk/CHANGES.txt
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceInitializer.java
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/WorkspaceResolverPreferencePage.java
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/workspaceresolver/WorkspaceResolver.java
Modified: ant/ivy/ivyde/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/CHANGES.txt?rev=824737&r1=824736&r2=824737&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/CHANGES.txt (original)
+++ ant/ivy/ivyde/trunk/CHANGES.txt Tue Oct 13 13:07:23 2009
@@ -12,6 +12,7 @@
- NEW: Make the Ivy console filter on the logging level (IVYDE-205)
- IMPROVE: Wrap cache cleaning in a job so that it does not block the
workspace (IVYDE-207) (thanks to Jon Schneider)
+- IMPROVE: Allow workspace resolver to skip version matcher (IVYDE-187)
(thanks to Phillip Webb)
- FIX: "Ivy Settings Path" Browse button results in an incorrectly formatted
URL (IVYDE-191) (thanks to Jon Schneider)
- FIX: Workspace Resolver Prevents Source Download (IVYDE-188) (thanks to
Phillip Webb)
Modified:
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java
URL:
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java?rev=824737&r1=824736&r2=824737&view=diff
==============================================================================
---
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java
(original)
+++
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java
Tue Oct 13 13:07:23 2009
@@ -190,4 +190,13 @@
public void setIvyConsoleLogLevel(int logLevel) {
prefStore.setValue(PreferenceConstants.IVY_CONSOLE_LOG_LEVEL,
logLevel);
}
+
+ public boolean getIgnoreVersionOnWorkspaceProjects() {
+ return
prefStore.getBoolean(PreferenceConstants.IGNORE_VERSION_ON_WORKSPACE_PROJECTS);
+ }
+
+ public void setIgnoreVersionOnWorkspaceProjects(boolean
ignoreVersionOnWorkspaceProjects) {
+
prefStore.setValue(PreferenceConstants.IGNORE_VERSION_ON_WORKSPACE_PROJECTS,
+ ignoreVersionOnWorkspaceProjects);
+ }
}
Modified:
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java
URL:
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java?rev=824737&r1=824736&r2=824737&view=diff
==============================================================================
---
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java
(original)
+++
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java
Tue Oct 13 13:07:23 2009
@@ -81,4 +81,6 @@
public static final String AUTO_RESOLVE_ON_CHANGE = "autoResolve.change";
public static final String IVY_CONSOLE_LOG_LEVEL = "ivyConsole.logLevel";
+
+ public static final String IGNORE_VERSION_ON_WORKSPACE_PROJECTS =
"workspaceResolver.ignoreVersion";
}
Modified:
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceInitializer.java
URL:
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceInitializer.java?rev=824737&r1=824736&r2=824737&view=diff
==============================================================================
---
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceInitializer.java
(original)
+++
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceInitializer.java
Tue Oct 13 13:07:23 2009
@@ -111,6 +111,8 @@
public static final boolean DEFAULT_AUTO_RESOLVE_ON_CHANGE = true;
+ public static final boolean DEFAULT_IGNORE_VERSION_ON_WORKSPACE_PROJECTS =
false;
+
public void initializeDefaultPreferences() {
IPreferenceStore store = IvyPlugin.getDefault().getPreferenceStore();
store.setDefault(PreferenceConstants.P_BOOLEAN, true);
@@ -160,6 +162,8 @@
store.setDefault(PreferenceConstants.AUTO_RESOLVE_ON_CHANGE,
DEFAULT_AUTO_RESOLVE_ON_CHANGE);
store.setDefault(PreferenceConstants.IVY_CONSOLE_LOG_LEVEL,
DEFAULT_IVY_CONSOLE_LOG_MESSAGE);
+
+
store.setDefault(PreferenceConstants.IGNORE_VERSION_ON_WORKSPACE_PROJECTS,
DEFAULT_IGNORE_VERSION_ON_WORKSPACE_PROJECTS);
}
}
Modified:
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/WorkspaceResolverPreferencePage.java
URL:
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/WorkspaceResolverPreferencePage.java?rev=824737&r1=824736&r2=824737&view=diff
==============================================================================
---
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/WorkspaceResolverPreferencePage.java
(original)
+++
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/WorkspaceResolverPreferencePage.java
Tue Oct 13 13:07:23 2009
@@ -20,6 +20,8 @@
import org.apache.ivyde.eclipse.IvyPlugin;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.IWorkbench;
@@ -56,8 +58,7 @@
BooleanFieldEditor autoResolveOnOpen = new BooleanFieldEditor(
PreferenceConstants.AUTO_RESOLVE_ON_OPEN,
- "On project opening trigger resolve on every other project",
- fieldParent) {
+ "On project opening trigger resolve on every other project",
fieldParent) {
protected Label getLabelControl() {
Label label = super.getLabelControl();
label.setToolTipText("Will automatically resolve projects in
the "
@@ -67,6 +68,26 @@
};
addField(autoResolveOnOpen);
+ BooleanFieldEditor ignoreVersionOnWorkspaceProjects = new
BooleanFieldEditor(
+ PreferenceConstants.IGNORE_VERSION_ON_WORKSPACE_PROJECTS,
+ "Ignore version when resolving workspace projects",
fieldParent) {
+ protected Label getLabelControl() {
+ Label label = super.getLabelControl();
+ label.setToolTipText("Will ignore the artifact version when
resolving "
+ + "against workspace projects");
+ return label;
+ }
+ };
+
+ addField(ignoreVersionOnWorkspaceProjects);
+
+ Label warning = new Label(fieldParent, SWT.NONE);
+ warning.setText("WARNING: you should use this only if you are sure the
projets opened\n"
+ + "in your workspace can actually work with each other, be
carefull with\n"
+ + "branch management for instance)");
+ GridData gridData = new GridData();
+ gridData.horizontalIndent = 40;
+ warning.setLayoutData(gridData);
}
public void init(IWorkbench workbench) {
Modified:
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/workspaceresolver/WorkspaceResolver.java
URL:
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/workspaceresolver/WorkspaceResolver.java?rev=824737&r1=824736&r2=824737&view=diff
==============================================================================
---
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/workspaceresolver/WorkspaceResolver.java
(original)
+++
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/workspaceresolver/WorkspaceResolver.java
Tue Oct 13 13:07:23 2009
@@ -62,31 +62,31 @@
* changes, this resolver will link dependent projects when they are open in
the same workspace,
* allowing full-fledged linked project functionality Eclipse provides, such
as incremental
* compilation, debugging, mouseover javadocs, and source browsing across
projects.
- *
+ *
* <b>How it works</b> During a resolve, it looks at all open projects in the
workspace that have
* Ivy containers. The <b>first</b> project that publishes the module on which
the project being
* resolved depends, will be picked and returned as a special type of artifact
called "project".
- *
+ *
* The IvyClasspathContainer will recognize the artifact as a project and put
the eclipse project as
* a dependent project within the classpath container of the parent.
- *
+ *
* If you do not want a project to be linked as a dependency, close it or
delete from the workspace.
* As soon as you do that, any projects that were linked to it will
automatically re-resolve (see
* {...@link WorkspaceResourceChangeListener}) and use the standard Ivy means
of finding the
* dependency.
- *
+ *
* The {...@link WorkspaceResourceChangeListener} will also auto-resolve when
a new project is added or
* opened, so opening a project will automatically link it into the currently
open projects where
* necessary.
- *
+ *
* Since the resolver is not aware which module revision a project is
publishing, it optimistically
* matches any revision of the module.
- *
+ *
* Since the resolver stops after finding the first open project which matches
the module, having
* multiple open versions of the same project in the workspace (for example,
different branches) may
* set the wrong version as a dependency. You are advised to only open the
version of the project
* which you want other projects in the workspace to depend on.
- *
+ *
* NOTE: Transitive dependencies are not passed from the dependent project to
the parent when
* projects are linked. If you find you are missing some transitive
dependencies, just set your
* dependent eclipse project to export its ivy dependencies.
(Project->Properties->Java Build
@@ -106,6 +106,8 @@
private IJavaProject[] projects;
+ private boolean ignoreVersionOnWorkspaceProjects;
+
public WorkspaceResolver(IJavaProject javaProject, IvySettings
ivySettings) {
this.resolvingJavaProject = javaProject;
setName(javaProject.getElementName() + "-ivyde-workspace-resolver");
@@ -118,6 +120,8 @@
IvyPlugin.log(IStatus.ERROR, "JDT Error while resolving in
workspace for "
+ resolvingJavaProject.getElementName(), e);
}
+
+ ignoreVersionOnWorkspaceProjects =
IvyPlugin.getPreferenceStoreHelper().getIgnoreVersionOnWorkspaceProjects();
}
public DownloadReport download(Artifact[] artifacts, DownloadOptions
options) {
@@ -180,7 +184,8 @@
}
// Found one; check if it is for the module we need
- if
(md.getModuleRevisionId().getRevision().equals(Ivy.getWorkingRevision())
+ if (ignoreVersionOnWorkspaceProjects
+ ||
md.getModuleRevisionId().getRevision().equals(Ivy.getWorkingRevision())
|| versionMatcher.accept(dd.getDependencyRevisionId(),
md)) {
Artifact af = new
DefaultArtifact(md.getModuleRevisionId(), md