diff options
author | Torbjorn Svensson | 2021-04-14 20:41:38 +0000 |
---|---|---|
committer | Thomas Watson | 2021-04-16 20:27:26 +0000 |
commit | d12be71505874b8d74e0243100c8fedad3f698f4 (patch) | |
tree | 7ed4f4d7a43bcf612597507346c13c5eda2d7c89 | |
parent | e52cc6c2dca7fb067f359476e7b90e8e4e8b7f42 (diff) | |
download | rt.equinox.framework-d12be71505874b8d74e0243100c8fedad3f698f4.tar.gz rt.equinox.framework-d12be71505874b8d74e0243100c8fedad3f698f4.tar.xz rt.equinox.framework-d12be71505874b8d74e0243100c8fedad3f698f4.zip |
Bug 572890: Define installation directory relative to launcherI20210418-1800I20210417-2330I20210416-1800
Add support for "@launcher.dir" symbol for the -install paramter. This
will replace @launcher.dir with the path to the launcher and thus allow
the installation tree to be moved as long as the sub-tree relation stays
constant.
Contributed by STMicroelectronics
Change-Id: I02dbd35b4078779eba62ed64fd39a2b67bc9f302
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
Reviewed-on: https://git.eclipse.org/r/c/equinox/rt.equinox.framework/+/179406
Tested-by: Thomas Watson <tjwatson@us.ibm.com>
Reviewed-by: Thomas Watson <tjwatson@us.ibm.com>
3 files changed, 9 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.launcher/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.launcher/META-INF/MANIFEST.MF index 1c7ecb733..586eb8a83 100644 --- a/bundles/org.eclipse.equinox.launcher/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.launcher/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.equinox.launcher;singleton:=true -Bundle-Version: 1.6.100.qualifier +Bundle-Version: 1.6.200.qualifier Main-Class: org.eclipse.equinox.launcher.Main Bundle-ClassPath: . Bundle-Vendor: %providerName diff --git a/bundles/org.eclipse.equinox.launcher/pom.xml b/bundles/org.eclipse.equinox.launcher/pom.xml index 2bd958b01..22fa2c172 100644 --- a/bundles/org.eclipse.equinox.launcher/pom.xml +++ b/bundles/org.eclipse.equinox.launcher/pom.xml @@ -19,6 +19,6 @@ </parent> <groupId>org.eclipse.equinox</groupId> <artifactId>org.eclipse.equinox.launcher</artifactId> - <version>1.6.100-SNAPSHOT</version> + <version>1.6.200-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project> diff --git a/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java b/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java index 957398938..522fae7cb 100644 --- a/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java +++ b/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java @@ -233,6 +233,7 @@ public class Main { private static final String USER_DIR = "@user.dir"; //$NON-NLS-1$ // Placeholder for hashcode of installation directory private static final String INSTALL_HASH_PLACEHOLDER = "@install.hash"; //$NON-NLS-1$ + private static final String LAUNCHER_DIR = "@launcher.dir"; //$NON-NLS-1$ // types of parent classloaders the framework can have private static final String PARENT_CLASSLOADER_APP = "app"; //$NON-NLS-1$ @@ -1960,6 +1961,12 @@ public class Main { // value is not set so compute the default and set the value String installArea = System.getProperty(PROP_INSTALL_AREA); if (installArea != null) { + if (installArea.startsWith(LAUNCHER_DIR)) { + String launcher = System.getProperty(PROP_LAUNCHER); + if (launcher == null) + throw new IllegalStateException("Install location depends on launcher, but launcher is not defined"); //$NON-NLS-1$ + installArea = installArea.replaceAll(LAUNCHER_DIR, new File(launcher).getParent()); + } installLocation = buildURL(installArea, true); if (installLocation == null) throw new IllegalStateException("Install location is invalid: " + installArea); //$NON-NLS-1$ |