Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeneviève Bastien2014-01-08 19:20:45 +0000
committerGenevieve Bastien2014-01-09 01:59:40 +0000
commite9fff0d6a9152aa4390decb90ef8d768c33032a1 (patch)
treeb626a3ff271fefaeb4dae7554148d1226fa7bb0b
parent9de67edc86e8cf7de411619be8a5a88884e8f5c9 (diff)
downloadorg.eclipse.linuxtools-e9fff0d6a9152aa4390decb90ef8d768c33032a1.tar.gz
org.eclipse.linuxtools-e9fff0d6a9152aa4390decb90ef8d768c33032a1.tar.xz
org.eclipse.linuxtools-e9fff0d6a9152aa4390decb90ef8d768c33032a1.zip
TMF: Add possibility to overwrite the path of the workspace root
By setting the environment variable TRACING_RCP_ROOT on the command line, it uses this path as the workspace root instead of the default user home directory. Change-Id: I3cadec5b162e1dac99c4b5b9f30308a21c351f50 Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net> Reviewed-on: https://git.eclipse.org/r/20400 Tested-by: Hudson CI Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
-rw-r--r--lttng/org.eclipse.linuxtools.tracing.rcp.ui/src/org/eclipse/linuxtools/internal/tracing/rcp/ui/TracingRcpPlugin.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/lttng/org.eclipse.linuxtools.tracing.rcp.ui/src/org/eclipse/linuxtools/internal/tracing/rcp/ui/TracingRcpPlugin.java b/lttng/org.eclipse.linuxtools.tracing.rcp.ui/src/org/eclipse/linuxtools/internal/tracing/rcp/ui/TracingRcpPlugin.java
index c2863df1ee..1ad47df7d4 100644
--- a/lttng/org.eclipse.linuxtools.tracing.rcp.ui/src/org/eclipse/linuxtools/internal/tracing/rcp/ui/TracingRcpPlugin.java
+++ b/lttng/org.eclipse.linuxtools.tracing.rcp.ui/src/org/eclipse/linuxtools/internal/tracing/rcp/ui/TracingRcpPlugin.java
@@ -71,12 +71,20 @@ public class TracingRcpPlugin extends AbstractUIPlugin {
}
/**
- * Gets the tracing workspace root directory
+ * Gets the tracing workspace root directory. By default it uses the user's
+ * home directory. This value can be overwritten by using the global
+ * TRACING_RCP_ROOT environment variable.
*
* @return the tracing workspace root directory
*/
public static String getWorkspaceRoot() {
- return System.getProperty("user.home"); //$NON-NLS-1$
+ /* Look for the environment variable in the global environment variables */
+ String workspaceRoot = System.getenv().get("TRACING_RCP_ROOT"); //$NON-NLS-1$
+ if (workspaceRoot == null) {
+ /* Use the user's home directory */
+ workspaceRoot = System.getProperty("user.home"); //$NON-NLS-1$
+ }
+ return workspaceRoot;
}
// ------------------------------------------------------------------------

Back to the top