diff --git a/build.fsx b/build.fsx index bfacf71..ef030da 100644 --- a/build.fsx +++ b/build.fsx @@ -56,6 +56,7 @@ let slnFile = "./src/Akka.Persistence.Cassandra.sln" open Fake.RestorePackageHelper Target "RestorePackages" (fun _ -> + printfn "Restoring packages for %s" slnFile slnFile |> RestoreMSSolutionPackages (fun p -> { p with @@ -153,7 +154,44 @@ module Nuget = | _ -> release.NugetVersion open Nuget +open NuGet.Update +//-------------------------------------------------------------------------------- +// Upgrade nuget package versions for dev and production + +let updateNugetPackages _ = + printfn "Updating NuGet dependencies" + + let getConfigFile preRelease = + match preRelease with + | true -> "src/.nuget/NuGet.Dev.Config" + | false -> "src/.nuget/NuGet.Config" + + let getPackages project = + match project with + | "Akka.Persistence.Cassandra" -> ["Akka.Persistence";] + | "Akka.Persistence.Cassandra.Tests" -> ["Akka.Persistence.TestKit";] + | _ -> [] + + for projectFile in !! "src/**/*.csproj" do + printfn "Updating packages for %s" projectFile + let project = Path.GetFileNameWithoutExtension projectFile + let projectDir = Path.GetDirectoryName projectFile + let config = projectDir @@ "packages.config" + + NugetUpdate + (fun p -> + { p with + ConfigFile = Some (getConfigFile isPreRelease) + Prerelease = true + ToolPath = nugetExe + RepositoryPath = "src/Packages" + Ids = getPackages project + }) config + +Target "UpdateDependencies" <| fun _ -> + printfn "Invoking updateNugetPackages" + updateNugetPackages() //-------------------------------------------------------------------------------- // Clean nuget directory @@ -383,7 +421,7 @@ Target "HelpDocs" <| fun _ -> //-------------------------------------------------------------------------------- // build dependencies -"Clean" ==> "AssemblyInfo" ==> "RestorePackages" ==> "Build" ==> "CopyOutput" ==> "BuildRelease" +"Clean" ==> "AssemblyInfo" ==> "RestorePackages" ==> "UpdateDependencies" ==> "Build" ==> "CopyOutput" ==> "BuildRelease" // tests dependencies "CleanTests" ==> "RunTests" diff --git a/src/.nuget/NuGet.Dev.Config b/src/.nuget/NuGet.Dev.Config new file mode 100644 index 0000000..ccb961d --- /dev/null +++ b/src/.nuget/NuGet.Dev.Config @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/.nuget/NuGet.exe b/src/.nuget/NuGet.exe index 9ca6659..324daa8 100644 Binary files a/src/.nuget/NuGet.exe and b/src/.nuget/NuGet.exe differ diff --git a/src/.nuget/NuGet.targets b/src/.nuget/NuGet.targets index 3f8c37b..c4d5b84 100644 --- a/src/.nuget/NuGet.targets +++ b/src/.nuget/NuGet.targets @@ -19,10 +19,6 @@ - diff --git a/src/Akka.Persistence.Cassandra.sln b/src/Akka.Persistence.Cassandra.sln index 3ae5c80..a7ce979 100644 --- a/src/Akka.Persistence.Cassandra.sln +++ b/src/Akka.Persistence.Cassandra.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 -VisualStudioVersion = 12.0.30723.0 +VisualStudioVersion = 12.0.31101.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Akka.Persistence.Cassandra", "Akka.Persistence.Cassandra\Akka.Persistence.Cassandra.csproj", "{54BD0B45-8A46-4194-8C33-AD287CAC8FA4}" EndProject @@ -10,6 +10,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{8595E89A-2B9E-44CE-8286-0B755DA92226}" ProjectSection(SolutionItems) = preProject .nuget\NuGet.Config = .nuget\NuGet.Config + .nuget\NuGet.Dev.Config = .nuget\NuGet.Dev.Config .nuget\NuGet.exe = .nuget\NuGet.exe .nuget\NuGet.targets = .nuget\NuGet.targets EndProjectSection diff --git a/src/Akka.Persistence.Cassandra/Akka.Persistence.Cassandra.csproj b/src/Akka.Persistence.Cassandra/Akka.Persistence.Cassandra.csproj index 8e88c01..2062ca5 100644 --- a/src/Akka.Persistence.Cassandra/Akka.Persistence.Cassandra.csproj +++ b/src/Akka.Persistence.Cassandra/Akka.Persistence.Cassandra.csproj @@ -45,18 +45,15 @@ ..\packages\Google.ProtocolBuffers.2.4.1.521\lib\net40\Google.ProtocolBuffers.dll - True ..\packages\Google.ProtocolBuffers.2.4.1.521\lib\net40\Google.ProtocolBuffers.Serialization.dll - True ..\packages\lz4net.1.0.5.93\lib\net40-client\LZ4.dll ..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll - True