diff --git a/Fsdk/Fsdk-legacy.fsproj b/Fsdk/Fsdk-legacy.fsproj
index 712c18e9..9182e28c 100644
--- a/Fsdk/Fsdk-legacy.fsproj
+++ b/Fsdk/Fsdk-legacy.fsproj
@@ -55,8 +55,8 @@
-
+
diff --git a/Fsdk/Network.fs b/Fsdk/Network.fs
index fe1a2098..5ffea80a 100644
--- a/Fsdk/Network.fs
+++ b/Fsdk/Network.fs
@@ -421,6 +421,32 @@ module Network =
GetPrivateIpOfThisServer()
)
+ // this is a translation of doing this in unix (assuming initialVersion="0.1.0"):
+ // 0.1.0--date`date +%Y%m%d-%H%M`.git-`git rev-parse --short=7 HEAD`
+ let GetNugetPrereleaseVersionFromBaseVersion(baseVersion: string) =
+ let initialVersion =
+ let versionSplit = baseVersion.Split '.'
+
+ if versionSplit.Length = 4 && versionSplit.[3] = "0" then
+ String.Join(".", versionSplit.Take 3)
+ else
+ baseVersion
+
+ let dateSegment =
+ sprintf "date%s" (DateTime.UtcNow.ToString "yyyyMMdd-hhmm")
+
+ let gitHash = Git.GetLastCommit()
+
+ if isNull gitHash then
+ Console.Error.WriteLine "Not in a git repository?"
+ Environment.Exit 2
+
+ let gitHashDefaultShortLength = 7
+ let gitShortHash = gitHash.Substring(0, gitHashDefaultShortLength)
+ let gitSegment = sprintf "git-%s" gitShortHash
+ let finalVersion = sprintf "%s--%s.%s" initialVersion dateSegment gitSegment
+ finalVersion
+
let NugetDownloadUrl =
"https://dist.nuget.org/win-x86-commandline/v5.4.0/nuget.exe"
diff --git a/Tools/nugetPush.fsx b/Tools/nugetPush.fsx
index fdd8462f..28268736 100755
--- a/Tools/nugetPush.fsx
+++ b/Tools/nugetPush.fsx
@@ -9,8 +9,8 @@ open System.Configuration
#load "../Fsdk/Misc.fs"
#load "../Fsdk/Process.fs"
-#load "../Fsdk/Network.fs"
#load "../Fsdk/Git.fs"
+#load "../Fsdk/Network.fs"
open Fsdk
open Fsdk.Process
@@ -31,32 +31,6 @@ if args.Length > 2 && args.[0] <> "--output-version" then
let currentDir = Directory.GetCurrentDirectory() |> DirectoryInfo
-// this is a translation of doing this in unix (assuming initialVersion="0.1.0"):
-// 0.1.0--date`date +%Y%m%d-%H%M`.git-`git rev-parse --short=7 HEAD`
-let GetIdealNugetVersion(inputVersion: string) =
- let initialVersion =
- let versionSplit = inputVersion.Split '.'
-
- if versionSplit.Length = 4 && versionSplit.[3] = "0" then
- String.Join(".", versionSplit.Take 3)
- else
- inputVersion
-
- let dateSegment =
- sprintf "date%s" (DateTime.UtcNow.ToString "yyyyMMdd-hhmm")
-
- let gitHash = Git.GetLastCommit()
-
- if null = gitHash then
- Console.Error.WriteLine "Not in a git repository?"
- Environment.Exit 2
-
- let gitHashDefaultShortLength = 7
- let gitShortHash = gitHash.Substring(0, gitHashDefaultShortLength)
- let gitSegment = sprintf "git-%s" gitShortHash
- let finalVersion = sprintf "%s--%s.%s" initialVersion dateSegment gitSegment
- finalVersion
-
let IsDotNetSdkInstalled() =
try
let dotnetVersionCmd =
@@ -115,7 +89,7 @@ let FindOrGenerateNugetPackages() : seq =
let packageName =
Path.GetFileNameWithoutExtension nuspecFile.FullName
- let nugetVersion = GetIdealNugetVersion baseVersion
+ let nugetVersion = Network.GetPrereleaseNugetVersionFromBaseVersion baseVersion
// we need to download nuget.exe here because `dotnet pack` doesn't support using standalone (i.e.
// without a project association) .nuspec files, see https://github.com/NuGet/Home/issues/4254
diff --git a/fsx/fsx-legacy.fsproj b/fsx/fsx-legacy.fsproj
index 0ece59e8..3b6bced7 100644
--- a/fsx/fsx-legacy.fsproj
+++ b/fsx/fsx-legacy.fsproj
@@ -48,6 +48,9 @@
..\Fsdk\Process.fs
+
+ ..\Fsdk\Git.fs
+
..\Fsdk\Network.fs
diff --git a/fsx/fsx.fsproj b/fsx/fsx.fsproj
index 68017157..84f0eaee 100644
--- a/fsx/fsx.fsproj
+++ b/fsx/fsx.fsproj
@@ -30,6 +30,9 @@
..\Fsdk\Process.fs
+
+ ..\Fsdk\Git.fs
+
..\Fsdk\Network.fs
diff --git a/fsxc/fsxc-legacy.fsproj b/fsxc/fsxc-legacy.fsproj
index da38abe9..6b337786 100644
--- a/fsxc/fsxc-legacy.fsproj
+++ b/fsxc/fsxc-legacy.fsproj
@@ -51,6 +51,9 @@
Fsdk\Process.fs
+
+ Fsdk\Git.fs
+
Fsdk\Network.fs
diff --git a/fsxc/fsxc.fsproj b/fsxc/fsxc.fsproj
index f9b55650..90384014 100644
--- a/fsxc/fsxc.fsproj
+++ b/fsxc/fsxc.fsproj
@@ -29,6 +29,9 @@
Fsdk\Process.fs
+
+ Fsdk\Git.fs
+
Fsdk\Network.fs
diff --git a/scripts/runTests.fsx b/scripts/runTests.fsx
index 7c1b3573..57275232 100755
--- a/scripts/runTests.fsx
+++ b/scripts/runTests.fsx
@@ -11,8 +11,8 @@ open System.Configuration
#load "../Fsdk/Misc.fs"
#load "../Fsdk/Process.fs"
-#load "../Fsdk/Network.fs"
#load "../Fsdk/Git.fs"
+#load "../Fsdk/Network.fs"
open Fsdk
open Fsdk.Process
diff --git a/scripts/runUnitTests.fsx b/scripts/runUnitTests.fsx
index 4fe27c4f..eb5d02af 100755
--- a/scripts/runUnitTests.fsx
+++ b/scripts/runUnitTests.fsx
@@ -13,8 +13,8 @@ open System.Configuration
#load "../Fsdk/Misc.fs"
#load "../Fsdk/Process.fs"
-#load "../Fsdk/Network.fs"
#load "../Fsdk/Git.fs"
+#load "../Fsdk/Network.fs"
open Fsdk
open Fsdk.Process