commit | c55e93ce6c1c4b6013ab18360b5fbb3d69683b40 | [log] [tgz] |
---|---|---|
author | GianMaria Romanato <gm.romanato@gmail.com> | Sun Jan 01 19:14:37 2017 +0100 |
committer | GianMaria Romanato <gm.romanato@gmail.com> | Sun Jan 01 19:14:37 2017 +0100 |
tree | d7dc90e0b721d05f5ba6f1ab51debc226882c3e7 | |
parent | f3d5845ac00b1d556988ea2c7207327480665132 [diff] |
509803: Runtime wizard should use relative paths when updating repository properties file Originally the Virgo tools where adding new folders to the repository properties file as absolute path. Now the tools use paths relative to the Virgo home when possible.
diff --git a/org.eclipse.virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/PDEHelper.java b/org.eclipse.virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/PDEHelper.java index 19555f5..9b559b6 100644 --- a/org.eclipse.virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/PDEHelper.java +++ b/org.eclipse.virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/PDEHelper.java
@@ -310,9 +310,15 @@ Properties added = new Properties(); int count = 0; + IPath virgoHome = runtime.getLocation(); + for (File file : newFoldersSet) { + IPath path = new Path(file.getCanonicalPath()); + if (virgoHome.isPrefixOf(path)) { + path = path.removeFirstSegments(virgoHome.segmentCount()); + } added.put(ADDED_BY_VIRGO_TOOLS + count + REPO_TYPE, TYPE_WATCHED); - added.put(ADDED_BY_VIRGO_TOOLS + count + WATCH_DIRECTORY, file.getCanonicalPath()); + added.put(ADDED_BY_VIRGO_TOOLS + count + WATCH_DIRECTORY, path.toString()); count++; }
diff --git a/org.eclipse.virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/PDETargetPlatformWizardFragment.java b/org.eclipse.virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/PDETargetPlatformWizardFragment.java index 550eced..f190c05 100644 --- a/org.eclipse.virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/PDETargetPlatformWizardFragment.java +++ b/org.eclipse.virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/PDETargetPlatformWizardFragment.java
@@ -77,6 +77,8 @@ */ @Override public void performFinish(IProgressMonitor monitor) throws CoreException { - targetPlatformComposite.performFinish(monitor); + if (targetPlatformComposite != null) { + targetPlatformComposite.performFinish(monitor); + } } }