Browse Source

Added compilation support to BooBinding.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@576 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 21 years ago
parent
commit
5ab533f75d
  1. 3
      src/AddIns/BackendBindings/Boo/BooBinding/Project/BooBinding.csproj
  2. 9
      src/AddIns/BackendBindings/Boo/BooBinding/Project/PostBuildEvent.bat
  3. 22
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/BooProject.cs
  4. 12
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Templates/FormsProject.xpt
  5. 2
      src/AddIns/Misc/SubversionAddIn/Project/PostBuildEvent.bat
  6. 3
      src/AddIns/Misc/SubversionAddIn/Project/SubversionAddIn.csproj
  7. 13
      src/Main/Base/Project/Src/Project/MSBuildEngine.cs

3
src/AddIns/BackendBindings/Boo/BooBinding/Project/BooBinding.csproj

@ -16,6 +16,8 @@ @@ -16,6 +16,8 @@
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<OutputPath>..\..\..\..\..\..\AddIns\AddIns\BackendBindings\BooBinding\</OutputPath>
<PostBuildEvent>$(MSBuildProjectDirectory)\PostBuildEvent.bat "$(MSBuildProjectDirectory)"</PostBuildEvent>
<RunPostBuildEvent>OnSuccessfulBuild</RunPostBuildEvent>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<Optimize>False</Optimize>
@ -107,6 +109,7 @@ @@ -107,6 +109,7 @@
<Name>NRefactoryToBooConverter</Name>
<Private>True</Private>
</ProjectReference>
<Content Include="PostBuildEvent.bat" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>

9
src/AddIns/BackendBindings/Boo/BooBinding/Project/PostBuildEvent.bat

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
REM TODO: Replace this batch file with a ".booproj" MsBuild project
pushd "%1\..\..\RequiredLibraries"
booc Boo.Microsoft.Build.Tasks.boo -t:library -o:Boo.Microsoft.Build.Tasks.dll -r:Microsoft.Build.Framework -r:Microsoft.Build.Tasks -r:Microsoft.Build.Utilities
@IF %ERRORLEVEL% NEQ 0 GOTO BooPostBuildEventEnd
popd
copy "%1\..\..\RequiredLibraries\booc.*" .
copy "%1\..\..\RequiredLibraries\*.targets" .
copy "%1\..\..\RequiredLibraries\Boo.Microsoft.Build.Tasks.dll" .
:BooPostBuildEventEnd

22
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/BooProject.cs

@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
using System;
using System.ComponentModel;
using System.IO;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Internal.Templates;
using ICSharpCode.SharpDevelop.Project;
@ -16,21 +17,32 @@ namespace Grunwald.BooBinding @@ -16,21 +17,32 @@ namespace Grunwald.BooBinding
{
public class BooProject : MSBuildProject
{
public BooProject(string fileName, string projectName)
static bool initialized = false;
void Init()
{
this.Name = projectName;
Language = "Boo";
LanguageProperties = BooLanguageProperties.Instance;
if (!initialized) {
initialized = true;
MSBuildEngine.CompileTaskNames.Add("booc");
MSBuildEngine.MsBuildProperties.Add("BooBinPath", Path.GetDirectoryName(typeof(BooProject).Assembly.Location));
}
}
public BooProject(string fileName, string projectName)
{
this.Name = projectName;
Init();
SetupProject(fileName);
IdGuid = BaseConfiguration["ProjectGuid"];
}
public BooProject(ProjectCreateInformation info)
{
Language = "Boo";
LanguageProperties = BooLanguageProperties.Instance;
Init();
Create(info);
imports.Add("$(BooBinPath)\\MsBuild.Boo.Targets");
imports.Add("$(BooBinPath)\\Boo.Microsoft.Build.targets");
}
public override bool CanCompile(string fileName)

12
src/AddIns/BackendBindings/Boo/BooBinding/Project/Templates/FormsProject.xpt

@ -50,16 +50,16 @@ class MainForm(System.Windows.Forms.Form): @@ -50,16 +50,16 @@ class MainForm(System.Windows.Forms.Form):
// not be able to load this method if it was changed manually.
def InitializeComponent():
// Form1
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
this.ClientSize = new System.Drawing.Size(292, 266)
this.Text = 'MainForm'
this.Name = 'MainForm'
self.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
self.ClientSize = System.Drawing.Size(292, 266)
self.Text = 'MainForm'
self.Name = 'MainForm'
#endregion
Application.EnableVisualStyles()
Application.Run(new MainForm())
Application.Run(MainForm())
}]]></File>
]]></File>
<File name="AssemblyInfo.cs">
<![CDATA[import System.Reflection
import System.Runtime.CompilerServices

2
src/AddIns/Misc/SubversionAddIn/Project/PostBuildEvent.bat

@ -1 +1 @@ @@ -1 +1 @@
copy ..\..\..\..\src\AddIns\Misc\SubversionAddIn\RequiredLibraries\ms* .
copy "%1\..\RequiredLibraries\ms*" .

3
src/AddIns/Misc/SubversionAddIn/Project/SubversionAddIn.csproj

@ -6,9 +6,10 @@ @@ -6,9 +6,10 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{17F4D7E0-6933-4C2E-8714-FD7E98D625D5}</ProjectGuid>
<PostBuildEvent>..\..\..\..\src\AddIns\Misc\SubversionAddIn\Project\PostBuildEvent.bat</PostBuildEvent>
<PostBuildEvent>$(MSBuildProjectDirectory)\PostBuildEvent.bat "$(MSBuildProjectDirectory)"</PostBuildEvent>
<ProductVersion>8.0.50215</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>

13
src/Main/Base/Project/Src/Project/MSBuildEngine.cs

@ -30,12 +30,19 @@ namespace ICSharpCode.SharpDevelop.Project @@ -30,12 +30,19 @@ namespace ICSharpCode.SharpDevelop.Project
/// The contents of the list can be changed by addins.
/// All names must be in lower case!
/// </summary>
public static readonly List<string> CompileTaskNames = new List<string>(new string[] {"csc", "vbc", "ilasm"});
public static readonly List<string> CompileTaskNames;
/// <summary>
/// Gets a list where addins can add additional properties for use in MsBuild.
/// </summary>
public static readonly List<KeyValuePair<string, string>> MsBuildProperties = new List<KeyValuePair<string, string>>();
public static readonly SortedList<string, string> MsBuildProperties;
static MSBuildEngine()
{
CompileTaskNames = new List<string>(new string[] {"csc", "vbc", "ilasm"});
MsBuildProperties = new SortedList<string, string>();
MsBuildProperties.Add("SharpDevelopBinPath", Path.GetDirectoryName(typeof(MSBuildEngine).Assembly.Location));
}
MessageViewCategory messageView;
@ -108,8 +115,6 @@ namespace ICSharpCode.SharpDevelop.Project @@ -108,8 +115,6 @@ namespace ICSharpCode.SharpDevelop.Project
Environment.CurrentDirectory = Path.GetDirectoryName(buildFile);
BuildPropertyGroup properties = new BuildPropertyGroup();
string location = Path.GetDirectoryName(typeof(MSBuildEngine).Assembly.Location);
properties.SetProperty("SharpDevelopBinPath", location);
foreach (KeyValuePair<string, string> entry in MsBuildProperties) {
properties.SetProperty(entry.Key, entry.Value);
}

Loading…
Cancel
Save