Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 124080 Details for
Bug 262824
Configuration Discovery option for Make project is not customizable.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Attached patch addresses reported issues.
bug_in_5.0.2.patch (text/plain), 23.97 KB, created by
Alex Chapiro
on 2009-01-28 15:53:13 EST
(
hide
)
Description:
Attached patch addresses reported issues.
Filename:
MIME Type:
Creator:
Alex Chapiro
Created:
2009-01-28 15:53:13 EST
Size:
23.97 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.make.ui >Index: src/org/eclipse/cdt/make/ui/dialogs/AbstractDiscoveryOptionsBlock.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/AbstractDiscoveryOptionsBlock.java,v >retrieving revision 1.9 >diff -u -r1.9 AbstractDiscoveryOptionsBlock.java >--- src/org/eclipse/cdt/make/ui/dialogs/AbstractDiscoveryOptionsBlock.java 15 Feb 2008 10:29:16 -0000 1.9 >+++ src/org/eclipse/cdt/make/ui/dialogs/AbstractDiscoveryOptionsBlock.java 28 Jan 2009 20:50:14 -0000 >@@ -177,6 +177,10 @@ > */ > private void initializeProfilePageMap() { > fProfilePageMap = new HashMap(5); >+ if(!isInitialized()) { >+ return; >+ } >+ > > IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(MakeUIPlugin.getPluginId(), "DiscoveryProfilePage"); //$NON-NLS-1$ > IConfigurationElement[] infos = extensionPoint.getConfigurationElements(); >Index: src/org/eclipse/cdt/make/ui/dialogs/GCCPerProjectSCDProfilePage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/GCCPerProjectSCDProfilePage.java,v >retrieving revision 1.9 >diff -u -r1.9 GCCPerProjectSCDProfilePage.java >--- src/org/eclipse/cdt/make/ui/dialogs/GCCPerProjectSCDProfilePage.java 2 Apr 2007 12:53:40 -0000 1.9 >+++ src/org/eclipse/cdt/make/ui/dialogs/GCCPerProjectSCDProfilePage.java 28 Jan 2009 20:50:18 -0000 >@@ -11,6 +11,7 @@ > package org.eclipse.cdt.make.ui.dialogs; > > import java.io.File; >+import java.util.List; > > import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2; > import org.eclipse.cdt.make.internal.core.scannerconfig.jobs.BuildOutputReaderJob; >@@ -43,7 +44,6 @@ > * @author vhirsl > */ > public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage { >- private static final String providerId = "specsFile"; //$NON-NLS-1$ > > private static Object lock = GCCPerProjectSCDProfilePage.class; > private Shell shell; >@@ -251,10 +251,22 @@ > } > > private void initializeValues() { >- bopEnabledButton.setSelection(getContainer().getBuildInfo().isBuildOutputParserEnabled()); >- setBopOpenFileText(getContainer().getBuildInfo().getBuildOutputFilePath()); >- sipEnabledButton.setSelection(getContainer().getBuildInfo().isProviderOutputParserEnabled(providerId)); >- sipRunCommandText.setText(getContainer().getBuildInfo().getProviderRunCommand(providerId)); >+ IScannerConfigBuilderInfo2 builderInfo = getContainer().getBuildInfo(); >+ String providerId = getProviderIDForSelectedProfile(); >+ >+ bopEnabledButton.setSelection(builderInfo.isBuildOutputParserEnabled()); >+ setBopOpenFileText(builderInfo.getBuildOutputFilePath()); >+ sipEnabledButton.setSelection(builderInfo.isProviderOutputParserEnabled(providerId)); >+ sipRunCommandText.setText(builderInfo.getProviderRunCommand(providerId)); >+ } >+ >+ private String getProviderIDForSelectedProfile() { >+ IScannerConfigBuilderInfo2 builderInfo = getContainer().getBuildInfo(); >+ // Provider IDs for selected profile >+ List providerIDs = builderInfo.getProviderIdList(); >+ if(providerIDs.size() == 0) >+ return ""; >+ return (String)providerIDs.iterator().next(); > } > > private void handleBOPLoadFileButtonSelected() { >@@ -318,7 +330,7 @@ > buildInfo.setBuildOutputFileActionEnabled(true); > buildInfo.setBuildOutputFilePath(getBopOpenFileText()); > buildInfo.setBuildOutputParserEnabled(bopEnabledButton.getSelection()); >- >+ String providerId = getProviderIDForSelectedProfile(); > buildInfo.setProviderOutputParserEnabled(providerId, sipEnabledButton.getSelection()); > buildInfo.setProviderRunCommand(providerId, sipRunCommandText.getText().trim()); > } >@@ -331,7 +343,8 @@ > if (buildInfo != null) { > setBopOpenFileText(buildInfo.getBuildOutputFilePath()); > bopEnabledButton.setSelection(buildInfo.isBuildOutputParserEnabled()); >- >+ >+ String providerId = getProviderIDForSelectedProfile(); > sipEnabledButton.setSelection(buildInfo.isProviderOutputParserEnabled(providerId)); > sipRunCommandText.setText(buildInfo.getProviderRunCommand(providerId)); > } >Index: src/org/eclipse/cdt/make/ui/dialogs/GCCPerFileSCDProfilePage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/GCCPerFileSCDProfilePage.java,v >retrieving revision 1.10 >diff -u -r1.10 GCCPerFileSCDProfilePage.java >--- src/org/eclipse/cdt/make/ui/dialogs/GCCPerFileSCDProfilePage.java 14 Jun 2007 19:04:58 -0000 1.10 >+++ src/org/eclipse/cdt/make/ui/dialogs/GCCPerFileSCDProfilePage.java 28 Jan 2009 20:50:18 -0000 >@@ -11,6 +11,7 @@ > package org.eclipse.cdt.make.ui.dialogs; > > import java.io.File; >+import java.util.List; > > import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2; > import org.eclipse.cdt.make.internal.core.scannerconfig.jobs.BuildOutputReaderJob; >@@ -260,7 +261,7 @@ > buildInfo.setBuildOutputFileActionEnabled(true); > buildInfo.setBuildOutputFilePath(getBopOpenFileText()); > buildInfo.setBuildOutputParserEnabled(bopEnabledButton.getSelection()); >- buildInfo.setProviderOutputParserEnabled(providerId, bopEnabledButton.getSelection()); >+ buildInfo.setProviderOutputParserEnabled(getProviderIDForSelectedProfile(), bopEnabledButton.getSelection()); > } > } > >@@ -273,5 +274,14 @@ > bopEnabledButton.setSelection(buildInfo.isBuildOutputParserEnabled()); > } > } >+ >+ private String getProviderIDForSelectedProfile() { >+ IScannerConfigBuilderInfo2 builderInfo = getContainer().getBuildInfo(); >+ // Provider IDs for selected profile >+ List providerIDs = builderInfo.getProviderIdList(); >+ if(providerIDs.size() == 0) >+ return ""; >+ return (String)providerIDs.iterator().next(); >+ } > > } >Index: .settings/org.eclipse.jdt.core.prefs >=================================================================== >RCS file: .settings/org.eclipse.jdt.core.prefs >diff -N .settings/org.eclipse.jdt.core.prefs >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .settings/org.eclipse.jdt.core.prefs 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,12 @@ >+#Wed Jan 28 15:21:05 EST 2009 >+eclipse.preferences.version=1 >+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled >+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 >+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve >+org.eclipse.jdt.core.compiler.compliance=1.5 >+org.eclipse.jdt.core.compiler.debug.lineNumber=generate >+org.eclipse.jdt.core.compiler.debug.localVariable=generate >+org.eclipse.jdt.core.compiler.debug.sourceFile=generate >+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error >+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error >+org.eclipse.jdt.core.compiler.source=1.5 >#P org.eclipse.cdt.managedbuilder.ui >Index: src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java,v >retrieving revision 1.21 >diff -u -r1.21 DiscoveryTab.java >--- src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java 13 May 2008 11:15:03 -0000 1.21 >+++ src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java 28 Jan 2009 20:50:18 -0000 >@@ -33,6 +33,8 @@ > import org.eclipse.cdt.managedbuilder.core.IInputType; > import org.eclipse.cdt.managedbuilder.core.IResourceInfo; > import org.eclipse.cdt.managedbuilder.core.ITool; >+import org.eclipse.cdt.managedbuilder.internal.core.InputType; >+import org.eclipse.cdt.managedbuilder.internal.core.Tool; > import org.eclipse.cdt.ui.CUIPlugin; > import org.eclipse.cdt.ui.newui.CDTPrefUtil; > import org.eclipse.cdt.ui.newui.UIMessages; >@@ -54,6 +56,7 @@ > import org.eclipse.swt.widgets.Combo; > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Group; >+import org.eclipse.swt.widgets.Label; > import org.eclipse.swt.widgets.Table; > import org.eclipse.swt.widgets.TableItem; > >@@ -71,6 +74,7 @@ > private static final String PROFILE_NAME = "name"; //$NON-NLS-1$ > private static final int DEFAULT_HEIGHT = 110; > private static final int[] DEFAULT_SASH_WEIGHTS = new int[] { 10, 20 }; >+ private Label fTableDefinition; > private Table resTable; > private Button scEnabledButton; > private Button scProblemReportingEnabledButton; >@@ -118,8 +122,15 @@ > sashForm = new SashForm(usercomp, SWT.NONE); > sashForm.setOrientation(SWT.HORIZONTAL); > sashForm.setLayoutData(new GridData(GridData.FILL_BOTH)); >- >- resTable = new Table(sashForm, SWT.SINGLE|SWT.H_SCROLL|SWT.V_SCROLL|SWT.BORDER); >+ >+ Composite comp = new Composite(sashForm, SWT.NONE); >+ comp.setLayout(new GridLayout(1, true)); >+ comp.setLayoutData(new GridData()); >+ >+ fTableDefinition = new Label(comp, SWT.LEFT); >+ fTableDefinition.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ >+ resTable = new Table(comp, SWT.SINGLE|SWT.H_SCROLL|SWT.V_SCROLL|SWT.BORDER); > GridData gd = new GridData(GridData.FILL_VERTICAL); > gd.widthHint = 150; > resTable.setLayoutData(gd); >@@ -205,8 +216,16 @@ > } > > private void updateData() { >- if (scopeComboBox != null) >- scopeComboBox.select(cbi.isPerRcTypeDiscovery() ? 0 : 1); >+ int selScope = 0; >+ String lblText = "Tools:"; >+ if(!cbi.isPerRcTypeDiscovery()) { >+ selScope = 1; >+ lblText = "Configuration:"; >+ } >+ if (scopeComboBox != null) >+ scopeComboBox.select(selScope); >+ fTableDefinition.setText(lblText); >+ > > Map<CfgInfoContext, IScannerConfigBuilderInfo2> m = cbi.getInfoMap(); > int pos = resTable.getSelectionIndex(); >@@ -291,7 +310,41 @@ > int counter = 0; > int pos = 0; > String savedId = buildInfo.getSelectedProfileId(); >+ ITool[] tools = null; >+ Tool tool = (Tool)iContext.getTool(); >+ if(null == tool) { >+ IConfiguration conf = iContext.getConfiguration(); >+ if(null != conf) { >+ tools = conf.getToolChain().getTools(); >+ } >+ if(null == tools) >+ return; >+ } >+ else >+ tools = new ITool[] { tool }; >+ > for (String profileId : profilesList) { >+ boolean ok = false; >+ for(int i = 0; i < tools.length; ++i) { >+ IInputType[] inputTypes = ((Tool)tools[i]).getAllInputTypes(); >+ if(null != inputTypes) { >+ for(IInputType it : inputTypes) { >+ String[] requiedProfiles = getDiscoveryProfileIds(tools[i], it); >+ if(null != requiedProfiles) { >+ for(String requiredProfile : requiedProfiles) { >+ if(profileId.equals(requiredProfile)) { >+ ok = true; >+ break; >+ } >+ } >+ } >+ } >+ } >+ if(ok) >+ break; >+ } >+ if(!ok) >+ continue; > if (!cbi.isProfileSupported(iContext, profileId)) > continue; > visibleProfilesList.add(profileId); >@@ -325,7 +378,18 @@ > handleDiscoveryProfileChanged(); > } > >- private String[] normalize(String[] labels, String[] ids, int counter) { >+ private String[] getDiscoveryProfileIds(ITool iTool, IInputType it) { >+ String attribute = ((InputType)it).getDiscoveryProfileIdAttribute(); >+ if(null == attribute) >+ return new String[0]; >+ // FIXME: temporary; we should add new method to IInputType instead of that >+ String[] profileIds = attribute.split("\\|"); >+ for(int i = 0; i < profileIds.length; ++i) >+ profileIds[i] = profileIds[i].trim(); >+ return profileIds; >+ } >+ >+ private String[] normalize(String[] labels, String[] ids, int counter) { > int mode = CDTPrefUtil.getInt(CDTPrefUtil.KEY_DISC_NAMES); > String[] tmp = new String[counter]; > // Always show either Name + ID, or ID only >#P org.eclipse.cdt.managedbuilder.core >Index: src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java,v >retrieving revision 1.23 >diff -u -r1.23 InputType.java >--- src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java 28 Apr 2008 18:35:13 -0000 1.23 >+++ src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java 28 Jan 2009 20:50:19 -0000 >@@ -1818,6 +1818,14 @@ > if(id == null){ > id = ((Tool)tool).getDiscoveryProfileId(); > } >+ // if there is more than one ('|'-separated), return the first one >+ // TODO: expand interface with String[] getDiscoveryProfileIds(ITool tool) >+ if(null != id) { >+ int nPos = id.indexOf('|'); >+ if(nPos <= 0) >+ nPos = id.length(); >+ id = id.substring(0, nPos); >+ } > return id; > } > >Index: src/org/eclipse/cdt/build/internal/core/scannerconfig2/CfgScannerConfigInfoFactory2.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig2/CfgScannerConfigInfoFactory2.java,v >retrieving revision 1.9 >diff -u -r1.9 CfgScannerConfigInfoFactory2.java >--- src/org/eclipse/cdt/build/internal/core/scannerconfig2/CfgScannerConfigInfoFactory2.java 27 Jul 2007 11:36:26 -0000 1.9 >+++ src/org/eclipse/cdt/build/internal/core/scannerconfig2/CfgScannerConfigInfoFactory2.java 28 Jan 2009 20:50:19 -0000 >@@ -304,7 +304,7 @@ > if(!isPerRcTypeDiscovery()) > return true; > >- return !CfgScannerConfigProfileManager.isPerFileProfile(profileId); >+ return CfgScannerConfigProfileManager.isPerFileProfile(profileId); > } > } > >#P org.eclipse.cdt.make.core >Index: src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerFileSICollector.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerFileSICollector.java,v >retrieving revision 1.24.4.1 >diff -u -r1.24.4.1 PerFileSICollector.java >--- src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerFileSICollector.java 20 Nov 2008 16:23:36 -0000 1.24.4.1 >+++ src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerFileSICollector.java 28 Jan 2009 20:50:19 -0000 >@@ -60,7 +60,7 @@ > * > * @author vhirsl > */ >-public final class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoCollectorCleaner { >+public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoCollectorCleaner { > private static final int INCLUDE_PATH = 1; > private static final int QUOTE_INCLUDE_PATH = 2; > private static final int INCLUDE_FILE = 3; >@@ -225,6 +225,10 @@ > } > } > >+ protected InfoContext getInfoContext() { >+ return context; >+ } >+ > /* (non-Javadoc) > * @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector#contributeToScannerConfig(java.lang.Object, java.util.Map) > */ >Index: src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java,v >retrieving revision 1.16 >diff -u -r1.16 DefaultRunSIProvider.java >--- src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java 11 Jun 2008 15:49:11 -0000 1.16 >+++ src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java 28 Jan 2009 20:50:19 -0000 >@@ -105,15 +105,11 @@ > // Print the command for visual interaction. > launcher.showCommand(true); > >- // add additional arguments >- // subclass can change default behavior >- String[] compileArguments = prepareArguments( >- buildInfo.isUseDefaultProviderCommand(providerId)); >- >- String ca = coligate(compileArguments); >+ String[] comandLineOptions = getCommandLineOptions(); >+ String ca = coligate(comandLineOptions); > > monitor.subTask(MakeMessages.getString("ExternalScannerInfoProvider.Invoking_Command") //$NON-NLS-1$ >- + fCompileCommand.toString() + ca); >+ + getCommandToLaunch() + ca); > cos = new StreamMonitor(new SubProgressMonitor(monitor, 70), cos, 100); > > ConsoleOutputSniffer sniffer = ScannerInfoConsoleParserFactory.getESIProviderOutputSniffer( >@@ -121,7 +117,7 @@ > OutputStream consoleOut = (sniffer == null ? cos : sniffer.getOutputStream()); > OutputStream consoleErr = (sniffer == null ? cos : sniffer.getErrorStream()); > TraceUtil.outputTrace("Default provider is executing command:", fCompileCommand.toString() + ca, ""); //$NON-NLS-1$ //$NON-NLS-2$ >- Process p = launcher.execute(fCompileCommand, compileArguments, setEnvironment(launcher, env), fWorkingDirectory); >+ Process p = launcher.execute(getCommandToLaunch(), comandLineOptions, setEnvironment(launcher, env), fWorkingDirectory); > if (p != null) { > try { > // Close the input of the Process explicitely. >@@ -158,7 +154,16 @@ > return true; > } > >- >+ protected IPath getCommandToLaunch() { >+ return fCompileCommand; >+ } >+ >+ protected String[] getCommandLineOptions() { >+ // add additional arguments >+ // subclass can change default behavior >+ return prepareArguments( >+ buildInfo.isUseDefaultProviderCommand(providerId)); >+ } > > /** > * Initialization of protected fields. >Index: src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCDMakefileGenerator.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCDMakefileGenerator.java,v >retrieving revision 1.9 >diff -u -r1.9 SCDMakefileGenerator.java >--- src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCDMakefileGenerator.java 18 Jul 2007 14:27:29 -0000 1.9 >+++ src/org/eclipse/cdt/make/internal/core/scannerconfig2/SCDMakefileGenerator.java 28 Jan 2009 20:50:19 -0000 >@@ -21,7 +21,11 @@ > import org.eclipse.cdt.make.core.MakeCorePlugin; > import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector2; > import org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes; >+import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerConfigUtil; >+import org.eclipse.cdt.make.internal.core.scannerconfig.gnu.GCCScannerConfigUtil; > import org.eclipse.cdt.make.internal.core.scannerconfig.util.CCommandDSC; >+import org.eclipse.core.runtime.IPath; >+import org.eclipse.core.runtime.Path; > > > /** >@@ -32,24 +36,32 @@ > public class SCDMakefileGenerator extends DefaultRunSIProvider { > private static final String ENDL = System.getProperty("line.separator"); //$NON-NLS-1$ > private static final String DENDL = ENDL+ENDL; >- >+ private String fMakeCommand = "-f ${project_name}_scd.mk "; >+ > /* (non-Javadoc) > * @see org.eclipse.cdt.make.internal.core.scannerconfig2.DefaultRunSIProvider#initialize() > */ > protected boolean initialize() { >- boolean rc = super.initialize(); >+ String args = buildInfo.getProviderRunArguments(providerId); >+ if(null == args) >+ args = " -E -P -v -dD "; >+ else { >+ int nPos = args.indexOf('|'); >+ if(nPos > 0) { >+ fMakeCommand = args.substring(0, nPos); >+ args = args.substring(nPos + 1); >+ } >+ } >+ fCompileCommand = new Path(buildInfo.getProviderRunCommand(providerId)); >+ >+// args = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(args, false); >+ args = substituteDynamicVariables(args); >+ fCompileArguments = ScannerConfigUtil.tokenizeStringWithQuotes(args, "\"");//$NON-NLS-1$ >+ fWorkingDirectory = MakeCorePlugin.getWorkingDirectory(); >+ fMakeCommand = substituteDynamicVariables(fMakeCommand); >+// fMakeCommand = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(fMakeCommand, false); > >- if (rc) { >- fWorkingDirectory = MakeCorePlugin.getWorkingDirectory(); >- // replace string variables in compile arguments >- // TODO Vmir - use string variable replacement >- for (int i = 0; i < fCompileArguments.length; ++i) { >- fCompileArguments[i] = fCompileArguments[i].replaceAll("\\$\\{project_name\\}", //$NON-NLS-1$ >- resource.getProject().getName()); >- } >- rc = generateMakefile(resource.getProject().getName()); >- } >- return rc; >+ return generateMakefile(resource.getProject().getName()); > } > > /** >@@ -86,14 +98,18 @@ > buffer.append(ENDL); > buffer.append("\t@echo begin generating scanner info for $@"+ENDL+"\t"); //$NON-NLS-1$ //$NON-NLS-2$ > buffer.append(cmd.getSCDRunnableCommand(true, true)); // quote includes and defines >- buffer.append(" -E -P -v -dD "); //$NON-NLS-1$ >+ for (String arg : prepareArguments(buildInfo.isUseDefaultProviderCommand(providerId))) { >+ buffer.append(' '); >+ buffer.append(arg); >+ } >+ buffer.append(' '); > buffer.append(cmd.appliesToCPPFileType() ? "specs.cpp" : "specs.c"); //$NON-NLS-1$ //$NON-NLS-2$ > buffer.append(ENDL); > buffer.append("\t@echo end generating scanner info for $@"); //$NON-NLS-1$ > buffer.append(DENDL); > } > >- File makefile = new File(fWorkingDirectory.toFile(), projectName+"_scd.mk"); //$NON-NLS-1$ >+ File makefile = new File(fWorkingDirectory.toFile(), getMakeFileName(projectName)); //$NON-NLS-1$ > try { > PrintStream ps = new PrintStream(new FileOutputStream(makefile)); > ps.println(buffer.toString()); >@@ -108,4 +124,37 @@ > > return rc; > } >+ >+ private String getMakeFileName(String projectName) { >+ String[] makeArgs = ScannerConfigUtil.tokenizeStringWithQuotes(fMakeCommand, "\"");//$NON-NLS-1$ >+ boolean found = false; >+ for(String arg : makeArgs) { >+ if(found) >+ return arg; >+ if(arg.equals("-f")) >+ found = true; >+ } >+ return projectName+"_scd.mk"; >+ } >+ >+ // TODO: replace it with Eclipse Dynamic Variable Resolver >+ private String substituteDynamicVariables(String string) { >+ string = string.replaceAll("\\$\\{project_name\\}", //$NON-NLS-1$ >+ resource.getProject().getName()); >+ string = string.replaceAll("\\$\\{plugin_state_location\\}", //$NON-NLS-1$ >+ MakeCorePlugin.getWorkingDirectory().toString()); >+ string = string.replaceAll("\\$\\{specs_file\\}", >+ GCCScannerConfigUtil.C_SPECS_FILE ); //$NON-NLS-1$ >+ return string; >+ } >+ >+ @Override >+ protected String[] getCommandLineOptions() { >+ return ScannerConfigUtil.tokenizeStringWithQuotes(fMakeCommand, "\""); >+ } >+ >+ @Override >+ protected IPath getCommandToLaunch() { >+ return new Path("make"); >+ } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 262824
: 124080