Skip to content

Commit

Permalink
Merge pull request #1097 from tpetricek/rename-fcs
Browse files Browse the repository at this point in the history
[Experimental] Rename FCS to avoid clashes (for #1096)
  • Loading branch information
forki committed Jan 22, 2016
2 parents f33b398 + 91ec2aa commit 262053b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 17 deletions.
17 changes: 17 additions & 0 deletions build.fsx
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -50,6 +51,21 @@ Target "Clean" (fun _ -> CleanDirs [buildDir; testDir; docsDir; apidocsDir; nuge

open Fake.AssemblyInfoFile

Target "RenameFSharpCompilerService" (fun _ ->
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))
asem.Write(dir </> "FAKE.FSharp.Compiler.Service.dll")
)

Target "SetAssemblyInfo" (fun _ ->
let common = [
Attribute.Product "FAKE - F# Make"
Expand Down Expand Up @@ -341,6 +357,7 @@ Target "Default" DoNothing

// Dependencies
"Clean"
==> "RenameFSharpCompilerService"
==> "SetAssemblyInfo"
==> "BuildSolution"
//==> "ILRepack"
Expand Down
22 changes: 11 additions & 11 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
14 changes: 8 additions & 6 deletions src/app/FakeLib/FakeLib.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -198,26 +198,28 @@
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\$(FSharpSdkVer)\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
<Import Project="$(FSharpTargetsPath)" />
<!-- Hand-crafted reference to the renamed version of FCS. You must run build.cmd/build.sh first! -->
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0')">
<ItemGroup>
<Reference Include="FSharp.Compiler.Service">
<HintPath>..\..\..\packages\FSharp.Compiler.Service\lib\net40\FSharp.Compiler.Service.dll</HintPath>
<Reference Include="FAKE.FSharp.Compiler.Service">
<HintPath>..\..\..\packages\FSharp.Compiler.Service\lib\net40\FAKE.FSharp.Compiler.Service.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
<Paket>False</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1')">
<ItemGroup>
<Reference Include="FSharp.Compiler.Service">
<HintPath>..\..\..\packages\FSharp.Compiler.Service\lib\net45\FSharp.Compiler.Service.dll</HintPath>
<Reference Include="FAKE.FSharp.Compiler.Service">
<HintPath>..\..\..\packages\FSharp.Compiler.Service\lib\net45\FAKE.FSharp.Compiler.Service.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
<Paket>False</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<!-- Ordinary dependencies managed by Paket as usual -->
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v2.0' Or $(TargetFrameworkVersion) == 'v3.0' Or $(TargetFrameworkVersion) == 'v3.5')">
<ItemGroup>
Expand Down

0 comments on commit 262053b

Please sign in to comment.