1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-30 20:35:38 +02:00

bug 342069: Scanner discovery output is lost when running compiler specs command

This commit is contained in:
Andrew Gvozdev 2011-04-23 18:02:47 +00:00
parent 3d1b5b91df
commit 8f6af04d2a
2 changed files with 26 additions and 1 deletions

View file

@ -10,11 +10,13 @@
*******************************************************************************/
package org.eclipse.cdt.make.core.scannerconfig;
import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.core.resources.IProject;
public final class InfoContext {
private IProject fProject;
private String fInstanceId;
private ILanguage fLanguage;
public InfoContext(IProject project){
this(project, null);
@ -25,10 +27,26 @@ public final class InfoContext {
this.fInstanceId = instanceId != null ? instanceId : ""; //$NON-NLS-1$
}
/**
* @since 7.1
*/
public InfoContext(IProject project, String instanceId, ILanguage language){
this.fProject = project;
this.fInstanceId = instanceId != null ? instanceId : ""; //$NON-NLS-1$
this.fLanguage = language;
}
public String getInstanceId(){
return fInstanceId;
}
/**
* @since 7.1
*/
public ILanguage getLanguage(){
return fLanguage;
}
@Override
public boolean equals(Object obj) {
if(obj == this)

View file

@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.cdt.build.core.scannerconfig;
import org.eclipse.cdt.core.model.ILanguage;
import org.eclipse.cdt.core.model.LanguageManager;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
import org.eclipse.cdt.core.settings.model.util.CDataUtil;
@ -90,7 +92,12 @@ public final class CfgInfoContext{
}
String instanceId = buf.toString();
fContext = new InfoContext(project, instanceId);
if (fInType!=null) {
ILanguage language = LanguageManager.getInstance().getLanguage(fInType.getSourceContentType());
fContext = new InfoContext(project, instanceId, language);
} else {
fContext = new InfoContext(project, instanceId);
}
}
return fContext;
}