mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 02:06:01 +02:00
Build Output Concolse parser added for ManagedGCC discpvery profiles
This commit is contained in:
parent
f089bbf2b4
commit
c11d44bf9e
5 changed files with 138 additions and 9 deletions
|
@ -530,4 +530,8 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
|
||||||
this.project = context.getProject();
|
this.project = context.getProject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public InfoContext getContext(){
|
||||||
|
return this.context;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,6 +79,10 @@
|
||||||
<scannerInfoCollector
|
<scannerInfoCollector
|
||||||
class="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGCCScannerInfoCollector"
|
class="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGCCScannerInfoCollector"
|
||||||
scope="project"/>
|
scope="project"/>
|
||||||
|
<buildOutputProvider>
|
||||||
|
<open/>
|
||||||
|
<scannerInfoConsoleParser class="org.eclipse.cdt.managedbuilder.internal.scannerconfig.ManagedGCCScannerInfoConsoleParser"/>
|
||||||
|
</buildOutputProvider>
|
||||||
<scannerInfoProvider providerId="specsFile">
|
<scannerInfoProvider providerId="specsFile">
|
||||||
<run
|
<run
|
||||||
arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}"
|
arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}"
|
||||||
|
@ -94,6 +98,10 @@
|
||||||
<scannerInfoCollector
|
<scannerInfoCollector
|
||||||
class="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGCCScannerInfoCollector"
|
class="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGCCScannerInfoCollector"
|
||||||
scope="project"/>
|
scope="project"/>
|
||||||
|
<buildOutputProvider>
|
||||||
|
<open/>
|
||||||
|
<scannerInfoConsoleParser class="org.eclipse.cdt.managedbuilder.internal.scannerconfig.ManagedGCCScannerInfoConsoleParser"/>
|
||||||
|
</buildOutputProvider>
|
||||||
<scannerInfoProvider providerId="specsFile">
|
<scannerInfoProvider providerId="specsFile">
|
||||||
<run
|
<run
|
||||||
arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp"
|
arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp"
|
||||||
|
@ -109,6 +117,10 @@
|
||||||
<scannerInfoCollector
|
<scannerInfoCollector
|
||||||
class="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGCCScannerInfoCollector"
|
class="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGCCScannerInfoCollector"
|
||||||
scope="project"/>
|
scope="project"/>
|
||||||
|
<buildOutputProvider>
|
||||||
|
<open/>
|
||||||
|
<scannerInfoConsoleParser class="org.eclipse.cdt.managedbuilder.internal.scannerconfig.ManagedGCCScannerInfoConsoleParser"/>
|
||||||
|
</buildOutputProvider>
|
||||||
<scannerInfoProvider providerId="specsFile">
|
<scannerInfoProvider providerId="specsFile">
|
||||||
<run
|
<run
|
||||||
arguments="-E -P -v -dD ${plugin_state_location}/specs.c"
|
arguments="-E -P -v -dD ${plugin_state_location}/specs.c"
|
||||||
|
@ -124,6 +136,10 @@
|
||||||
<scannerInfoCollector
|
<scannerInfoCollector
|
||||||
class="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGnuWinScannerInfoCollector"
|
class="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGnuWinScannerInfoCollector"
|
||||||
scope="project"/>
|
scope="project"/>
|
||||||
|
<buildOutputProvider>
|
||||||
|
<open/>
|
||||||
|
<scannerInfoConsoleParser class="org.eclipse.cdt.managedbuilder.internal.scannerconfig.ManagedGCCScannerInfoConsoleParser"/>
|
||||||
|
</buildOutputProvider>
|
||||||
<scannerInfoProvider providerId="specsFile">
|
<scannerInfoProvider providerId="specsFile">
|
||||||
<run
|
<run
|
||||||
arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}"
|
arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}"
|
||||||
|
@ -139,6 +155,10 @@
|
||||||
<scannerInfoCollector
|
<scannerInfoCollector
|
||||||
class="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGnuWinScannerInfoCollector"
|
class="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGnuWinScannerInfoCollector"
|
||||||
scope="project"/>
|
scope="project"/>
|
||||||
|
<buildOutputProvider>
|
||||||
|
<open/>
|
||||||
|
<scannerInfoConsoleParser class="org.eclipse.cdt.managedbuilder.internal.scannerconfig.ManagedGCCScannerInfoConsoleParser"/>
|
||||||
|
</buildOutputProvider>
|
||||||
<scannerInfoProvider providerId="specsFile">
|
<scannerInfoProvider providerId="specsFile">
|
||||||
<run
|
<run
|
||||||
arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp"
|
arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp"
|
||||||
|
@ -154,6 +174,10 @@
|
||||||
<scannerInfoCollector
|
<scannerInfoCollector
|
||||||
class="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGnuWinScannerInfoCollector"
|
class="org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGnuWinScannerInfoCollector"
|
||||||
scope="project"/>
|
scope="project"/>
|
||||||
|
<buildOutputProvider>
|
||||||
|
<open/>
|
||||||
|
<scannerInfoConsoleParser class="org.eclipse.cdt.managedbuilder.internal.scannerconfig.ManagedGCCScannerInfoConsoleParser"/>
|
||||||
|
</buildOutputProvider>
|
||||||
<scannerInfoProvider providerId="specsFile">
|
<scannerInfoProvider providerId="specsFile">
|
||||||
<run
|
<run
|
||||||
arguments="-E -P -v -dD ${plugin_state_location}/specs.c"
|
arguments="-E -P -v -dD ${plugin_state_location}/specs.c"
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.build.core.scannerconfig;
|
package org.eclipse.cdt.build.core.scannerconfig;
|
||||||
|
|
||||||
|
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;
|
import org.eclipse.cdt.core.settings.model.util.CDataUtil;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.InfoContext;
|
import org.eclipse.cdt.make.core.scannerconfig.InfoContext;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
|
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
|
||||||
|
@ -17,6 +19,7 @@ import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IInputType;
|
import org.eclipse.cdt.managedbuilder.core.IInputType;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
|
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ITool;
|
import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
|
import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
|
|
||||||
|
@ -92,7 +95,7 @@ public final class CfgInfoContext{
|
||||||
return fContext;
|
return fContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CfgInfoContext fromInfoContext(IConfiguration cfg, InfoContext context) {
|
public static CfgInfoContext fromInfoContext(ICProjectDescription des, InfoContext context) {
|
||||||
IProject project = context.getProject();
|
IProject project = context.getProject();
|
||||||
if(project == null)
|
if(project == null)
|
||||||
return null;
|
return null;
|
||||||
|
@ -103,9 +106,19 @@ public final class CfgInfoContext{
|
||||||
|
|
||||||
String[] ids = CDataUtil.stringToArray(instanceId, DELIMITER);
|
String[] ids = CDataUtil.stringToArray(instanceId, DELIMITER);
|
||||||
String cfgId = ids[0];
|
String cfgId = ids[0];
|
||||||
if(!cfgId.equals(cfg.getId()))
|
|
||||||
|
ICConfigurationDescription cfgDes = des.getConfigurationById(cfgId);
|
||||||
|
if(cfgDes == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(cfgDes);
|
||||||
|
if(cfg == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return doCreate(cfg, ids, context);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static CfgInfoContext doCreate(IConfiguration cfg, String[] ids, InfoContext context){
|
||||||
String rcInfoId = null, toolId = null, inTypeId = null;
|
String rcInfoId = null, toolId = null, inTypeId = null;
|
||||||
IResourceInfo rcInfo = null;
|
IResourceInfo rcInfo = null;
|
||||||
ITool tool = null;
|
ITool tool = null;
|
||||||
|
@ -142,6 +155,24 @@ public final class CfgInfoContext{
|
||||||
if(rcInfo != null)
|
if(rcInfo != null)
|
||||||
return new CfgInfoContext(rcInfo, tool, inType, context);
|
return new CfgInfoContext(rcInfo, tool, inType, context);
|
||||||
return new CfgInfoContext(cfg, context);
|
return new CfgInfoContext(cfg, context);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CfgInfoContext fromInfoContext(IConfiguration cfg, InfoContext context) {
|
||||||
|
IProject project = context.getProject();
|
||||||
|
if(project == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
String instanceId = context.getInstanceId();
|
||||||
|
if(instanceId.length() == 0)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
String[] ids = CDataUtil.stringToArray(instanceId, DELIMITER);
|
||||||
|
String cfgId = ids[0];
|
||||||
|
if(!cfgId.equals(cfg.getId()))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return doCreate(cfg, ids, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IBuildObject find(IBuildObject objs[], String id){
|
private static IBuildObject find(IBuildObject objs[], String id){
|
||||||
|
|
|
@ -0,0 +1,70 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2007 Intel Corporation and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Intel Corporation - Initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
|
package org.eclipse.cdt.managedbuilder.internal.scannerconfig;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.build.core.scannerconfig.CfgInfoContext;
|
||||||
|
import org.eclipse.cdt.core.model.CoreModel;
|
||||||
|
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||||
|
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
|
||||||
|
import org.eclipse.cdt.make.core.scannerconfig.InfoContext;
|
||||||
|
import org.eclipse.cdt.make.internal.core.scannerconfig.gnu.GCCScannerInfoConsoleParser;
|
||||||
|
import org.eclipse.cdt.make.internal.core.scannerconfig2.PerProjectSICollector;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||||
|
import org.eclipse.core.resources.IProject;
|
||||||
|
|
||||||
|
public class ManagedGCCScannerInfoConsoleParser extends
|
||||||
|
GCCScannerInfoConsoleParser {
|
||||||
|
Boolean fManagedBuildOnState;
|
||||||
|
|
||||||
|
public boolean processLine(String line) {
|
||||||
|
if(isManagedBuildOn())
|
||||||
|
return false;
|
||||||
|
return super.processLine(line);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void shutdown() {
|
||||||
|
if(!isManagedBuildOn()){
|
||||||
|
super.shutdown();
|
||||||
|
}
|
||||||
|
fManagedBuildOnState = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void startup(IProject project, IScannerInfoCollector collector) {
|
||||||
|
if(isManagedBuildOn())
|
||||||
|
return;
|
||||||
|
super.startup(project, collector);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isManagedBuildOn(){
|
||||||
|
if(fManagedBuildOnState == null)
|
||||||
|
fManagedBuildOnState = Boolean.valueOf(doCalcManagedBuildOnState());
|
||||||
|
return fManagedBuildOnState.booleanValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean doCalcManagedBuildOnState(){
|
||||||
|
IScannerInfoCollector cr = getCollector();
|
||||||
|
InfoContext c;
|
||||||
|
if(cr instanceof PerProjectSICollector){
|
||||||
|
c = ((PerProjectSICollector)cr).getContext();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
IProject project = c.getProject();
|
||||||
|
ICProjectDescription des = CoreModel.getDefault().getProjectDescription(project, false);
|
||||||
|
CfgInfoContext cc = CfgInfoContext.fromInfoContext(des, c);
|
||||||
|
if(cc != null){
|
||||||
|
IConfiguration cfg = cc.getConfiguration();
|
||||||
|
return cfg.isManagedBuildOn();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
|
@ -644,27 +644,27 @@
|
||||||
<extension
|
<extension
|
||||||
point="org.eclipse.cdt.make.ui.DiscoveryProfilePage">
|
point="org.eclipse.cdt.make.ui.DiscoveryProfilePage">
|
||||||
<profilePage
|
<profilePage
|
||||||
class="org.eclipse.cdt.make.ui.dialogs.MBSPerProjectSCDProfilePage"
|
class="org.eclipse.cdt.make.ui.dialogs.GCCPerProjectSCDProfilePage"
|
||||||
name="%MBSPerProjectProfile.name"
|
name="%MBSPerProjectProfile.name"
|
||||||
profileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"/>
|
profileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"/>
|
||||||
<profilePage
|
<profilePage
|
||||||
class="org.eclipse.cdt.make.ui.dialogs.MBSPerProjectSCDProfilePage"
|
class="org.eclipse.cdt.make.ui.dialogs.GCCPerProjectSCDProfilePage"
|
||||||
name="%MBSPerProjectProfile.name"
|
name="%MBSPerProjectProfile.name"
|
||||||
profileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
|
profileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
|
||||||
<profilePage
|
<profilePage
|
||||||
class="org.eclipse.cdt.make.ui.dialogs.MBSPerProjectSCDProfilePage"
|
class="org.eclipse.cdt.make.ui.dialogs.GCCPerProjectSCDProfilePage"
|
||||||
name="%MBSPerProjectProfile.name"
|
name="%MBSPerProjectProfile.name"
|
||||||
profileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
|
profileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
|
||||||
<profilePage
|
<profilePage
|
||||||
class="org.eclipse.cdt.make.ui.dialogs.MBSPerProjectSCDProfilePage"
|
class="org.eclipse.cdt.make.ui.dialogs.GCCPerProjectSCDProfilePage"
|
||||||
name="%MBSPerProjectProfile.name"
|
name="%MBSPerProjectProfile.name"
|
||||||
profileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"/>
|
profileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"/>
|
||||||
<profilePage
|
<profilePage
|
||||||
class="org.eclipse.cdt.make.ui.dialogs.MBSPerProjectSCDProfilePage"
|
class="org.eclipse.cdt.make.ui.dialogs.GCCPerProjectSCDProfilePage"
|
||||||
name="%MBSPerProjectProfile.name"
|
name="%MBSPerProjectProfile.name"
|
||||||
profileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"/>
|
profileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"/>
|
||||||
<profilePage
|
<profilePage
|
||||||
class="org.eclipse.cdt.make.ui.dialogs.MBSPerProjectSCDProfilePage"
|
class="org.eclipse.cdt.make.ui.dialogs.GCCPerProjectSCDProfilePage"
|
||||||
name="%MBSPerProjectProfile.name"
|
name="%MBSPerProjectProfile.name"
|
||||||
profileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"/>
|
profileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"/>
|
||||||
</extension>
|
</extension>
|
||||||
|
|
Loading…
Add table
Reference in a new issue