Browse Source

Can now specify target CPU when compiling Python applications.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3743 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 17 years ago
parent
commit
c11c8658f9
  1. 31
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Resources/CompilingOptionsPanel.xfrm
  2. 11
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/CompilingOptionsPanel.cs
  3. 12
      src/AddIns/BackendBindings/Python/PythonBinding/Test/CompilingOptionsPanelTestFixture.cs
  4. 14
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/DerivedCompilingOptionsPanel.cs
  5. 9
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs

31
src/AddIns/BackendBindings/Python/PythonBinding/Project/Resources/CompilingOptionsPanel.xfrm

@ -8,17 +8,34 @@
<Location value="3, -2" /> <Location value="3, -2" />
<UseCompatibleTextRendering value="True" /> <UseCompatibleTextRendering value="True" />
<Text value="${res:Dialog.ProjectOptions.Build.Output}" /> <Text value="${res:Dialog.ProjectOptions.Build.Output}" />
<Anchor value="Top, Left, Right" />
<Size value="504, 362" /> <Size value="504, 362" />
<Anchor value="Top, Left, Right" />
<TabIndex value="2" /> <TabIndex value="2" />
<Controls> <Controls>
<System.Windows.Forms.ComboBox>
<Name value="targetCpuComboBox" />
<TabIndex value="14" />
<Location value="12, 106" />
<Size value="180, 21" />
<FormattingEnabled value="True" />
<DropDownStyle value="DropDownList" />
</System.Windows.Forms.ComboBox>
<System.Windows.Forms.Label>
<Name value="targetCpuLabel" />
<Location value="12, 87" />
<UseCompatibleTextRendering value="True" />
<Text value="${res:Dialog.ProjectOptions.Build.TargetCPU}" />
<Size value="180, 16" />
<TextAlign value="MiddleLeft" />
<TabIndex value="13" />
</System.Windows.Forms.Label>
<System.Windows.Forms.CheckBox> <System.Windows.Forms.CheckBox>
<Name value="debugInfoCheckBox" /> <Name value="debugInfoCheckBox" />
<CheckAlign value="MiddleRight" /> <CheckAlign value="MiddleRight" />
<Location value="12, 63" /> <Location value="12, 63" />
<Text value="Debug info:" /> <Text value="${res:Dialog.ProjectOptions.Build.DebugInfo}" />
<TabIndex value="12" /> <TabIndex value="12" />
<Size value="147, 21" /> <Size value="180, 21" />
<UseCompatibleTextRendering value="True" /> <UseCompatibleTextRendering value="True" />
</System.Windows.Forms.CheckBox> </System.Windows.Forms.CheckBox>
<System.Windows.Forms.Label> <System.Windows.Forms.Label>
@ -26,25 +43,25 @@
<Location value="12, 17" /> <Location value="12, 17" />
<UseCompatibleTextRendering value="True" /> <UseCompatibleTextRendering value="True" />
<Text value="${res:Dialog.ProjectOptions.Build.OutputPath}" /> <Text value="${res:Dialog.ProjectOptions.Build.OutputPath}" />
<Anchor value="Top, Left, Right" />
<TextAlign value="BottomLeft" />
<Size value="492, 16" /> <Size value="492, 16" />
<TextAlign value="BottomLeft" />
<Anchor value="Top, Left, Right" />
<TabIndex value="3" /> <TabIndex value="3" />
</System.Windows.Forms.Label> </System.Windows.Forms.Label>
<System.Windows.Forms.TextBox> <System.Windows.Forms.TextBox>
<Name value="outputPathTextBox" /> <Name value="outputPathTextBox" />
<TabIndex value="4" /> <TabIndex value="4" />
<Size value="448, 20" />
<Location value="12, 37" /> <Location value="12, 37" />
<Anchor value="Top, Left, Right" /> <Anchor value="Top, Left, Right" />
<Size value="448, 20" />
</System.Windows.Forms.TextBox> </System.Windows.Forms.TextBox>
<System.Windows.Forms.Button> <System.Windows.Forms.Button>
<Name value="outputPathBrowseButton" /> <Name value="outputPathBrowseButton" />
<Location value="464, 37" /> <Location value="464, 37" />
<UseCompatibleTextRendering value="True" /> <UseCompatibleTextRendering value="True" />
<Text value="..." /> <Text value="..." />
<Anchor value="Top, Right" />
<Size value="40, 21" /> <Size value="40, 21" />
<Anchor value="Top, Right" />
<TabIndex value="5" /> <TabIndex value="5" />
</System.Windows.Forms.Button> </System.Windows.Forms.Button>
</Controls> </Controls>

11
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/CompilingOptionsPanel.cs

@ -29,6 +29,9 @@ namespace ICSharpCode.PythonBinding
b = BindBoolean("debugInfoCheckBox", "DebugInfo", false); b = BindBoolean("debugInfoCheckBox", "DebugInfo", false);
CreateLocationButton(b, "debugInfoCheckBox"); CreateLocationButton(b, "debugInfoCheckBox");
b = CreatePlatformTargetComboBox();
CreateLocationButton(b, "targetCpuComboBox");
AddConfigurationSelector(this); AddConfigurationSelector(this);
} }
@ -82,5 +85,13 @@ namespace ICSharpCode.PythonBinding
{ {
helper.AddConfigurationSelector(control); helper.AddConfigurationSelector(control);
} }
/// <summary>
/// Creates the platform target combo box.
/// </summary>
protected virtual ConfigurationGuiBinding CreatePlatformTargetComboBox()
{
return base.CreatePlatformTarget();
}
} }
} }

12
src/AddIns/BackendBindings/Python/PythonBinding/Test/CompilingOptionsPanelTestFixture.cs

@ -117,6 +117,18 @@ namespace PythonBinding.Tests
Assert.IsTrue(compilingOptionsPanel.ConfigurationSelectorAddedToControl); Assert.IsTrue(compilingOptionsPanel.ConfigurationSelectorAddedToControl);
} }
[Test]
public void TargetCpuComboxBoxAdded()
{
Assert.IsTrue(compilingOptionsPanel.IsTargetCpuComboBoxCreated);
}
[Test]
public void TargetCpuComboxBoxLocationButtonCreated()
{
Assert.IsTrue(compilingOptionsPanel.IsLocationButtonCreated("targetCpuComboBox"));
}
BrowseFolderButtonInfo GetOutputPathBrowseFolderInfo() BrowseFolderButtonInfo GetOutputPathBrowseFolderInfo()
{ {
return compilingOptionsPanel.GetBrowseFolderButtonInfo("outputPathBrowseButton"); return compilingOptionsPanel.GetBrowseFolderButtonInfo("outputPathBrowseButton");

14
src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/DerivedCompilingOptionsPanel.cs

@ -28,6 +28,7 @@ namespace PythonBinding.Tests.Utils
Dictionary<string, TextBoxEditMode> boundTextEditModes = new Dictionary<string, TextBoxEditMode>(); Dictionary<string, TextBoxEditMode> boundTextEditModes = new Dictionary<string, TextBoxEditMode>();
List<string> locationButtonsCreated = new List<string>(); List<string> locationButtonsCreated = new List<string>();
Dictionary<string, BrowseFolderButtonInfo> browseFolderButtons = new Dictionary<string, BrowseFolderButtonInfo>(); Dictionary<string, BrowseFolderButtonInfo> browseFolderButtons = new Dictionary<string, BrowseFolderButtonInfo>();
bool createdTargetCpuComboBox;
public DerivedCompilingOptionsPanel() public DerivedCompilingOptionsPanel()
{ {
@ -45,6 +46,13 @@ namespace PythonBinding.Tests.Utils
get { return setupFromManifestResourceName; } get { return setupFromManifestResourceName; }
} }
/// <summary>
/// Returns whether the target cpu combo box was created.
/// </summary>
public bool IsTargetCpuComboBoxCreated {
get { return createdTargetCpuComboBox; }
}
/// <summary> /// <summary>
/// Gets the name of the control that was bound to the specified /// Gets the name of the control that was bound to the specified
/// property. /// property.
@ -142,6 +150,12 @@ namespace PythonBinding.Tests.Utils
return base.CreateLocationButton(binding, controlName); return base.CreateLocationButton(binding, controlName);
} }
protected override ConfigurationGuiBinding CreatePlatformTargetComboBox()
{
createdTargetCpuComboBox = true;
return base.CreatePlatformTargetComboBox();
}
/// <summary> /// <summary>
/// Connects the browse folder button control to the target control. /// Connects the browse folder button control to the target control.
/// </summary> /// </summary>

9
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs

@ -197,6 +197,13 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
b.DefaultLocation = PropertyStorageLocations.PlatformSpecific; b.DefaultLocation = PropertyStorageLocations.PlatformSpecific;
b.RegisterLocationButton(advancedLocationButton); b.RegisterLocationButton(advancedLocationButton);
b = CreatePlatformTarget();
b.RegisterLocationButton(advancedLocationButton);
}
protected ConfigurationGuiBinding CreatePlatformTarget()
{
ConfigurationGuiBinding b;
b = helper.BindStringEnum("targetCpuComboBox", "PlatformTarget", b = helper.BindStringEnum("targetCpuComboBox", "PlatformTarget",
"AnyCPU", "AnyCPU",
new StringPair("AnyCPU", "${res:Dialog.ProjectOptions.Build.TargetCPU.Any}"), new StringPair("AnyCPU", "${res:Dialog.ProjectOptions.Build.TargetCPU.Any}"),
@ -204,7 +211,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
new StringPair("x64", "${res:Dialog.ProjectOptions.Build.TargetCPU.x64}"), new StringPair("x64", "${res:Dialog.ProjectOptions.Build.TargetCPU.x64}"),
new StringPair("Itanium", "${res:Dialog.ProjectOptions.Build.TargetCPU.Itanium}")); new StringPair("Itanium", "${res:Dialog.ProjectOptions.Build.TargetCPU.Itanium}"));
b.DefaultLocation = PropertyStorageLocations.PlatformSpecific; b.DefaultLocation = PropertyStorageLocations.PlatformSpecific;
b.RegisterLocationButton(advancedLocationButton); return b;
} }
void DebugSymbolsLoaded(object sender, EventArgs e) void DebugSymbolsLoaded(object sender, EventArgs e)

Loading…
Cancel
Save