From 8551c3264a1f623c83fdbc703cd32b5df3a32bdf Mon Sep 17 00:00:00 2001 From: Tomas Petricek Date: Thu, 21 Jan 2016 14:19:33 +0000 Subject: [PATCH 1/5] Rename FCS to avoid clashes --- build.fsx | 15 ++++++ src/app/FakeLib/FakeLib.fsproj | 14 ++--- .../FSharp.Compiler.Service.csproj | 53 +++++++++++++++++++ .../FakeFSharpChecker.cs | 12 +++++ .../Properties/AssemblyInfo.cs | 36 +++++++++++++ src/test/testscripts/compilerservice.fsx | 12 +++++ 6 files changed, 136 insertions(+), 6 deletions(-) create mode 100644 src/test/testscripts/FSharp.Compiler.Service/FSharp.Compiler.Service.csproj create mode 100644 src/test/testscripts/FSharp.Compiler.Service/FakeFSharpChecker.cs create mode 100644 src/test/testscripts/FSharp.Compiler.Service/Properties/AssemblyInfo.cs create mode 100644 src/test/testscripts/compilerservice.fsx diff --git a/build.fsx b/build.fsx index c3d7af27253..315ec45582c 100644 --- a/build.fsx +++ b/build.fsx @@ -1,5 +1,6 @@ #I @"packages/build/FAKE/tools/" #r @"FakeLib.dll" +#r @"packages\Mono.Cecil\lib\net45\Mono.Cecil.dll" #load "packages/build/SourceLink.Fake/tools/SourceLink.fsx" open Fake @@ -50,6 +51,19 @@ Target "Clean" (fun _ -> CleanDirs [buildDir; testDir; docsDir; apidocsDir; nuge open Fake.AssemblyInfoFile +Target "RenameFSharpCompilerService" (fun _ -> + let reader = new Mono.Cecil.DefaultAssemblyResolver() + for framework in ["net40"; "net45"] do + let dir = __SOURCE_DIRECTORY__ "packages/FSharp.Compiler.Service/lib" framework + let targetFile = dir "FAKE.FSharp.Compiler.Service.dll" + DeleteFile targetFile + reader.AddSearchDirectory(dir) + let readerParams = new Mono.Cecil.ReaderParameters(AssemblyResolver = reader) + let asem = Mono.Cecil.AssemblyDefinition.ReadAssembly(dir "FSharp.Compiler.Service.dll", readerParams) + asem.Name <- new Mono.Cecil.AssemblyNameDefinition("FAKE.FSharp.Compiler.Service", new System.Version(1,0,0,0)) + asem.Write(dir "FAKE.FSharp.Compiler.Service.dll") +) + Target "SetAssemblyInfo" (fun _ -> let common = [ Attribute.Product "FAKE - F# Make" @@ -341,6 +355,7 @@ Target "Default" DoNothing // Dependencies "Clean" + ==> "RenameFSharpCompilerService" ==> "SetAssemblyInfo" ==> "BuildSolution" //==> "ILRepack" diff --git a/src/app/FakeLib/FakeLib.fsproj b/src/app/FakeLib/FakeLib.fsproj index b4f40b7e3d4..308ddfcc4b7 100644 --- a/src/app/FakeLib/FakeLib.fsproj +++ b/src/app/FakeLib/FakeLib.fsproj @@ -198,26 +198,28 @@ $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\$(FSharpSdkVer)\Framework\v4.0\Microsoft.FSharp.Targets + - - ..\..\..\packages\FSharp.Compiler.Service\lib\net40\FSharp.Compiler.Service.dll + + ..\..\..\packages\FSharp.Compiler.Service\lib\net40\FAKE.FSharp.Compiler.Service.dll True - True + False - - ..\..\..\packages\FSharp.Compiler.Service\lib\net45\FSharp.Compiler.Service.dll + + ..\..\..\packages\FSharp.Compiler.Service\lib\net45\FAKE.FSharp.Compiler.Service.dll True - True + False + diff --git a/src/test/testscripts/FSharp.Compiler.Service/FSharp.Compiler.Service.csproj b/src/test/testscripts/FSharp.Compiler.Service/FSharp.Compiler.Service.csproj new file mode 100644 index 00000000000..2c55e128640 --- /dev/null +++ b/src/test/testscripts/FSharp.Compiler.Service/FSharp.Compiler.Service.csproj @@ -0,0 +1,53 @@ + + + + + Debug + AnyCPU + {BD531A1D-E5E4-49DD-8562-AB62FCAE8802} + Library + Properties + FSharp.Compiler.Service + FSharp.Compiler.Service + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/testscripts/FSharp.Compiler.Service/FakeFSharpChecker.cs b/src/test/testscripts/FSharp.Compiler.Service/FakeFSharpChecker.cs new file mode 100644 index 00000000000..ba6221418cd --- /dev/null +++ b/src/test/testscripts/FSharp.Compiler.Service/FakeFSharpChecker.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Microsoft.FSharp.Compiler.SourceCodeServices +{ + public class FSharpChecker + { + } +} diff --git a/src/test/testscripts/FSharp.Compiler.Service/Properties/AssemblyInfo.cs b/src/test/testscripts/FSharp.Compiler.Service/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..f2cdde5c74d --- /dev/null +++ b/src/test/testscripts/FSharp.Compiler.Service/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("FSharp.Compiler.Service")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("FSharp.Compiler.Service")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("90585a41-fda3-43ac-92ff-93ad4a1b026c")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("42.42.42.42")] +[assembly: AssemblyFileVersion("42.42.42.42")] diff --git a/src/test/testscripts/compilerservice.fsx b/src/test/testscripts/compilerservice.fsx new file mode 100644 index 00000000000..594bff2ba01 --- /dev/null +++ b/src/test/testscripts/compilerservice.fsx @@ -0,0 +1,12 @@ +#r @"../../../build/FakeLib.dll" +#r @"FSharp.Compiler.Service/bin/Debug/FSharp.Compiler.Service.dll" +open Fake +open Microsoft.FSharp.Compiler.SourceCodeServices + +Target "Test" (fun _ -> + if not (typeof.Assembly.FullName.Contains("42.42.42.42")) then + failwith "Wrong FSharp.Compiler.Service was loaded..." +) + +RunTargetOrDefault "Test" + From fe440ef9d58e084aa2082f7dc944ad9cd8871eca Mon Sep 17 00:00:00 2001 From: Tomas Petricek Date: Thu, 21 Jan 2016 18:07:06 +0000 Subject: [PATCH 2/5] Fix slashes in build --- build.fsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.fsx b/build.fsx index 315ec45582c..9c4f942fbdb 100644 --- a/build.fsx +++ b/build.fsx @@ -1,6 +1,6 @@ #I @"packages/build/FAKE/tools/" #r @"FakeLib.dll" -#r @"packages\Mono.Cecil\lib\net45\Mono.Cecil.dll" +#r @"packages/Mono.Cecil/lib/net45/Mono.Cecil.dll" #load "packages/build/SourceLink.Fake/tools/SourceLink.fsx" open Fake From 50aef56b387a9549e7fe43e7081de2a5418490db Mon Sep 17 00:00:00 2001 From: Tomas Petricek Date: Thu, 21 Jan 2016 23:01:17 +0000 Subject: [PATCH 3/5] Add search path for FSharp.Core --- build.fsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.fsx b/build.fsx index 9c4f942fbdb..3fe5a974f9d 100644 --- a/build.fsx +++ b/build.fsx @@ -52,12 +52,14 @@ Target "Clean" (fun _ -> CleanDirs [buildDir; testDir; docsDir; apidocsDir; nuge open Fake.AssemblyInfoFile Target "RenameFSharpCompilerService" (fun _ -> - let reader = new Mono.Cecil.DefaultAssemblyResolver() for framework in ["net40"; "net45"] do let dir = __SOURCE_DIRECTORY__ "packages/FSharp.Compiler.Service/lib" framework let targetFile = dir "FAKE.FSharp.Compiler.Service.dll" DeleteFile targetFile + + let reader = new Mono.Cecil.DefaultAssemblyResolver() reader.AddSearchDirectory(dir) + reader.AddSearchDirectory(__SOURCE_DIRECTORY__ "packages/FSharp.Core/lib/net40") let readerParams = new Mono.Cecil.ReaderParameters(AssemblyResolver = reader) let asem = Mono.Cecil.AssemblyDefinition.ReadAssembly(dir "FSharp.Compiler.Service.dll", readerParams) asem.Name <- new Mono.Cecil.AssemblyNameDefinition("FAKE.FSharp.Compiler.Service", new System.Version(1,0,0,0)) From 21d1e80195b0e8588bc89e89c8f46e6b955f2f4d Mon Sep 17 00:00:00 2001 From: Matthias Dittrich Date: Thu, 21 Jan 2016 21:44:40 +0100 Subject: [PATCH 4/5] update fcs --- paket.lock | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/paket.lock b/paket.lock index 34c0289a47f..cd6c70fe391 100644 --- a/paket.lock +++ b/paket.lock @@ -16,7 +16,7 @@ NUGET FsCheck.Xunit (2.0.7) FsCheck (>= 2.0.7) xunit (>= 1.9.2) - FSharp.Compiler.Service (1.4.2.3) + FSharp.Compiler.Service (2.0.0.2) FSharp.Core (4.0.0.1) HashLib (2.0.1) jQuery (2.1.4) @@ -88,16 +88,16 @@ GITHUB GROUP Build CONTENT: NONE NUGET - remote: http://nuget.org/api/v2 + remote: http://www.nuget.org/api/v2 specs: - FAKE (4.11.0) - FSharp.Compiler.Service (1.4.0.6) - FSharp.Formatting (2.12.0) - FSharp.Compiler.Service (1.4.0.6) - FSharpVSPowerTools.Core (2.1.0) - FSharp.Formatting.CommandTool (2.12.0) - FSharpVSPowerTools.Core (2.1.0) - FSharp.Compiler.Service (>= 1.4.0.6) - ILRepack (2.0.9) + FAKE (4.17.0-alpha002) + FSharp.Compiler.Service (1.4.2.3) + FSharp.Formatting (2.13.4) + FSharp.Compiler.Service (>= 1.4.2 < 1.5.0) + FSharpVSPowerTools.Core (>= 2.2.0 < 2.3.0) + FSharp.Formatting.CommandTool (2.13.4) + FSharpVSPowerTools.Core (2.2.0) + FSharp.Compiler.Service (>= 1.4.2.0) + ILRepack (2.0.10) NuGet.CommandLine (3.3.0) SourceLink.Fake (1.1.0) From 91ec2aae52665a0a660c44e4a23df872762a765b Mon Sep 17 00:00:00 2001 From: Tomas Petricek Date: Thu, 21 Jan 2016 23:36:32 +0000 Subject: [PATCH 5/5] Remove experimental files --- .../FSharp.Compiler.Service.csproj | 53 ------------------- .../FakeFSharpChecker.cs | 12 ----- .../Properties/AssemblyInfo.cs | 36 ------------- src/test/testscripts/compilerservice.fsx | 12 ----- 4 files changed, 113 deletions(-) delete mode 100644 src/test/testscripts/FSharp.Compiler.Service/FSharp.Compiler.Service.csproj delete mode 100644 src/test/testscripts/FSharp.Compiler.Service/FakeFSharpChecker.cs delete mode 100644 src/test/testscripts/FSharp.Compiler.Service/Properties/AssemblyInfo.cs delete mode 100644 src/test/testscripts/compilerservice.fsx diff --git a/src/test/testscripts/FSharp.Compiler.Service/FSharp.Compiler.Service.csproj b/src/test/testscripts/FSharp.Compiler.Service/FSharp.Compiler.Service.csproj deleted file mode 100644 index 2c55e128640..00000000000 --- a/src/test/testscripts/FSharp.Compiler.Service/FSharp.Compiler.Service.csproj +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Debug - AnyCPU - {BD531A1D-E5E4-49DD-8562-AB62FCAE8802} - Library - Properties - FSharp.Compiler.Service - FSharp.Compiler.Service - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/testscripts/FSharp.Compiler.Service/FakeFSharpChecker.cs b/src/test/testscripts/FSharp.Compiler.Service/FakeFSharpChecker.cs deleted file mode 100644 index ba6221418cd..00000000000 --- a/src/test/testscripts/FSharp.Compiler.Service/FakeFSharpChecker.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Microsoft.FSharp.Compiler.SourceCodeServices -{ - public class FSharpChecker - { - } -} diff --git a/src/test/testscripts/FSharp.Compiler.Service/Properties/AssemblyInfo.cs b/src/test/testscripts/FSharp.Compiler.Service/Properties/AssemblyInfo.cs deleted file mode 100644 index f2cdde5c74d..00000000000 --- a/src/test/testscripts/FSharp.Compiler.Service/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("FSharp.Compiler.Service")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("FSharp.Compiler.Service")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("90585a41-fda3-43ac-92ff-93ad4a1b026c")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("42.42.42.42")] -[assembly: AssemblyFileVersion("42.42.42.42")] diff --git a/src/test/testscripts/compilerservice.fsx b/src/test/testscripts/compilerservice.fsx deleted file mode 100644 index 594bff2ba01..00000000000 --- a/src/test/testscripts/compilerservice.fsx +++ /dev/null @@ -1,12 +0,0 @@ -#r @"../../../build/FakeLib.dll" -#r @"FSharp.Compiler.Service/bin/Debug/FSharp.Compiler.Service.dll" -open Fake -open Microsoft.FSharp.Compiler.SourceCodeServices - -Target "Test" (fun _ -> - if not (typeof.Assembly.FullName.Contains("42.42.42.42")) then - failwith "Wrong FSharp.Compiler.Service was loaded..." -) - -RunTargetOrDefault "Test" -