1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Qt fixes for scanner info and launching.

Qt builds now clear the scanner info cache so that it reloads.
Also added Environment tab for Qt Local launch so that you can
override the environment. Supported for 'run'.

Change-Id: Id6a04a564587411b6a5846f00045f79f5696bfb8
This commit is contained in:
Doug Schaefer 2016-01-29 15:08:21 -05:00
parent aca9b68b02
commit 326759fe8c
6 changed files with 41 additions and 3 deletions

View file

@ -155,7 +155,7 @@ public abstract class CBuildConfiguration extends PlatformObject {
} }
public void clearScannerInfoCache() throws CoreException { public void clearScannerInfoCache() throws CoreException {
scannerInfoCache = null; scannerInfoCache.clear();
} }
public Collection<CConsoleParser> getConsoleParsers() throws CoreException { public Collection<CConsoleParser> getConsoleParsers() throws CoreException {

View file

@ -89,6 +89,13 @@ public class QtBuilder extends IncrementalProjectBuilder {
console.monitor(process, null, buildDir); console.monitor(process, null, buildDir);
project.refreshLocal(IResource.DEPTH_INFINITE, monitor); project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
// clear the scanner info cache
// TODO be more surgical about what to clear based on what was
// built.
qtConfig.clearScannerInfoCache();
console.writeOutput("Complete.\n");
return new IProject[] { project }; return new IProject[] { project };
} catch (IOException e) { } catch (IOException e) {
throw new CoreException(new Status(IStatus.ERROR, Activator.ID, "Building " + project.getName(), e)); //$NON-NLS-1$ throw new CoreException(new Status(IStatus.ERROR, Activator.ID, "Building " + project.getName(), e)); //$NON-NLS-1$

View file

@ -21,6 +21,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.launchbar.core.target.ILaunchTarget; import org.eclipse.launchbar.core.target.ILaunchTarget;
import org.eclipse.launchbar.core.target.launch.ITargetedLaunch; import org.eclipse.launchbar.core.target.launch.ITargetedLaunch;
@ -44,6 +45,14 @@ public class QtLocalRunLaunchConfigDelegate extends QtLaunchConfigurationDelegat
Map<String, String> env = builder.environment(); Map<String, String> env = builder.environment();
qtBuildConfig.setProgramEnvironment(env); qtBuildConfig.setProgramEnvironment(env);
Map<String, String> configEnv = configuration.getAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES,
(Map<String, String>) null);
if (configEnv != null) {
for (Map.Entry<String, String> entry : configEnv.entrySet()) {
env.put(entry.getKey(), entry.getValue());
}
}
try { try {
Process process = builder.start(); Process process = builder.start();
DebugPlugin.newProcess(launch, process, "main"); DebugPlugin.newProcess(launch, process, "main");

View file

@ -211,6 +211,12 @@ public class QtBuildConfiguration extends CBuildConfiguration {
args.add(resource.getLocation().toString()); args.add(resource.getLocation().toString());
String[] includePaths = getProperty("INCLUDEPATH").split(" "); //$NON-NLS-1$ //$NON-NLS-2$ String[] includePaths = getProperty("INCLUDEPATH").split(" "); //$NON-NLS-1$ //$NON-NLS-2$
for (int i = 0; i < includePaths.length; ++i) {
Path path = Paths.get(includePaths[i]);
if (!path.isAbsolute()) {
includePaths[i] = getBuildDirectory().resolve(path).toString();
}
}
ILanguage language = LanguageManager.getInstance() ILanguage language = LanguageManager.getInstance()
.getLanguage(CCorePlugin.getContentType(getProject(), resource.getName()), getProject()); // $NON-NLS-1$ .getLanguage(CCorePlugin.getContentType(getProject(), resource.getName()), getProject()); // $NON-NLS-1$
@ -223,4 +229,10 @@ public class QtBuildConfiguration extends CBuildConfiguration {
return info; return info;
} }
@Override
public void clearScannerInfoCache() throws CoreException {
super.clearScannerInfoCache();
properties = null;
}
} }

View file

@ -95,6 +95,15 @@
</launchMode> </launchMode>
</launchConfigurationTabGroup> </launchConfigurationTabGroup>
</extension> </extension>
<extension
point="org.eclipse.debug.ui.launchConfigurationTabs">
<tab
class="org.eclipse.debug.ui.EnvironmentTab"
group="org.eclipse.cdt.qt.ui.launchConfigurationTabGroup"
id="org.eclipse.cdt.qt.ui.tab.env"
name="Environment">
</tab>
</extension>
<extension <extension
point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectorTargets"> point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectorTargets">
<target <target

View file

@ -52,7 +52,7 @@ public class QtResourceChangeListener implements IResourceChangeListener {
// Only traverse children of Qt Projects // Only traverse children of Qt Projects
try { try {
IProject project = (IProject) resource; IProject project = (IProject) resource;
if (project.exists() && project.hasNature(QtNature.ID)) { if (project.exists() && project.isOpen() && project.hasNature(QtNature.ID)) {
return true; return true;
} }
} catch (CoreException e) { } catch (CoreException e) {
@ -119,7 +119,8 @@ public class QtResourceChangeListener implements IResourceChangeListener {
if (!deltaList.isEmpty()) { if (!deltaList.isEmpty()) {
new QtProjectFileUpdateJob(deltaList).schedule(); new QtProjectFileUpdateJob(deltaList).schedule();
} }
// Schedule the job to update the tern server with added/deleted qml files // Schedule the job to update the tern server with added/deleted qml
// files
if (!qmlDeltaList.isEmpty()) { if (!qmlDeltaList.isEmpty()) {
new QMLTernFileUpdateJob(qmlDeltaList).schedule(); new QMLTernFileUpdateJob(qmlDeltaList).schedule();
} }