aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodrigo Fraxino Araujo2013-09-24 17:17:39 (EDT)
committerJeff Johnston2013-12-06 19:45:35 (EST)
commit7fc62393aafda3333745a4290650b41536250cf8 (patch)
treeff652d6d68b1010fbaff8214202ad08f45f4e672
parent3223f89cc702f8fe68194a4c73afb0a0941d53a4 (diff)
downloadorg.eclipse.linuxtools-7fc62393aafda3333745a4290650b41536250cf8.zip
org.eclipse.linuxtools-7fc62393aafda3333745a4290650b41536250cf8.tar.gz
org.eclipse.linuxtools-7fc62393aafda3333745a4290650b41536250cf8.tar.bz2
Fix binary and working dir of main tab for sync projectsrefs/changes/95/18995/3
Change-Id: Ia6c3fe2012e2661d4bc64889db6502049f84fbf8 Reviewed-on: https://git.eclipse.org/r/18995 Tested-by: Hudson CI Reviewed-by: Jeff Johnston <jjohnstn@redhat.com> IP-Clean: Jeff Johnston <jjohnstn@redhat.com> Tested-by: Jeff Johnston <jjohnstn@redhat.com>
-rw-r--r--profiling/org.eclipse.linuxtools.profiling-feature/feature.xml2
-rw-r--r--profiling/org.eclipse.linuxtools.profiling-feature/pom.xml2
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.launch/META-INF/MANIFEST.MF2
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.launch/pom.xml2
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyCMainTab.java87
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyManager.java23
6 files changed, 76 insertions, 42 deletions
diff --git a/profiling/org.eclipse.linuxtools.profiling-feature/feature.xml b/profiling/org.eclipse.linuxtools.profiling-feature/feature.xml
index 44243fd..e91ebd0 100644
--- a/profiling/org.eclipse.linuxtools.profiling-feature/feature.xml
+++ b/profiling/org.eclipse.linuxtools.profiling-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.linuxtools.profiling"
label="%featureName"
- version="2.0.0.qualifier"
+ version="2.2.0.qualifier"
provider-name="%featureProvider"
license-feature="org.eclipse.linuxtools.license.feature"
license-feature-version="1.0.0.qualifier">
diff --git a/profiling/org.eclipse.linuxtools.profiling-feature/pom.xml b/profiling/org.eclipse.linuxtools.profiling-feature/pom.xml
index 420a3cf..edd1673 100644
--- a/profiling/org.eclipse.linuxtools.profiling-feature/pom.xml
+++ b/profiling/org.eclipse.linuxtools.profiling-feature/pom.xml
@@ -18,7 +18,7 @@
</parent>
<artifactId>org.eclipse.linuxtools.profiling</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.2.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
<name>Linux Tools Profiling Framework Feature</name>
diff --git a/profiling/org.eclipse.linuxtools.profiling.launch/META-INF/MANIFEST.MF b/profiling/org.eclipse.linuxtools.profiling.launch/META-INF/MANIFEST.MF
index 69a1807..474f690 100644
--- a/profiling/org.eclipse.linuxtools.profiling.launch/META-INF/MANIFEST.MF
+++ b/profiling/org.eclipse.linuxtools.profiling.launch/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: org.eclipse.linuxtools.profiling.launch;singleton:=true
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 2.2.0.qualifier
Bundle-Activator: org.eclipse.linuxtools.internal.profiling.launch.ProfileLaunchPlugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
diff --git a/profiling/org.eclipse.linuxtools.profiling.launch/pom.xml b/profiling/org.eclipse.linuxtools.profiling.launch/pom.xml
index f487ca5..faed214 100644
--- a/profiling/org.eclipse.linuxtools.profiling.launch/pom.xml
+++ b/profiling/org.eclipse.linuxtools.profiling.launch/pom.xml
@@ -18,7 +18,7 @@
</parent>
<artifactId>org.eclipse.linuxtools.profiling.launch</artifactId>
- <version>2.1.0-SNAPSHOT</version>
+ <version>2.2.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<name>Linux Tools Profiling Launch Plug-in</name>
diff --git a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyCMainTab.java b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyCMainTab.java
index 35d6841..86d0dc9 100644
--- a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyCMainTab.java
+++ b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyCMainTab.java
@@ -142,12 +142,12 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
setControl(comp);
ProfileLaunchPlugin
- .getDefault()
- .getWorkbench()
- .getHelpSystem()
- .setHelp(
- getControl(),
- ICDTLaunchHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_MAIN_TAB);
+ .getDefault()
+ .getWorkbench()
+ .getHelpSystem()
+ .setHelp(
+ getControl(),
+ ICDTLaunchHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_MAIN_TAB);
GridLayout topLayout = new GridLayout();
comp.setLayout(topLayout);
@@ -301,10 +301,10 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
protected void handleSearchButtonSelected() {
if (getCProject() == null) {
MessageDialog
- .openInformation(
- getShell(),
- LaunchMessages.CMainTab_Project_required,
- LaunchMessages.CMainTab_Enter_project_before_searching_for_program);
+ .openInformation(
+ getShell(),
+ LaunchMessages.CMainTab_Project_required,
+ LaunchMessages.CMainTab_Enter_project_before_searching_for_program);
return;
}
@@ -531,24 +531,25 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
protected void updateWorkingDirFromConfig(ILaunchConfiguration config) {
if (workingDirText != null) {
- String workingDir = EMPTY_STRING;
+ String projectDir = EMPTY_STRING;
try {
- workingDir = config.getAttribute(ATTR_REMOTE_WORKING_DIRECTORY_NAME, EMPTY_STRING);
+ projectDir = config.getAttribute(ATTR_REMOTE_WORKING_DIRECTORY_NAME, EMPTY_STRING);
} catch (CoreException ce) {
ProfileLaunchPlugin.log(ce);
}
- if (workingDir.equals(EMPTY_STRING)){
- if(this.fProjText != null){
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IProject project = root.getProject(this.fProjText.getText());
- if(project != null){
- workingDir = project.getLocationURI().toString();
- }
+ if (projectDir.equals(EMPTY_STRING)){
+ if(this.fProjText != null){
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IProject project = root.getProject(this.fProjText.getText());
+ try {
+ projectDir = RemoteProxyManager.getInstance().getRemoteProjectLocation(project);
+ } catch (CoreException e) {
+ setErrorMessage(fPreviouslyCheckedWorkingDirErrorMsg = ProxyLaunchMessages.error_accessing_working_directory);
}
+ }
}
-
- workingDirText.setText(workingDir);
+ workingDirText.setText(projectDir);
}
}
@@ -595,9 +596,9 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
}
fPreviouslyCheckedCopyFromExe = name;
fPreviouslyCheckedCopyFromExeIsValid = true; // we'll flip this below if
- // not true
+ // not true
fPreviouslyCheckedCopyFromExeErrorMsg = null; // we'll set this below if
- // there's an error
+ // there's an error
IPath exePath;
URI exeURI = null;
boolean passed = false;
@@ -615,7 +616,7 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
URI projectURI = project.getLocationURI();
exeURI = new URI(projectURI.getScheme(),
projectURI.getAuthority(), projectURI.getRawPath() + '/'
- + exePath.toString(), EMPTY_STRING);
+ + exePath.toString(), EMPTY_STRING);
}
if (exeURI != null) {
passed = true;
@@ -645,7 +646,7 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
if (exeFI != null) {
if (exeFI.exists()) {
if (exeFI.getAttribute(EFS.ATTRIBUTE_EXECUTABLE) &&
- !exeFI.isDirectory()) {
+ !exeFI.isDirectory()) {
passed = true;
} else {
setErrorMessage(fPreviouslyCheckedCopyFromExeErrorMsg = ProxyLaunchMessages.copy_from_exe_does_not_have_execution_rights);
@@ -690,9 +691,9 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
}
fPreviouslyCheckedProgram = name;
fPreviouslyCheckedProgramIsValid = true; // we'll flip this below if
- // not true
+ // not true
fPreviouslyCheckedProgramErrorMsg = null; // we'll set this below if
- // there's an error
+ // there's an error
IPath exePath;
URI exeURI = null;
boolean passed = false;
@@ -711,7 +712,7 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
URI projectURI = project.getLocationURI();
exeURI = new URI(projectURI.getScheme(),
projectURI.getAuthority(), projectURI.getRawPath() + '/'
- + exePath.toString(), EMPTY_STRING);
+ + exePath.toString(), EMPTY_STRING);
}
if (exeURI != null) {
passed = true;
@@ -745,7 +746,7 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
} else {
if (exeFI.exists()) {
if (exeFI.getAttribute(EFS.ATTRIBUTE_EXECUTABLE) &&
- !exeFI.isDirectory()) {
+ !exeFI.isDirectory()) {
passed = true;
} else {
setErrorMessage(fPreviouslyCheckedProgramErrorMsg = ProxyLaunchMessages.executable_does_not_have_execution_rights);
@@ -789,9 +790,9 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
}
fPreviouslyCheckedWorkingDir = name;
fPreviouslyCheckedWorkingDirIsValid = true; // we'll flip this below if
- // not true
+ // not true
fPreviouslyCheckedWorkingDirErrorMsg = null; // we'll set this below if
- // there's an error
+ // there's an error
IPath wdPath;
URI wdURI = null;
boolean passed = false;
@@ -810,7 +811,7 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
URI projectURI = project.getLocationURI();
wdURI = new URI(projectURI.getScheme(),
projectURI.getAuthority(), projectURI.getRawPath() + '/'
- + wdPath.toString(), EMPTY_STRING);
+ + wdPath.toString(), EMPTY_STRING);
}
if (wdURI != null) {
passed = true;
@@ -1092,11 +1093,25 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
binary = (IBinary) cElement;
}
+ String projectDir = EMPTY_STRING;
+ ConfigUtils configUtils = new ConfigUtils(config);
+ IProject project = null;
+ try {
+ project = ConfigUtils.getProject(configUtils.getProjectName());
+ } catch (CoreException e) {
+ setErrorMessage(fPreviouslyCheckedWorkingDirErrorMsg = ProxyLaunchMessages.error_accessing_working_directory);
+ }
+ if(project != null){
+ try {
+ projectDir = RemoteProxyManager.getInstance().getRemoteProjectLocation(project);
+ } catch (CoreException e) {
+ setErrorMessage(fPreviouslyCheckedWorkingDirErrorMsg = ProxyLaunchMessages.error_accessing_working_directory);
+ }
+ }
+
+ String path = EMPTY_STRING;
if (binary != null) {
- String path;
path = binary.getResource().getProjectRelativePath().toOSString();
- config.setAttribute(
- ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, path);
if (!renamed) {
String name = binary.getElementName();
int index = name.lastIndexOf('.');
@@ -1108,6 +1123,8 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
renamed = true;
}
}
+ config.setAttribute(
+ ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, projectDir + IPath.SEPARATOR + path);
if (!renamed) {
String name = getLaunchConfigurationDialog().generateName(
diff --git a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyManager.java b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyManager.java
index 13f108d..09ce4f7 100644
--- a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyManager.java
+++ b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyManager.java
@@ -94,7 +94,7 @@ public class RemoteProxyManager implements IRemoteProxyManager {
return manager.getFileProxy(uri);
else
throw new CoreException(new Status(IStatus.ERROR, ProfileLaunchPlugin.PLUGIN_ID,
- IStatus.OK, Messages.RemoteProxyManager_unrecognized_scheme + scheme, null));
+ IStatus.OK, Messages.RemoteProxyManager_unrecognized_scheme + scheme, null));
}
return getLocalFileProxy(uri);
}
@@ -120,7 +120,7 @@ public class RemoteProxyManager implements IRemoteProxyManager {
if (scheme != null && !scheme.equals(LOCALSCHEME)){
IRemoteProxyManager manager = getRemoteManager(scheme);
if (manager != null)
- return manager.getLauncher(uri);
+ return manager.getLauncher(uri);
}
return new LocalLauncher();
}
@@ -145,7 +145,7 @@ public class RemoteProxyManager implements IRemoteProxyManager {
if (scheme != null && !scheme.equals(LOCALSCHEME)){
IRemoteProxyManager manager = getRemoteManager(scheme);
if (manager != null)
- return manager.getOS(uri);
+ return manager.getOS(uri);
}
return Platform.getOS();
}
@@ -161,5 +161,22 @@ public class RemoteProxyManager implements IRemoteProxyManager {
return getOS(projectURI);
}
+ /**
+ * This method gets the proper remote project location
+ * of pure remote and sync projects. Synchronized projects
+ * have a cached path and a remote one, and this method
+ * returns the remote one.
+ * @return string containing the project location
+ * @since 2.2
+ */
+ public String getRemoteProjectLocation(IProject project) throws CoreException {
+ if(project != null){
+ IRemoteFileProxy remoteFileProxy = null;
+ remoteFileProxy = getFileProxy(project);
+ URI workingDirURI = remoteFileProxy.getWorkingDir();
+ return workingDirURI.toString();
+ }
+ return null;
+ }
}