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:
parent
aca9b68b02
commit
326759fe8c
6 changed files with 41 additions and 3 deletions
|
@ -155,7 +155,7 @@ public abstract class CBuildConfiguration extends PlatformObject {
|
|||
}
|
||||
|
||||
public void clearScannerInfoCache() throws CoreException {
|
||||
scannerInfoCache = null;
|
||||
scannerInfoCache.clear();
|
||||
}
|
||||
|
||||
public Collection<CConsoleParser> getConsoleParsers() throws CoreException {
|
||||
|
|
|
@ -89,6 +89,13 @@ public class QtBuilder extends IncrementalProjectBuilder {
|
|||
console.monitor(process, null, buildDir);
|
||||
|
||||
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 };
|
||||
} catch (IOException e) {
|
||||
throw new CoreException(new Status(IStatus.ERROR, Activator.ID, "Building " + project.getName(), e)); //$NON-NLS-1$
|
||||
|
|
|
@ -21,6 +21,7 @@ import org.eclipse.core.runtime.Status;
|
|||
import org.eclipse.debug.core.DebugPlugin;
|
||||
import org.eclipse.debug.core.ILaunch;
|
||||
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.launch.ITargetedLaunch;
|
||||
|
||||
|
@ -44,6 +45,14 @@ public class QtLocalRunLaunchConfigDelegate extends QtLaunchConfigurationDelegat
|
|||
Map<String, String> env = builder.environment();
|
||||
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 {
|
||||
Process process = builder.start();
|
||||
DebugPlugin.newProcess(launch, process, "main");
|
||||
|
|
|
@ -211,6 +211,12 @@ public class QtBuildConfiguration extends CBuildConfiguration {
|
|||
args.add(resource.getLocation().toString());
|
||||
|
||||
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()
|
||||
.getLanguage(CCorePlugin.getContentType(getProject(), resource.getName()), getProject()); // $NON-NLS-1$
|
||||
|
@ -223,4 +229,10 @@ public class QtBuildConfiguration extends CBuildConfiguration {
|
|||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearScannerInfoCache() throws CoreException {
|
||||
super.clearScannerInfoCache();
|
||||
properties = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -95,6 +95,15 @@
|
|||
</launchMode>
|
||||
</launchConfigurationTabGroup>
|
||||
</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
|
||||
point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectorTargets">
|
||||
<target
|
||||
|
|
|
@ -52,7 +52,7 @@ public class QtResourceChangeListener implements IResourceChangeListener {
|
|||
// Only traverse children of Qt Projects
|
||||
try {
|
||||
IProject project = (IProject) resource;
|
||||
if (project.exists() && project.hasNature(QtNature.ID)) {
|
||||
if (project.exists() && project.isOpen() && project.hasNature(QtNature.ID)) {
|
||||
return true;
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
|
@ -119,7 +119,8 @@ public class QtResourceChangeListener implements IResourceChangeListener {
|
|||
if (!deltaList.isEmpty()) {
|
||||
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()) {
|
||||
new QMLTernFileUpdateJob(qmlDeltaList).schedule();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue