mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 14:12:10 +02:00
bug 288032: [Scanner Discovery] One can't change arguments of scanner discovery command
This commit is contained in:
parent
0c33320268
commit
9982386c07
3 changed files with 49 additions and 17 deletions
|
@ -287,7 +287,8 @@ ScannerConfigOptionsDialog.boProvider.browse.button=Browse...
|
||||||
ScannerConfigOptionsDialog.boProvider.browse.openFileDialog=Build output file:
|
ScannerConfigOptionsDialog.boProvider.browse.openFileDialog=Build output file:
|
||||||
ScannerConfigOptionsDialog.boProvider.load.button=Load
|
ScannerConfigOptionsDialog.boProvider.load.button=Load
|
||||||
ScannerConfigOptionsDialog.siProvider.parser.enabled.button=Enable generate scanner info command
|
ScannerConfigOptionsDialog.siProvider.parser.enabled.button=Enable generate scanner info command
|
||||||
ScannerConfigOptionsDialog.siProvider.command.label=Compiler invocation command
|
ScannerConfigOptionsDialog.siProvider.command.label=Compiler invocation command
|
||||||
|
ScannerConfigOptionsDialog.siProvider.args.label=Compiler invocation arguments
|
||||||
ScannerConfigOptionsDialog.siProvider.browse.button=Browse...
|
ScannerConfigOptionsDialog.siProvider.browse.button=Browse...
|
||||||
ScannerConfigOptionsDialog.siProvider.browse.runCommandDialog='gcc' command:
|
ScannerConfigOptionsDialog.siProvider.browse.runCommandDialog='gcc' command:
|
||||||
ScannerConfigOptionsDialog.siProvider.command.errorMessage=Must enter compiler invocation command
|
ScannerConfigOptionsDialog.siProvider.command.errorMessage=Must enter compiler invocation command
|
||||||
|
|
|
@ -55,6 +55,7 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
||||||
private Button bopLoadButton;
|
private Button bopLoadButton;
|
||||||
private Button sipEnabledButton;
|
private Button sipEnabledButton;
|
||||||
private Text sipRunCommandText;
|
private Text sipRunCommandText;
|
||||||
|
private Text sipRunArgsText;
|
||||||
|
|
||||||
private boolean isValid = true;
|
private boolean isValid = true;
|
||||||
|
|
||||||
|
@ -68,7 +69,7 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
||||||
|
|
||||||
// Add the profile UI contribution.
|
// Add the profile UI contribution.
|
||||||
Group profileGroup = ControlFactory.createGroup(page,
|
Group profileGroup = ControlFactory.createGroup(page,
|
||||||
MakeUIPlugin.getResourceString(PROFILE_GROUP_LABEL), 3);
|
MakeUIPlugin.getResourceString("ScannerConfigOptionsDialog.profile.group.label"), 3); //$NON-NLS-1$
|
||||||
|
|
||||||
GridData gd = (GridData) profileGroup.getLayoutData();
|
GridData gd = (GridData) profileGroup.getLayoutData();
|
||||||
gd.grabExcessHorizontalSpace = true;
|
gd.grabExcessHorizontalSpace = true;
|
||||||
|
@ -80,7 +81,8 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
||||||
((GridData)bopEnabledButton.getLayoutData()).horizontalSpan = 3;
|
((GridData)bopEnabledButton.getLayoutData()).horizontalSpan = 3;
|
||||||
((GridData)bopEnabledButton.getLayoutData()).grabExcessHorizontalSpace = true;
|
((GridData)bopEnabledButton.getLayoutData()).grabExcessHorizontalSpace = true;
|
||||||
bopEnabledButton.addSelectionListener(new SelectionAdapter() {
|
bopEnabledButton.addSelectionListener(new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent e) {
|
@Override
|
||||||
|
public void widgetSelected(SelectionEvent e) {
|
||||||
handleModifyOpenFileText();
|
handleModifyOpenFileText();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -93,7 +95,8 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
||||||
bopLoadButton = ControlFactory.createPushButton(profileGroup, B_LOAD);
|
bopLoadButton = ControlFactory.createPushButton(profileGroup, B_LOAD);
|
||||||
((GridData) bopLoadButton.getLayoutData()).minimumWidth = 120;
|
((GridData) bopLoadButton.getLayoutData()).minimumWidth = 120;
|
||||||
bopLoadButton.addSelectionListener(new SelectionAdapter() {
|
bopLoadButton.addSelectionListener(new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent event) {
|
@Override
|
||||||
|
public void widgetSelected(SelectionEvent event) {
|
||||||
handleBOPLoadFileButtonSelected();
|
handleBOPLoadFileButtonSelected();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -115,7 +118,8 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
||||||
((GridData) browseButton.getLayoutData()).minimumWidth = 120;
|
((GridData) browseButton.getLayoutData()).minimumWidth = 120;
|
||||||
browseButton.addSelectionListener(new SelectionAdapter() {
|
browseButton.addSelectionListener(new SelectionAdapter() {
|
||||||
|
|
||||||
public void widgetSelected(SelectionEvent event) {
|
@Override
|
||||||
|
public void widgetSelected(SelectionEvent event) {
|
||||||
handleBOPBrowseButtonSelected();
|
handleBOPBrowseButtonSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +153,8 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
||||||
((GridData)sipEnabledButton.getLayoutData()).horizontalSpan = 3;
|
((GridData)sipEnabledButton.getLayoutData()).horizontalSpan = 3;
|
||||||
((GridData)sipEnabledButton.getLayoutData()).grabExcessHorizontalSpace = true;
|
((GridData)sipEnabledButton.getLayoutData()).grabExcessHorizontalSpace = true;
|
||||||
sipEnabledButton.addSelectionListener(new SelectionAdapter() {
|
sipEnabledButton.addSelectionListener(new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent e) {
|
@Override
|
||||||
|
public void widgetSelected(SelectionEvent e) {
|
||||||
// bopLoadButton.setEnabled(sipEnabledButton.getSelection());
|
// bopLoadButton.setEnabled(sipEnabledButton.getSelection());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -160,7 +165,6 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
||||||
|
|
||||||
// text field
|
// text field
|
||||||
sipRunCommandText = ControlFactory.createTextField(profileGroup, SWT.SINGLE | SWT.BORDER);
|
sipRunCommandText = ControlFactory.createTextField(profileGroup, SWT.SINGLE | SWT.BORDER);
|
||||||
//((GridData) sipRunCommandText.getLayoutData()).horizontalSpan = 2;
|
|
||||||
sipRunCommandText.addModifyListener(new ModifyListener() {
|
sipRunCommandText.addModifyListener(new ModifyListener() {
|
||||||
public void modifyText(ModifyEvent e) {
|
public void modifyText(ModifyEvent e) {
|
||||||
handleModifyRunCommandText();
|
handleModifyRunCommandText();
|
||||||
|
@ -172,7 +176,8 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
||||||
((GridData) siBrowseButton.getLayoutData()).minimumWidth = 120;
|
((GridData) siBrowseButton.getLayoutData()).minimumWidth = 120;
|
||||||
siBrowseButton.addSelectionListener(new SelectionAdapter() {
|
siBrowseButton.addSelectionListener(new SelectionAdapter() {
|
||||||
|
|
||||||
public void widgetSelected(SelectionEvent event) {
|
@Override
|
||||||
|
public void widgetSelected(SelectionEvent event) {
|
||||||
handleSIPBrowseButtonSelected();
|
handleSIPBrowseButtonSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,6 +197,20 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// si command arguments label
|
||||||
|
Label siArgsLabel = ControlFactory.createLabel(profileGroup, SI_ARGS);
|
||||||
|
((GridData) siArgsLabel.getLayoutData()).horizontalSpan = 3;
|
||||||
|
|
||||||
|
// text field
|
||||||
|
sipRunArgsText = ControlFactory.createTextField(profileGroup, SWT.SINGLE | SWT.BORDER);
|
||||||
|
((GridData) sipRunArgsText.getLayoutData()).horizontalSpan = 3;
|
||||||
|
sipRunArgsText.addModifyListener(new ModifyListener() {
|
||||||
|
public void modifyText(ModifyEvent e) {
|
||||||
|
handleModifyRunArgsText();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
setControl(page);
|
setControl(page);
|
||||||
// set the shell variable; must be after setControl
|
// set the shell variable; must be after setControl
|
||||||
synchronized (lock) {
|
synchronized (lock) {
|
||||||
|
@ -216,6 +235,10 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
||||||
getContainer().updateContainer();
|
getContainer().updateContainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void handleModifyRunArgsText() {
|
||||||
|
getContainer().updateContainer();
|
||||||
|
}
|
||||||
|
|
||||||
private String getBopOpenFileText() {
|
private String getBopOpenFileText() {
|
||||||
// from project relative path to absolute path
|
// from project relative path to absolute path
|
||||||
String fileName = bopOpenFileText.getText().trim();
|
String fileName = bopOpenFileText.getText().trim();
|
||||||
|
@ -258,15 +281,16 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
||||||
setBopOpenFileText(builderInfo.getBuildOutputFilePath());
|
setBopOpenFileText(builderInfo.getBuildOutputFilePath());
|
||||||
sipEnabledButton.setSelection(builderInfo.isProviderOutputParserEnabled(providerId));
|
sipEnabledButton.setSelection(builderInfo.isProviderOutputParserEnabled(providerId));
|
||||||
sipRunCommandText.setText(builderInfo.getProviderRunCommand(providerId));
|
sipRunCommandText.setText(builderInfo.getProviderRunCommand(providerId));
|
||||||
|
sipRunArgsText.setText(builderInfo.getProviderRunArguments(providerId));
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getProviderIDForSelectedProfile() {
|
private String getProviderIDForSelectedProfile() {
|
||||||
IScannerConfigBuilderInfo2 builderInfo = getContainer().getBuildInfo();
|
IScannerConfigBuilderInfo2 builderInfo = getContainer().getBuildInfo();
|
||||||
// Provider IDs for selected profile
|
// Provider IDs for selected profile
|
||||||
List providerIDs = builderInfo.getProviderIdList();
|
List<String> providerIDs = builderInfo.getProviderIdList();
|
||||||
if(providerIDs.size() == 0)
|
if(providerIDs.size() == 0)
|
||||||
return "";
|
return ""; //$NON-NLS-1$
|
||||||
return (String)providerIDs.iterator().next();
|
return providerIDs.iterator().next();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleBOPLoadFileButtonSelected() {
|
private void handleBOPLoadFileButtonSelected() {
|
||||||
|
@ -281,7 +305,8 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
||||||
readerJob.setPriority(Job.LONG);
|
readerJob.setPriority(Job.LONG);
|
||||||
readerJob.addJobChangeListener(new JobChangeAdapter() {
|
readerJob.addJobChangeListener(new JobChangeAdapter() {
|
||||||
|
|
||||||
public void done(IJobChangeEvent event) {
|
@Override
|
||||||
|
public void done(IJobChangeEvent event) {
|
||||||
synchronized (lock) {
|
synchronized (lock) {
|
||||||
if (!instance.shell.isDisposed()) {
|
if (!instance.shell.isDisposed()) {
|
||||||
instance.shell.getDisplay().asyncExec(new Runnable() {
|
instance.shell.getDisplay().asyncExec(new Runnable() {
|
||||||
|
@ -311,21 +336,24 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.ui.dialogs.ICOptionPage#isValid()
|
* @see org.eclipse.cdt.ui.dialogs.ICOptionPage#isValid()
|
||||||
*/
|
*/
|
||||||
public boolean isValid() {
|
@Override
|
||||||
|
public boolean isValid() {
|
||||||
return isValid;
|
return isValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.jface.dialogs.IDialogPage#getErrorMessage()
|
* @see org.eclipse.jface.dialogs.IDialogPage#getErrorMessage()
|
||||||
*/
|
*/
|
||||||
public String getErrorMessage() {
|
@Override
|
||||||
|
public String getErrorMessage() {
|
||||||
return (isValid) ? null : SI_ERROR;
|
return (isValid) ? null : SI_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.make.ui.dialogs.AbstractDiscoveryPage#populateBuildInfo(org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2)
|
* @see org.eclipse.cdt.make.ui.dialogs.AbstractDiscoveryPage#populateBuildInfo(org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2)
|
||||||
*/
|
*/
|
||||||
protected void populateBuildInfo(IScannerConfigBuilderInfo2 buildInfo) {
|
@Override
|
||||||
|
protected void populateBuildInfo(IScannerConfigBuilderInfo2 buildInfo) {
|
||||||
if (buildInfo != null) {
|
if (buildInfo != null) {
|
||||||
buildInfo.setBuildOutputFileActionEnabled(true);
|
buildInfo.setBuildOutputFileActionEnabled(true);
|
||||||
buildInfo.setBuildOutputFilePath(getBopOpenFileText());
|
buildInfo.setBuildOutputFilePath(getBopOpenFileText());
|
||||||
|
@ -333,13 +361,15 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
||||||
String providerId = getProviderIDForSelectedProfile();
|
String providerId = getProviderIDForSelectedProfile();
|
||||||
buildInfo.setProviderOutputParserEnabled(providerId, sipEnabledButton.getSelection());
|
buildInfo.setProviderOutputParserEnabled(providerId, sipEnabledButton.getSelection());
|
||||||
buildInfo.setProviderRunCommand(providerId, sipRunCommandText.getText().trim());
|
buildInfo.setProviderRunCommand(providerId, sipRunCommandText.getText().trim());
|
||||||
|
buildInfo.setProviderRunArguments(providerId, sipRunArgsText.getText().trim());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.make.ui.dialogs.AbstractDiscoveryPage#restoreFromBuildinfo(org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2)
|
* @see org.eclipse.cdt.make.ui.dialogs.AbstractDiscoveryPage#restoreFromBuildinfo(org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2)
|
||||||
*/
|
*/
|
||||||
protected void restoreFromBuildinfo(IScannerConfigBuilderInfo2 buildInfo) {
|
@Override
|
||||||
|
protected void restoreFromBuildinfo(IScannerConfigBuilderInfo2 buildInfo) {
|
||||||
if (buildInfo != null) {
|
if (buildInfo != null) {
|
||||||
setBopOpenFileText(buildInfo.getBuildOutputFilePath());
|
setBopOpenFileText(buildInfo.getBuildOutputFilePath());
|
||||||
bopEnabledButton.setSelection(buildInfo.isBuildOutputParserEnabled());
|
bopEnabledButton.setSelection(buildInfo.isBuildOutputParserEnabled());
|
||||||
|
@ -347,6 +377,7 @@ public class GCCPerProjectSCDProfilePage extends AbstractDiscoveryPage {
|
||||||
String providerId = getProviderIDForSelectedProfile();
|
String providerId = getProviderIDForSelectedProfile();
|
||||||
sipEnabledButton.setSelection(buildInfo.isProviderOutputParserEnabled(providerId));
|
sipEnabledButton.setSelection(buildInfo.isProviderOutputParserEnabled(providerId));
|
||||||
sipRunCommandText.setText(buildInfo.getProviderRunCommand(providerId));
|
sipRunCommandText.setText(buildInfo.getProviderRunCommand(providerId));
|
||||||
|
sipRunArgsText.setText(buildInfo.getProviderRunArguments(providerId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
|
||||||
private static final String PROFILE_PAGE = "profilePage"; //$NON-NLS-1$
|
private static final String PROFILE_PAGE = "profilePage"; //$NON-NLS-1$
|
||||||
private static final String PROFILE_ID = "profileId"; //$NON-NLS-1$
|
private static final String PROFILE_ID = "profileId"; //$NON-NLS-1$
|
||||||
private static final String PROFILE_NAME = "name"; //$NON-NLS-1$
|
private static final String PROFILE_NAME = "name"; //$NON-NLS-1$
|
||||||
private static final int DEFAULT_HEIGHT = 110;
|
private static final int DEFAULT_HEIGHT = 150;
|
||||||
private static final int[] DEFAULT_SASH_WEIGHTS = new int[] { 10, 20 };
|
private static final int[] DEFAULT_SASH_WEIGHTS = new int[] { 10, 20 };
|
||||||
private Label fTableDefinition;
|
private Label fTableDefinition;
|
||||||
private Combo scopeComboBox;
|
private Combo scopeComboBox;
|
||||||
|
|
Loading…
Add table
Reference in a new issue