Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3650 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
12 changed files with 896 additions and 75 deletions
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Robert Pickering" email="robert@strangelights.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System.Reflection; |
||||
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly: System.Runtime.InteropServices.ComVisible(false)] |
||||
[assembly: AssemblyTitle("FSharp.Build.Tasks")] |
||||
[assembly: AssemblyDescription("Provides F# build tasks for the F# addin.")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
||||
[assembly: AssemblyCompany("ic#code")] |
||||
[assembly: AssemblyProduct("SharpDevelop")] |
||||
[assembly: AssemblyCopyright("2000-2008 AlphaSierraPapa")] |
||||
[assembly: AssemblyVersion("1.0")] |
@ -0,0 +1,67 @@
@@ -0,0 +1,67 @@
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<PropertyGroup> |
||||
<ProjectGuid>{674D485B-8340-498D-B91F-BE51543386C8}</ProjectGuid> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||
<OutputType>Library</OutputType> |
||||
<RootNamespace>FSharp.Build.Tasks</RootNamespace> |
||||
<AssemblyName>FSharp.Build.Tasks</AssemblyName> |
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> |
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
||||
<NoStdLib>False</NoStdLib> |
||||
<WarningLevel>4</WarningLevel> |
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
||||
<OutputPath>..\..\RequiredLibraries</OutputPath> |
||||
<DebugSymbols>true</DebugSymbols> |
||||
<DebugType>Full</DebugType> |
||||
<Optimize>False</Optimize> |
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
||||
<OutputPath>..\..\RequiredLibraries</OutputPath> |
||||
<DebugSymbols>false</DebugSymbols> |
||||
<DebugType>None</DebugType> |
||||
<Optimize>True</Optimize> |
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
||||
<DefineConstants>TRACE</DefineConstants> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' "> |
||||
<RegisterForComInterop>False</RegisterForComInterop> |
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> |
||||
<BaseAddress>4194304</BaseAddress> |
||||
<PlatformTarget>AnyCPU</PlatformTarget> |
||||
<FileAlignment>4096</FileAlignment> |
||||
</PropertyGroup> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
||||
<ItemGroup> |
||||
<Reference Include="Microsoft.Build.Framework"> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="Microsoft.Build.Tasks"> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="Microsoft.Build.Utilities" /> |
||||
<Reference Include="System"> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="System.Configuration"> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="System.Xml"> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Compile Include="Configuration\AssemblyInfo.cs" /> |
||||
<Compile Include="Src\CompilerCommandLineBuilder.cs" /> |
||||
<Compile Include="Src\Fsc.cs" /> |
||||
<Compile Include="Src\FscToolLocationHelper.cs" /> |
||||
<Compile Include="Src\IsFscInstalled.cs" /> |
||||
<None Include="SharpDevelop.Build.Fsc.targets"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
</ItemGroup> |
||||
</Project> |
@ -0,0 +1,161 @@
@@ -0,0 +1,161 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<UsingTask TaskName="FSharp.Build.Tasks.Fsc" AssemblyFile="FSharp.Build.Tasks.dll" /> |
||||
<UsingTask TaskName="FSharp.Build.Tasks.IsFscInstalled" AssemblyFile="FSharp.Build.Tasks.dll" /> |
||||
<UsingTask TaskName="CreateCSharpManifestResourceName" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> |
||||
<UsingTask TaskName="Copy" AssemblyName="Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> |
||||
|
||||
<PropertyGroup> |
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(FSharpBuildTasksPath)\SharpDevelop.Build.Fsc.targets</MSBuildAllProjects> |
||||
<DefaultLanguageSourceExtension>.fs</DefaultLanguageSourceExtension> |
||||
<Language>F#</Language> |
||||
<CheckIfFscNotInstalled Condition=" '$(CheckIfFscNotInstalled)' == '' ">False</CheckIfFscNotInstalled> |
||||
<FscInstalled>True</FscInstalled> |
||||
</PropertyGroup> |
||||
|
||||
<PropertyGroup> |
||||
<CreateManifestResourceNamesDependsOn> |
||||
</CreateManifestResourceNamesDependsOn> |
||||
</PropertyGroup> |
||||
<Target Name="CreateManifestResourceNames" Condition="'@(ResxWithNoCulture)@(ResxWithCulture)@(NonResxWithNoCulture)@(NonResxWithCulture)'!=''" DependsOnTargets="$(CreateManifestResourceNamesDependsOn)"> |
||||
<!-- Create the target resource names for non-culture resx files. --> |
||||
<CreateCSharpManifestResourceName Condition="'@(ResxWithNoCulture)'!=''" ResourceFiles="@(ResxWithNoCulture)" RootNamespace="$(RootNamespace)"> |
||||
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestResourceWithNoCultureName" /> |
||||
</CreateCSharpManifestResourceName> |
||||
|
||||
<!-- Create the target resource names for culture resx files. --> |
||||
<CreateCSharpManifestResourceName Condition="'@(ResxWithCulture)'!=''" ResourceFiles="@(ResxWithCulture)" RootNamespace="$(RootNamespace)"> |
||||
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestResourceWithCultureName" /> |
||||
</CreateCSharpManifestResourceName> |
||||
|
||||
<!-- Create the target resource names for non-culture non-resx files. --> |
||||
<CreateCSharpManifestResourceName Condition="'@(NonResxWithNoCulture)'!=''" ResourceFiles="@(NonResxWithNoCulture)" RootNamespace="$(RootNamespace)"> |
||||
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestNonResxWithNoCulture" /> |
||||
</CreateCSharpManifestResourceName> |
||||
|
||||
<!-- Create the target resource names for culture non-resx files. --> |
||||
<CreateCSharpManifestResourceName Condition="'@(NonResxWithCulture)'!=''" ResourceFiles="@(NonResxWithCulture)" RootNamespace="$(RootNamespace)"> |
||||
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestNonResxWithCulture" /> |
||||
</CreateCSharpManifestResourceName> |
||||
</Target> |
||||
|
||||
<Target Name="CoreCompile" Inputs="$(MSBuildAllProjects); |
||||
@(Compile); |
||||
@(ReferencePath); |
||||
@(ManifestResourceWithNoCulture); |
||||
$(ApplicationIcon); |
||||
$(AssemblyOriginatorKeyFile); |
||||
@(ManifestNonResxWithNoCultureOnDisk); |
||||
@(ReferencePath); |
||||
@(CompiledLicenseFile); |
||||
$(Standalone); |
||||
$(NoMLLib)" |
||||
Outputs="@(DocFileItem); |
||||
@(IntermediateAssembly); |
||||
$(NonExistentFile)" |
||||
DependsOnTargets="$(CoreCompileDependsOn)"> |
||||
<Fsc |
||||
Condition=" '$(FscInstalled)' == 'True' " |
||||
DebugType="$(DebugType)" |
||||
EmitDebugInformation="$(DebugSymbols)" |
||||
FileAlignment="$(FileAlignment)" |
||||
KeyContainer="$(KeyContainerName)" |
||||
KeyFile="$(KeyOriginatorFile)" |
||||
Optimize="$(Optimize)" |
||||
OutputAssembly="@(IntermediateAssembly)" |
||||
Resources="@(ManifestResourceWithNoCulture);@(ManifestNonResxWithNoCultureOnDisk);@(CompiledLicenseFile)" |
||||
Sources="@(Compile)" |
||||
References="@(ReferencePath)" |
||||
TargetType="$(OutputType)" |
||||
Standalone="$(Standalone)" |
||||
NoMLLib="$(NoMLLib)" /> |
||||
</Target> |
||||
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.Common.targets" /> |
||||
|
||||
<!-- |
||||
Check if F# is installed. |
||||
--> |
||||
<Target Name="BeforeBuild"> |
||||
<CallTarget Targets="IfFscInstalled" /> |
||||
</Target> |
||||
<Target Name="BeforeClean"> |
||||
<CallTarget Targets="IfFscInstalled" /> |
||||
</Target> |
||||
<Target Name="BeforeRebuild"> |
||||
<CallTarget Targets="IfFscInstalled" /> |
||||
</Target> |
||||
|
||||
<Target Name="IfFscInstalled"> |
||||
<Message Text="Checking if F# is installed." Condition=" '$(CheckIfFscNotInstalled)' == 'True' "/> |
||||
|
||||
<!-- Check if F# is installed --> |
||||
<IsFscInstalled Condition=" '$(CheckIfFscNotInstalled)' == 'True' "> |
||||
<Output TaskParameter="IsInstalled" PropertyName="FscInstalled"/> |
||||
</IsFscInstalled> |
||||
|
||||
<Warning Code="FSC1001" Text="Unable to find the F# compiler (fsi.exe). The F# addin will not be compiled." Condition=" '$(FscInstalled)' == 'False' and '$(CheckIfFscNotInstalled)' == 'True' " /> |
||||
</Target> |
||||
|
||||
<!-- Override CopyFilesToOutputDirectory so if the F# compiler is not installed there are |
||||
no errors when trying to copy non-existent files. --> |
||||
<Target |
||||
Name="CopyFilesToOutputDirectory" |
||||
DependsOnTargets=" |
||||
ComputeIntermediateSatelliteAssemblies; |
||||
_CopyFilesMarkedCopyLocal; |
||||
_CopySourceItemsToOutputDirectory; |
||||
_CopyAppConfigFile; |
||||
_CopyManifestFiles; |
||||
_CheckForCompileOutputs; |
||||
_SGenCheckForOutputs"> |
||||
|
||||
<!-- Copy the build product (.dll or .exe). --> |
||||
<Copy Condition=" '$(FscInstalled)' == 'True' " |
||||
SourceFiles="@(IntermediateAssembly)" |
||||
DestinationFolder="$(OutDir)" |
||||
SkipUnchangedFiles="true" |
||||
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"> |
||||
|
||||
<Output TaskParameter="DestinationFiles" ItemName="MainAssembly"/> |
||||
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> |
||||
|
||||
</Copy> |
||||
|
||||
<Message Importance="High" Text="$(MSBuildProjectName) -> @(MainAssembly->'%(FullPath)')" /> |
||||
|
||||
<!-- Copy the debug information file (.pdb), if any --> |
||||
<Copy |
||||
SourceFiles="@(_DebugSymbolsIntermediatePath)" |
||||
DestinationFiles="@(_DebugSymbolsOutputPath)" |
||||
SkipUnchangedFiles="true" |
||||
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" |
||||
Condition="'$(FscInstalled)' == 'True' and '$(_DebugSymbolsProduced)'=='true' and '$(SkipCopyingSymbolsToOutputDirectory)' != 'true'"> |
||||
|
||||
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> |
||||
|
||||
</Copy> |
||||
|
||||
<!-- Copy the resulting XML documentation file, if any. --> |
||||
<Copy |
||||
SourceFiles="@(DocFileItem)" |
||||
DestinationFiles="@(FinalDocFile)" |
||||
SkipUnchangedFiles="true" |
||||
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" |
||||
Condition="'$(FscInstalled)' == 'True' and '$(_DocumentationFileProduced)'=='true'"> |
||||
|
||||
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> |
||||
|
||||
</Copy> |
||||
|
||||
<!-- Copy satellite assemblies. --> |
||||
<Copy Condition=" '$(FscInstalled)' == 'True' " |
||||
SourceFiles="@(IntermediateSatelliteAssembliesWithTargetPath)" |
||||
DestinationFiles="@(IntermediateSatelliteAssembliesWithTargetPath->'$(OutDir)%(Culture)\$(TargetName).resources.dll')" |
||||
SkipUnchangedFiles="true" |
||||
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"> |
||||
|
||||
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> |
||||
|
||||
</Copy> |
||||
</Target> |
||||
</Project> |
@ -0,0 +1,41 @@
@@ -0,0 +1,41 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Globalization; |
||||
using System.IO; |
||||
|
||||
using Microsoft.Build.Framework; |
||||
using Microsoft.Build.Utilities; |
||||
using Microsoft.Build.Tasks; |
||||
|
||||
namespace FSharp.Build.Tasks |
||||
{ |
||||
public class CompilerCommandLineBuilder : CommandLineBuilder |
||||
{ |
||||
public void AppendIntegerSwitch(string switchName, int value) |
||||
{ |
||||
AppendSwitchUnquotedIfNotNull(switchName, value.ToString(NumberFormatInfo.InvariantInfo)); |
||||
} |
||||
|
||||
public void AppendFileNameIfNotNull(string switchName, ITaskItem fileItem) |
||||
{ |
||||
if (fileItem != null) { |
||||
AppendFileNameIfNotNull(switchName, fileItem.ItemSpec); |
||||
} |
||||
} |
||||
|
||||
public void AppendFileNameIfNotNull(string switchName, string fileName) |
||||
{ |
||||
if (fileName != null) { |
||||
AppendSpaceIfNotEmpty(); |
||||
AppendTextUnquoted(switchName); |
||||
AppendFileNameWithQuoting(fileName); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,220 @@
@@ -0,0 +1,220 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Robert Pickering" email="robert@strangelights.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.IO; |
||||
using System.CodeDom.Compiler; |
||||
using System.Globalization; |
||||
using Microsoft.Build.Framework; |
||||
using Microsoft.Build.Utilities; |
||||
using Microsoft.Build.Tasks; |
||||
using System.Collections.Generic; |
||||
using System.Text.RegularExpressions; |
||||
|
||||
namespace FSharp.Build.Tasks |
||||
{ |
||||
public sealed class Fsc : ToolTask |
||||
{ |
||||
string keyContainer; |
||||
string keyFile; |
||||
int fileAlignment; |
||||
bool standalone; |
||||
bool noMLLib; |
||||
ITaskItem[] sources; |
||||
ITaskItem[] resources; |
||||
ITaskItem[] references; |
||||
ITaskItem outputAssembly; |
||||
string debugType; |
||||
bool emitDebugInformation; |
||||
string targetType; |
||||
bool optimize; |
||||
|
||||
public int FileAlignment { |
||||
get { return fileAlignment; } |
||||
set { fileAlignment = value; } |
||||
} |
||||
|
||||
public string KeyContainer { |
||||
get { return keyContainer; } |
||||
set { keyContainer = value; } |
||||
} |
||||
|
||||
public string KeyFile { |
||||
get { return keyFile; } |
||||
set { keyFile = value; } |
||||
} |
||||
|
||||
public bool Standalone { |
||||
get { return standalone; } |
||||
set { standalone = value; } |
||||
} |
||||
|
||||
public bool NoMLLib { |
||||
get { return noMLLib; } |
||||
set { noMLLib = value; } |
||||
} |
||||
|
||||
public string DebugType { |
||||
get { return debugType; } |
||||
set { debugType = value; } |
||||
} |
||||
|
||||
public bool EmitDebugInformation { |
||||
get { return emitDebugInformation; } |
||||
set { emitDebugInformation = value; } |
||||
} |
||||
|
||||
public ITaskItem[] Sources { |
||||
get { return sources; } |
||||
set { sources = value; } |
||||
} |
||||
|
||||
public ITaskItem[] References { |
||||
get { return references; } |
||||
set { references = value; } |
||||
} |
||||
|
||||
public ITaskItem[] Resources { |
||||
get { return resources; } |
||||
set { resources = value; } |
||||
} |
||||
|
||||
public bool Optimize { |
||||
get { return optimize; } |
||||
set { optimize = value; } |
||||
} |
||||
|
||||
public ITaskItem OutputAssembly { |
||||
get { return outputAssembly; } |
||||
set { outputAssembly = value; } |
||||
} |
||||
|
||||
public string TargetType { |
||||
get { return targetType; } |
||||
set { targetType = value; } |
||||
} |
||||
|
||||
protected override string ToolName { |
||||
get { return "fsc.exe"; } |
||||
} |
||||
|
||||
protected override string GenerateFullPathToTool() |
||||
{ |
||||
return FscToolLocationHelper.GetPathToTool(); |
||||
} |
||||
|
||||
protected override string GenerateCommandLineCommands() |
||||
{ |
||||
CompilerCommandLineBuilder commandLine = new CompilerCommandLineBuilder(); |
||||
if (((OutputAssembly == null) && (Sources != null)) && ((Sources.Length > 0))) { |
||||
OutputAssembly = new TaskItem(Path.GetFileNameWithoutExtension(this.Sources[0].ItemSpec)); |
||||
if (string.Equals(this.TargetType, "library", StringComparison.InvariantCultureIgnoreCase)) { |
||||
OutputAssembly.ItemSpec += ".dll"; |
||||
} else if (string.Equals(this.TargetType, "module", StringComparison.InvariantCultureIgnoreCase)) { |
||||
OutputAssembly.ItemSpec += ".netmodule"; |
||||
} else { |
||||
OutputAssembly.ItemSpec += ".exe"; |
||||
} |
||||
} |
||||
|
||||
commandLine.AppendSwitch("-g"); |
||||
|
||||
if (Optimize) { |
||||
commandLine.AppendSwitch("-O3"); |
||||
} |
||||
|
||||
commandLine.AppendSwitchIfNotNull("--keyfile ", this.KeyFile); |
||||
|
||||
if (noMLLib) { |
||||
commandLine.AppendSwitch("--no-mllib"); |
||||
} |
||||
|
||||
if (standalone) { |
||||
commandLine.AppendSwitch("--standalone"); |
||||
} |
||||
|
||||
if (Resources != null) { |
||||
foreach (ITaskItem item in Resources) { |
||||
commandLine.AppendSwitchIfNotNull("--resource ", item); |
||||
} |
||||
} |
||||
|
||||
if (FileAlignment > 0) { |
||||
commandLine.AppendIntegerSwitch("--base-address ", FileAlignment); |
||||
} |
||||
|
||||
commandLine.AppendSwitchIfNotNull("-o ", this.OutputAssembly); |
||||
|
||||
if (string.Equals(this.TargetType, "library", StringComparison.InvariantCultureIgnoreCase)) { |
||||
commandLine.AppendSwitch("--target-dll"); |
||||
} else if (string.Equals(this.TargetType, "winexe", StringComparison.InvariantCultureIgnoreCase)) { |
||||
commandLine.AppendSwitch("--target-winexe"); |
||||
} else if (string.Equals(this.TargetType, "module", StringComparison.InvariantCultureIgnoreCase)) { |
||||
commandLine.AppendSwitch("--target-module"); |
||||
} |
||||
|
||||
if (References != null) { |
||||
foreach (ITaskItem reference in References) { |
||||
commandLine.AppendFileNameIfNotNull("-r ", reference); |
||||
} |
||||
} |
||||
commandLine.AppendFileNamesIfNotNull(this.Sources, " "); |
||||
return commandLine.ToString(); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Each line of output, from either standard output or standard error
|
||||
/// is parsed and any compiler errors are logged. If the line cannot
|
||||
/// be parsed it is logged using the specified message importance.
|
||||
/// </summary>
|
||||
protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance) |
||||
{ |
||||
CompilerError error = ParseLine(singleLine); |
||||
if (error != null) { |
||||
if (error.IsWarning) { |
||||
Log.LogWarning("warning", error.ErrorNumber, null, error.FileName, error.Line, error.Column, error.Line, error.Column, error.ErrorText); |
||||
} else { |
||||
Log.LogError("error", error.ErrorNumber, null, error.FileName, error.Line, error.Column, error.Line, error.Column, error.ErrorText); |
||||
} |
||||
} else { |
||||
Log.LogMessage(messageImportance, singleLine); |
||||
} |
||||
} |
||||
|
||||
|
||||
const string ErrorPattern = @"(?<file>[^\(]*)\((?<line>[0-9]*),(?<column>[0-9]*)\):\s(?<error>[^:]*):\s(?<number>[^:]*):\s(?<message>.*)"; |
||||
static Regex ErrorRegex = new Regex(ErrorPattern, RegexOptions.Compiled); |
||||
const string ErrorPatternNoLine = @"(?<file>[^\(]*)\((?<line>[0-9]*),(?<column>[0-9]*)\):\s(?<error>[^:]*):\s(?<message>.*)"; |
||||
static Regex ErrorNoLineRegex = new Regex(ErrorPatternNoLine, RegexOptions.Compiled); |
||||
|
||||
CompilerError ParseLine(string line) |
||||
{ |
||||
Match match = ErrorRegex.Match(line); |
||||
Match matchNoLine = ErrorNoLineRegex.Match(line); |
||||
if (match.Success) { |
||||
CompilerError error = new CompilerError(); |
||||
error.Column = Int32.Parse(match.Result("${column}")); |
||||
error.Line = Int32.Parse(match.Result("${line}")); |
||||
error.FileName = Path.GetFullPath(match.Result("${file}")); |
||||
error.IsWarning = match.Result("${error}") == "warning"; |
||||
error.ErrorNumber = match.Result("${number}"); |
||||
error.ErrorText = match.Result("${message}"); |
||||
return error; |
||||
} else if (matchNoLine.Success) { |
||||
CompilerError error = new CompilerError(); |
||||
error.Column = Int32.Parse(matchNoLine.Result("${column}")); |
||||
error.Line = Int32.Parse(matchNoLine.Result("${line}")); |
||||
error.FileName = Path.GetFullPath(matchNoLine.Result("${file}")); |
||||
error.IsWarning = matchNoLine.Result("${error}") == "warning"; |
||||
error.ErrorNumber = matchNoLine.Result("${number}"); |
||||
error.ErrorText = matchNoLine.Result("${message}"); |
||||
return error; |
||||
} |
||||
return null; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,62 @@
@@ -0,0 +1,62 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Robert Pickering" email="robert@strangelights.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Configuration; |
||||
using System.IO; |
||||
|
||||
namespace FSharp.Build.Tasks |
||||
{ |
||||
public sealed class FscToolLocationHelper |
||||
{ |
||||
public static readonly string ToolName = "fsc.exe"; |
||||
|
||||
FscToolLocationHelper() |
||||
{ |
||||
} |
||||
|
||||
public static string GetPathToTool() |
||||
{ |
||||
string path = null; |
||||
if (Array.Exists<string>(ConfigurationManager.AppSettings.AllKeys, delegate(string k) { return k == "alt_fs_bin_path"; })) { |
||||
path = Path.Combine(ConfigurationManager.AppSettings["alt_fs_bin_path"], ToolName); |
||||
if (!File.Exists(path)) { |
||||
throw new Exception("you are trying to use the app setting alt_fs_bin_path, but fsc.exe is not localed in the given directory"); |
||||
} |
||||
} else { |
||||
string[] paths = Environment.GetEnvironmentVariable("path").Split(';'); |
||||
path = Array.Find(paths, delegate(string x) { |
||||
bool res = false; |
||||
try { |
||||
res = File.Exists(Path.Combine(x, "fsc.exe")); |
||||
} catch { |
||||
res = false; |
||||
} |
||||
return res; |
||||
}); |
||||
if (path != null) { |
||||
path = Path.Combine(path, ToolName); |
||||
} else { |
||||
string[] dirs = Directory.GetDirectories(Environment.GetEnvironmentVariable("ProgramFiles"), "FSharp*"); |
||||
List<FileInfo> files = new List<FileInfo>(); |
||||
foreach (string dir in dirs) { |
||||
FileInfo file = new FileInfo(Path.Combine(Path.Combine(dir, "bin"), ToolName)); |
||||
if (file.Exists) { |
||||
files.Add(file); |
||||
} |
||||
} |
||||
if (files.Count > 0) { |
||||
files.Sort(delegate(FileInfo x, FileInfo y) { return DateTime.Compare(x.CreationTime, y.CreationTime); }); |
||||
path = files[0].FullName; |
||||
} |
||||
} |
||||
} |
||||
return path; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using Microsoft.Build.Framework; |
||||
using Microsoft.Build.Utilities; |
||||
using Microsoft.Build.Tasks; |
||||
|
||||
namespace FSharp.Build.Tasks |
||||
{ |
||||
/// <summary>
|
||||
/// Tasks that determines if the F# compiler is installed.
|
||||
/// </summary>
|
||||
public sealed class IsFscInstalled : Task |
||||
{ |
||||
bool installed; |
||||
|
||||
[Output] |
||||
public bool IsInstalled { |
||||
get { return installed; } |
||||
set { installed = value; } |
||||
} |
||||
|
||||
public override bool Execute() |
||||
{ |
||||
if (FscToolLocationHelper.GetPathToTool() != null) { |
||||
installed = true; |
||||
} |
||||
return true; |
||||
} |
||||
} |
||||
} |
@ -1,109 +1,159 @@
@@ -1,109 +1,159 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<PropertyGroup> |
||||
<ProjectGuid>{99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4}</ProjectGuid> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||
<ProductVersion>8.0.30703</ProductVersion> |
||||
<SchemaVersion>2.0</SchemaVersion> |
||||
<ProjectGuid>{a7e6c2fe-6933-44a2-a420-aa6a38d421e9}</ProjectGuid> |
||||
<OutputType>Library</OutputType> |
||||
<RootNamespace>FSharpBinding</RootNamespace> |
||||
<RootNamespace>FSharpBindings</RootNamespace> |
||||
<AssemblyName>FSharpBinding</AssemblyName> |
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> |
||||
<FileAlignment>512</FileAlignment> |
||||
<Name>FShapBinding</Name> |
||||
<Standalone>True</Standalone> |
||||
<NoMLLib>True</NoMLLib> |
||||
<CheckIfFscNotInstalled>True</CheckIfFscNotInstalled> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
||||
<DebugSymbols>true</DebugSymbols> |
||||
<DebugType>full</DebugType> |
||||
<Optimize>false</Optimize> |
||||
<OutputPath>..\..\..\..\..\..\AddIns\AddIns\BackendBindings\FSharpBinding</OutputPath> |
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||
<ErrorReport>prompt</ErrorReport> |
||||
<WarningLevel>3</WarningLevel> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
||||
<OutputPath>..\..\..\..\..\..\AddIns\AddIns\BackendBindings\FSharpBinding\</OutputPath> |
||||
<DebugSymbols>True</DebugSymbols> |
||||
<DebugType>Full</DebugType> |
||||
<Optimize>False</Optimize> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
||||
<DebugType>pdbonly</DebugType> |
||||
<Optimize>true</Optimize> |
||||
<OutputPath>..\..\..\..\..\..\AddIns\AddIns\BackendBindings\FSharpBinding</OutputPath> |
||||
<DefineConstants>TRACE</DefineConstants> |
||||
<ErrorReport>prompt</ErrorReport> |
||||
<WarningLevel>3</WarningLevel> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
||||
<OutputPath>..\..\..\..\..\..\AddIns\AddIns\BackendBindings\FSharpBinding\</OutputPath> |
||||
<DebugSymbols>False</DebugSymbols> |
||||
<DebugType>None</DebugType> |
||||
<Optimize>True</Optimize> |
||||
</PropertyGroup> |
||||
<Import Project="$(FSharpBuildTasksPath)\SharpDevelop.Build.Fsc.Targets" /> |
||||
<ItemGroup> |
||||
<Compile Include="Src\project.fs" /> |
||||
<Compile Include="Src\languagebinding.fs" /> |
||||
<Compile Include="Src\fsi.fs" /> |
||||
<EmbeddedResource Include="Resources\FS-Mode.xshd" /> |
||||
<EmbeddedResource Include="Resources\FsOptions.xfrm" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Reference Include="AvalonDock"> |
||||
<HintPath>..\..\..\..\..\Libraries\AvalonDock\AvalonDock.dll</HintPath> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="FSharp.Build.Tasks"> |
||||
<HintPath>..\..\RequiredLibraries\FSharp.Build.Tasks.dll</HintPath> |
||||
</Reference> |
||||
<Reference Include="log4net"> |
||||
<HintPath>..\..\..\..\..\Libraries\log4net\log4net.dll</HintPath> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="Microsoft.Build.Engine, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
||||
<Name>Microsoft.Build.Engine</Name> |
||||
<AssemblyName>Microsoft.Build.Engine.dll</AssemblyName> |
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="Microsoft.Build.Framework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="Microsoft.VisualC" /> |
||||
<Reference Include="Mono.Cecil"> |
||||
<HintPath>..\..\..\..\..\Libraries\Mono.Cecil\Mono.Cecil.dll</HintPath> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="PresentationCFFRasterizer" /> |
||||
<Reference Include="PresentationCore"> |
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="PresentationFramework"> |
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework> |
||||
</Reference> |
||||
<Reference Include="System" /> |
||||
<Reference Include="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
||||
<Name>System.Configuration</Name> |
||||
<AssemblyName>System.configuration.dll</AssemblyName> |
||||
<Reference Include="PresentationUI"> |
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework> |
||||
</Reference> |
||||
<Reference Include="ReachFramework"> |
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework> |
||||
</Reference> |
||||
<Reference Include="System.Configuration"> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="System.Core"> |
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="System.Deployment" /> |
||||
<Reference Include="System.DirectoryServices" /> |
||||
<Reference Include="System.Printing"> |
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="System.Security"> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
||||
<Name>System.Drawing</Name> |
||||
<AssemblyName>System.Drawing.dll</AssemblyName> |
||||
<Reference Include="UIAutomationProvider"> |
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework> |
||||
</Reference> |
||||
<Reference Include="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> |
||||
<Name>System.Windows.Forms</Name> |
||||
<AssemblyName>System.Windows.Forms.dll</AssemblyName> |
||||
<Reference Include="UIAutomationTypes"> |
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework> |
||||
</Reference> |
||||
<Reference Include="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> |
||||
<Name>System.Xml</Name> |
||||
<AssemblyName>System.XML.dll</AssemblyName> |
||||
<Reference Include="WindowsBase"> |
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework> |
||||
</Reference> |
||||
<Reference Include="WindowsFormsIntegration" /> |
||||
<Compile Include="Src\project.fs" /> |
||||
<Compile Include="Src\languagebinding.fs" /> |
||||
<Compile Include="Src\fsi.fs" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<EmbeddedResource Include="Resources\FS-Mode.xshd" /> |
||||
<EmbeddedResource Include="Resources\FsOptions.xfrm" /> |
||||
<None Include="..\..\RequiredLibraries\SharpDevelop.Build.Fsc.targets"> |
||||
<Link>SharpDevelop.Build.Fsc.targets</Link> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<None Include="FSharpBinding.addin"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<None Include="Templates\ConsoleProject.xpt"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<None Include="Templates\EmptyClass.xft"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ProjectReference Include="..\..\..\..\..\Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj"> |
||||
<Project>{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}</Project> |
||||
<Name>ICSharpCode.TextEditor</Name> |
||||
<Project>{2d18be89-d210-49eb-a9dd-2246fbb3df6d}</Project> |
||||
<Private>True</Private> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\..\Libraries\NRefactory\Project\NRefactory.csproj"> |
||||
<Project>{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}</Project> |
||||
<Name>NRefactory</Name> |
||||
<Project>{3a9ae6aa-bc07-4a2f-972c-581e3ae2f195}</Project> |
||||
<Private>True</Private> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj"> |
||||
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project> |
||||
<Name>ICSharpCode.SharpDevelop</Name> |
||||
<Project>{2748ad25-9c63-4e12-877b-4dce96fbed54}</Project> |
||||
<Private>True</Private> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\..\Main\Core\Project\ICSharpCode.Core.csproj"> |
||||
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project> |
||||
<Name>ICSharpCode.Core</Name> |
||||
<Project>{35cef10f-2d4c-45f2-9dd1-161e0fec583c}</Project> |
||||
<Private>True</Private> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\..\Main\ICSharpCode.Core.Presentation\ICSharpCode.Core.Presentation.csproj"> |
||||
<Project>{7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}</Project> |
||||
<Name>ICSharpCode.Core.Presentation</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\..\Main\ICSharpCode.Core.WinForms\ICSharpCode.Core.WinForms.csproj"> |
||||
<Project>{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}</Project> |
||||
<Name>ICSharpCode.Core.WinForms</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\..\Main\ICSharpCode.SharpDevelop.BuildWorker\ICSharpCode.SharpDevelop.BuildWorker.csproj"> |
||||
<Project>{C3CBC8E3-81D8-4C5B-9941-DCCD12D50B1F}</Project> |
||||
<Name>ICSharpCode.SharpDevelop.BuildWorker</Name> |
||||
<Project>{c3cbc8e3-81d8-4c5b-9941-dccd12d50b1f}</Project> |
||||
<Private>True</Private> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\..\Main\ICSharpCode.SharpDevelop.Dom\Project\ICSharpCode.SharpDevelop.Dom.csproj"> |
||||
<Project>{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}</Project> |
||||
<Name>ICSharpCode.SharpDevelop.Dom</Name> |
||||
<Project>{924ee450-603d-49c1-a8e5-4afaa31ce6f3}</Project> |
||||
<Private>True</Private> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\..\Main\ICSharpCode.SharpDevelop.Widgets\Project\ICSharpCode.SharpDevelop.Widgets.csproj"> |
||||
<Project>{8035765F-D51F-4A0C-A746-2FD100E19419}</Project> |
||||
<Name>ICSharpCode.SharpDevelop.Widgets</Name> |
||||
<Project>{8035765f-d51f-4a0c-a746-2fd100e19419}</Project> |
||||
<Private>True</Private> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
</ItemGroup> |
||||
<Import Project="$(MSBuildExtensionsPath)\FSharp\1.0\Microsoft.FSharp.Targets" /> |
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
||||
Other similar extension points exist, see Microsoft.Common.targets. |
||||
<Target Name="BeforeBuild"> |
||||
</Target> |
||||
<Target Name="AfterBuild"> |
||||
</Target> |
||||
--> |
||||
</Project> |
Binary file not shown.
@ -0,0 +1,159 @@
@@ -0,0 +1,159 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<UsingTask TaskName="FSharp.Build.Tasks.Fsc" AssemblyFile="FSharp.Build.Tasks.dll" /> |
||||
<UsingTask TaskName="FSharp.Build.Tasks.IsFscInstalled" AssemblyFile="FSharp.Build.Tasks.dll" /> |
||||
<UsingTask TaskName="CreateCSharpManifestResourceName" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> |
||||
<UsingTask TaskName="Copy" AssemblyName="Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> |
||||
|
||||
<PropertyGroup> |
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(FSharpBuildTasksPath)\SharpDevelop.Build.Fsc.targets</MSBuildAllProjects> |
||||
<DefaultLanguageSourceExtension>.fs</DefaultLanguageSourceExtension> |
||||
<Language>F#</Language> |
||||
<CheckIfFscNotInstalled Condition=" '$(CheckIfFscNotInstalled)' == '' ">False</CheckIfFscNotInstalled> |
||||
<FscInstalled>True</FscInstalled> |
||||
</PropertyGroup> |
||||
|
||||
<PropertyGroup> |
||||
<CreateManifestResourceNamesDependsOn> |
||||
</CreateManifestResourceNamesDependsOn> |
||||
</PropertyGroup> |
||||
<Target Name="CreateManifestResourceNames" Condition="'@(ResxWithNoCulture)@(ResxWithCulture)@(NonResxWithNoCulture)@(NonResxWithCulture)'!=''" DependsOnTargets="$(CreateManifestResourceNamesDependsOn)"> |
||||
<!-- Create the target resource names for non-culture resx files. --> |
||||
<CreateCSharpManifestResourceName Condition="'@(ResxWithNoCulture)'!=''" ResourceFiles="@(ResxWithNoCulture)" RootNamespace="$(RootNamespace)"> |
||||
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestResourceWithNoCultureName" /> |
||||
</CreateCSharpManifestResourceName> |
||||
|
||||
<!-- Create the target resource names for culture resx files. --> |
||||
<CreateCSharpManifestResourceName Condition="'@(ResxWithCulture)'!=''" ResourceFiles="@(ResxWithCulture)" RootNamespace="$(RootNamespace)"> |
||||
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestResourceWithCultureName" /> |
||||
</CreateCSharpManifestResourceName> |
||||
|
||||
<!-- Create the target resource names for non-culture non-resx files. --> |
||||
<CreateCSharpManifestResourceName Condition="'@(NonResxWithNoCulture)'!=''" ResourceFiles="@(NonResxWithNoCulture)" RootNamespace="$(RootNamespace)"> |
||||
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestNonResxWithNoCulture" /> |
||||
</CreateCSharpManifestResourceName> |
||||
|
||||
<!-- Create the target resource names for culture non-resx files. --> |
||||
<CreateCSharpManifestResourceName Condition="'@(NonResxWithCulture)'!=''" ResourceFiles="@(NonResxWithCulture)" RootNamespace="$(RootNamespace)"> |
||||
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestNonResxWithCulture" /> |
||||
</CreateCSharpManifestResourceName> |
||||
</Target> |
||||
|
||||
<Target Name="CoreCompile" Inputs="$(MSBuildAllProjects); |
||||
@(Compile); |
||||
@(ReferencePath); |
||||
@(ManifestResourceWithNoCulture); |
||||
$(ApplicationIcon); |
||||
$(AssemblyOriginatorKeyFile); |
||||
@(ManifestNonResxWithNoCultureOnDisk); |
||||
@(ReferencePath); |
||||
@(CompiledLicenseFile)" |
||||
Outputs="@(DocFileItem); |
||||
@(IntermediateAssembly); |
||||
$(NonExistentFile)" |
||||
DependsOnTargets="$(CoreCompileDependsOn)"> |
||||
<Fsc |
||||
Condition=" '$(FscInstalled)' == 'True' " |
||||
DebugType="$(DebugType)" |
||||
EmitDebugInformation="$(DebugSymbols)" |
||||
FileAlignment="$(FileAlignment)" |
||||
KeyContainer="$(KeyContainerName)" |
||||
KeyFile="$(KeyOriginatorFile)" |
||||
Optimize="$(Optimize)" |
||||
OutputAssembly="@(IntermediateAssembly)" |
||||
Resources="@(ManifestResourceWithNoCulture);@(ManifestNonResxWithNoCultureOnDisk);@(CompiledLicenseFile)" |
||||
Sources="@(Compile)" |
||||
References="@(ReferencePath)" |
||||
TargetType="$(OutputType)" |
||||
Standalone="$(Standalone)" |
||||
NoMLLib="$(NoMLLib)" /> |
||||
</Target> |
||||
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.Common.targets" /> |
||||
|
||||
<!-- |
||||
Check if F# is installed. |
||||
--> |
||||
<Target Name="BeforeBuild"> |
||||
<CallTarget Targets="IfFscInstalled" /> |
||||
</Target> |
||||
<Target Name="BeforeClean"> |
||||
<CallTarget Targets="IfFscInstalled" /> |
||||
</Target> |
||||
<Target Name="BeforeRebuild"> |
||||
<CallTarget Targets="IfFscInstalled" /> |
||||
</Target> |
||||
|
||||
<Target Name="IfFscInstalled"> |
||||
<Message Text="Checking if F# is installed." Condition=" '$(CheckIfFscNotInstalled)' == 'True' "/> |
||||
|
||||
<!-- Check if F# is installed --> |
||||
<IsFscInstalled Condition=" '$(CheckIfFscNotInstalled)' == 'True' "> |
||||
<Output TaskParameter="IsInstalled" PropertyName="FscInstalled"/> |
||||
</IsFscInstalled> |
||||
|
||||
<Warning Code="FSC1001" Text="Unable to find the F# compiler (fsi.exe). The F# addin will not be compiled." Condition=" '$(FscInstalled)' == 'False' and '$(CheckIfFscNotInstalled)' == 'True' " /> |
||||
</Target> |
||||
|
||||
<!-- Override CopyFilesToOutputDirectory so if the F# compiler is not installed there are |
||||
no errors when trying to copy non-existent files. --> |
||||
<Target |
||||
Name="CopyFilesToOutputDirectory" |
||||
DependsOnTargets=" |
||||
ComputeIntermediateSatelliteAssemblies; |
||||
_CopyFilesMarkedCopyLocal; |
||||
_CopySourceItemsToOutputDirectory; |
||||
_CopyAppConfigFile; |
||||
_CopyManifestFiles; |
||||
_CheckForCompileOutputs; |
||||
_SGenCheckForOutputs"> |
||||
|
||||
<!-- Copy the build product (.dll or .exe). --> |
||||
<Copy Condition=" '$(FscInstalled)' == 'True' " |
||||
SourceFiles="@(IntermediateAssembly)" |
||||
DestinationFolder="$(OutDir)" |
||||
SkipUnchangedFiles="true" |
||||
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"> |
||||
|
||||
<Output TaskParameter="DestinationFiles" ItemName="MainAssembly"/> |
||||
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> |
||||
|
||||
</Copy> |
||||
|
||||
<Message Importance="High" Text="$(MSBuildProjectName) -> @(MainAssembly->'%(FullPath)')" /> |
||||
|
||||
<!-- Copy the debug information file (.pdb), if any --> |
||||
<Copy |
||||
SourceFiles="@(_DebugSymbolsIntermediatePath)" |
||||
DestinationFiles="@(_DebugSymbolsOutputPath)" |
||||
SkipUnchangedFiles="true" |
||||
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" |
||||
Condition="'$(FscInstalled)' == 'True' and '$(_DebugSymbolsProduced)'=='true' and '$(SkipCopyingSymbolsToOutputDirectory)' != 'true'"> |
||||
|
||||
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> |
||||
|
||||
</Copy> |
||||
|
||||
<!-- Copy the resulting XML documentation file, if any. --> |
||||
<Copy |
||||
SourceFiles="@(DocFileItem)" |
||||
DestinationFiles="@(FinalDocFile)" |
||||
SkipUnchangedFiles="true" |
||||
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" |
||||
Condition="'$(FscInstalled)' == 'True' and '$(_DocumentationFileProduced)'=='true'"> |
||||
|
||||
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> |
||||
|
||||
</Copy> |
||||
|
||||
<!-- Copy satellite assemblies. --> |
||||
<Copy Condition=" '$(FscInstalled)' == 'True' " |
||||
SourceFiles="@(IntermediateSatelliteAssembliesWithTargetPath)" |
||||
DestinationFiles="@(IntermediateSatelliteAssembliesWithTargetPath->'$(OutDir)%(Culture)\$(TargetName).resources.dll')" |
||||
SkipUnchangedFiles="true" |
||||
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"> |
||||
|
||||
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> |
||||
|
||||
</Copy> |
||||
</Target> |
||||
</Project> |
Loading…
Reference in new issue