-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update test and build infrastructure #430
Changes from 8 commits
4154739
975b6b9
26c7782
b529526
3dfb9ec
f4b82c0
6bb556c
381216e
21eb2f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<appSettings> | ||
<add key="Prerelease" value="True"/> | ||
</appSettings> | ||
</configuration> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,9 @@ | ||
@echo off | ||
|
||
.paket\paket.bootstrapper.exe | ||
if errorlevel 1 ( | ||
exit /b %errorlevel% | ||
) | ||
|
||
.paket\paket.exe restore | ||
if errorlevel 1 ( | ||
exit /b %errorlevel% | ||
) | ||
|
||
packages\FAKE\tools\FAKE.exe build.fsx %* | ||
pause | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
System.IO.Directory.SetCurrentDirectory __SOURCE_DIRECTORY__ | ||
|
||
// -------------------------------------------------------------------------------------- | ||
// FAKE build script | ||
// -------------------------------------------------------------------------------------- | ||
|
@@ -12,8 +14,6 @@ open Fake.AssemblyInfoFile | |
open Fake.Git | ||
open Fake.ReleaseNotesHelper | ||
|
||
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__ | ||
|
||
// Information about the project to be used at NuGet and in AssemblyInfo files | ||
let project = "FSharp.Formatting" | ||
let projectTool = "FSharp.Formatting.CommandTool" | ||
|
@@ -97,14 +97,29 @@ Target "UpdateFsxVersions" (fun _ -> | |
// -------------------------------------------------------------------------------------- | ||
// Build library | ||
|
||
//Target "Build" (fun _ -> | ||
// { BaseDirectory = __SOURCE_DIRECTORY__ | ||
// Includes = ["FSharp.Formatting.sln"] | ||
// Excludes = [] } | ||
// |> MSBuildRelease "" "Build" | ||
// |> ignore | ||
//) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we enable this later? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nah, forgot to delete it |
||
|
||
let solutionFile = "FSharp.Formatting.sln" | ||
|
||
|
||
let msbuild14 = ProgramFilesX86</>"MSBuild"</>"14.0"</>"Bin"</>"MSBuild.exe" | ||
|
||
if isWindows && fileExists msbuild14 then | ||
setEnvironVar "MSBUILD" msbuild14 | ||
|
||
Target "Build" (fun _ -> | ||
{ BaseDirectory = __SOURCE_DIRECTORY__ | ||
Includes = ["FSharp.Formatting.sln"] | ||
Excludes = [] } | ||
!! solutionFile | ||
|> MSBuildRelease "" "Rebuild" | ||
|> ignore | ||
) | ||
|
||
|
||
Target "MergeVSPowerTools" (fun _ -> | ||
() (* | ||
let binDir = __SOURCE_DIRECTORY__ @@ "bin" | ||
|
@@ -137,34 +152,36 @@ Target "BuildTests" (fun _ -> | |
{ BaseDirectory = __SOURCE_DIRECTORY__ | ||
Includes = ["FSharp.Formatting.sln"] | ||
Excludes = [] } | ||
|> MSBuildRelease "" "Rebuild" | ||
|> MSBuildRelease "" "Build" | ||
|> ignore | ||
|
||
{ BaseDirectory = __SOURCE_DIRECTORY__ | ||
Includes = ["tests/*/files/FsLib/FsLib.sln"] | ||
Excludes = [] } | ||
|> MSBuildDebug "" "Rebuild" | ||
|> MSBuildDebug "" "Build" | ||
|> ignore | ||
|
||
{ BaseDirectory = __SOURCE_DIRECTORY__ | ||
Includes = ["tests/*/files/crefLib/crefLib.sln"] | ||
Excludes = [] } | ||
|> MSBuildDebug "" "Rebuild" | ||
|> MSBuildDebug "" "Build" | ||
|> ignore | ||
|
||
{ BaseDirectory = __SOURCE_DIRECTORY__ | ||
Includes = ["tests/*/files/csharpSupport/csharpSupport.sln"] | ||
Excludes = [] } | ||
|> MSBuildDebug "" "Rebuild" | ||
|> MSBuildDebug "" "Build" | ||
|> ignore | ||
|
||
{ BaseDirectory = __SOURCE_DIRECTORY__ | ||
Includes = ["tests/*/files/TestLib/TestLib.sln"] | ||
Excludes = [] } | ||
|> MSBuildDebug "" "Rebuild" | ||
|> MSBuildDebug "" "Build" | ||
|> ignore | ||
) | ||
|
||
open Fake.Testing | ||
|
||
let testProjects = | ||
[ "FSharp.CodeFormat.Tests"; "FSharp.Literate.Tests"; | ||
"FSharp.Markdown.Tests"; "FSharp.MetadataFormat.Tests" ] | ||
|
@@ -177,12 +194,11 @@ for name in testProjects do | |
let taskName = sprintf "RunTest_%s" name | ||
Target taskName <| fun () -> | ||
!! (sprintf "tests/*/bin/Release/%s.dll" name) | ||
|> NUnit (fun p -> | ||
|> NUnit3 (fun p -> | ||
{ p with | ||
DisableShadowCopy = true | ||
ShadowCopy = true | ||
TimeOut = TimeSpan.FromMinutes 20. | ||
Framework = "4.0" | ||
OutputFile = "TestResults.xml" }) | ||
OutputDir = "TestResults.xml" }) | ||
taskName ==> "RunTests" |> ignore | ||
"BuildTests" ==> taskName |> ignore | ||
|
||
|
@@ -208,7 +224,7 @@ let RequireRange breakingPoint version = | |
|
||
Target "CopyFSharpCore" (fun _ -> | ||
// We need to include optdata and sigdata as well, we copy everything to be consistent | ||
for file in System.IO.Directory.EnumerateFiles("packages" @@ "FSharp.Core" @@ "lib" @@ "net40") do | ||
for file in System.IO.Directory.EnumerateFiles("packages" </> "FSharp.Core" </> "lib" </> "net40") do | ||
let source, dest = file, Path.Combine("bin", Path.GetFileName(file)) | ||
printfn "Copying %s to %s" source dest | ||
File.Copy(source, dest, true)) | ||
|
@@ -252,7 +268,7 @@ Target "NuGet" (fun _ -> | |
// -------------------------------------------------------------------------------------- | ||
// Generate the documentation | ||
|
||
let fakePath = "packages" @@ "FAKE" @@ "tools" @@ "FAKE.exe" | ||
let fakePath = "packages" </> "FAKE" </> "tools" </> "FAKE.exe" | ||
let fakeStartInfo script workingDirectory args fsiargs environmentVars = | ||
(fun (info: System.Diagnostics.ProcessStartInfo) -> | ||
info.FileName <- System.IO.Path.GetFullPath fakePath | ||
|
@@ -266,7 +282,7 @@ let fakeStartInfo script workingDirectory args fsiargs environmentVars = | |
setVar "GIT" Git.CommandHelper.gitPath | ||
setVar "FSI" fsiPath) | ||
|
||
let commandToolPath = "bin" @@ "fsformatting.exe" | ||
let commandToolPath = "bin" </> "fsformatting.exe" | ||
let commandToolStartInfo workingDirectory environmentVars args = | ||
(fun (info: System.Diagnostics.ProcessStartInfo) -> | ||
info.FileName <- System.IO.Path.GetFullPath commandToolPath | ||
|
@@ -364,15 +380,15 @@ let bootStrapDocumentationFiles () = | |
// If you came here from the nuspec file add your file. | ||
// If you add files here to make the CI happy add those files to the .nuspec file as well | ||
// TODO: INSTEAD build the nuspec file before generating the documentation and extract it... | ||
ensureDirectory (__SOURCE_DIRECTORY__ @@ "packages/FSharp.Formatting/lib/net40") | ||
ensureDirectory (__SOURCE_DIRECTORY__ </> "packages/FSharp.Formatting/lib/net40") | ||
let buildFiles = [ "CSharpFormat.dll"; "FSharp.CodeFormat.dll"; "FSharp.Literate.dll" | ||
"FSharp.Markdown.dll"; "FSharp.MetadataFormat.dll"; "RazorEngine.dll"; | ||
"System.Web.Razor.dll"; "FSharp.Formatting.Common.dll"; "FSharp.Formatting.Razor.dll" ] | ||
let bundledFiles = | ||
buildFiles | ||
|> List.map (fun f -> | ||
__SOURCE_DIRECTORY__ @@ sprintf "bin/%s" f, | ||
__SOURCE_DIRECTORY__ @@ sprintf "packages/FSharp.Formatting/lib/net40/%s" f) | ||
__SOURCE_DIRECTORY__ </> sprintf "bin/%s" f, | ||
__SOURCE_DIRECTORY__ </> sprintf "packages/FSharp.Formatting/lib/net40/%s" f) | ||
|> List.map (fun (source, dest) -> Path.GetFullPath source, Path.GetFullPath dest) | ||
for source, dest in bundledFiles do | ||
try | ||
|
@@ -459,15 +475,15 @@ Target "All" DoNothing | |
Target "DownloadPython" (fun _ -> | ||
if not isUnix then | ||
let w = new System.Net.WebClient() | ||
let zipFile = "temp"@@"cpython.zip" | ||
let zipFile = "temp"</>"cpython.zip" | ||
if File.Exists zipFile then File.Delete zipFile | ||
w.DownloadFile("https://www.python.org/ftp/python/3.5.1/python-3.5.1-embed-amd64.zip", zipFile) | ||
let cpython = "temp"@@"CPython" | ||
let cpython = "temp"</>"CPython" | ||
CleanDir cpython | ||
System.IO.Compression.ZipFile.ExtractToDirectory(zipFile, cpython) | ||
let cpythonStdLib = cpython@@"stdlib" | ||
let cpythonStdLib = cpython</>"stdlib" | ||
CleanDir cpythonStdLib | ||
System.IO.Compression.ZipFile.ExtractToDirectory(cpython@@"python35.zip", cpythonStdLib) | ||
System.IO.Compression.ZipFile.ExtractToDirectory(cpython</>"python35.zip", cpythonStdLib) | ||
) | ||
|
||
Target "CreateTestJson" (fun _ -> | ||
|
@@ -477,11 +493,11 @@ Target "CreateTestJson" (fun _ -> | |
|
||
let pythonExe, stdLib = | ||
if not isUnix then | ||
System.IO.Path.GetFullPath ("temp"@@"CPython"@@"python.exe"), | ||
System.IO.Path.GetFullPath ("temp"@@"CPython"@@"stdlib") | ||
System.IO.Path.GetFullPath ("temp"</>"CPython"</>"python.exe"), | ||
System.IO.Path.GetFullPath ("temp"</>"CPython"</>"stdlib") | ||
else "python", "" | ||
|
||
let resultFile = "temp"@@"commonmark-tests.json" | ||
let resultFile = "temp"</>"commonmark-tests.json" | ||
if File.Exists resultFile then File.Delete resultFile | ||
( use fileStream = new StreamWriter(File.Open(resultFile, System.IO.FileMode.Create)) | ||
executeHelper | ||
|
@@ -499,7 +515,7 @@ Target "CreateTestJson" (fun _ -> | |
setVar "MSBuild" msBuildExe | ||
setVar "GIT" Git.CommandHelper.gitPath | ||
setVar "FSI" fsiPath)) | ||
File.Copy(resultFile, "tests"@@"commonmark_spec.json") | ||
File.Copy(resultFile, "tests"</>"commonmark_spec.json") | ||
) | ||
|
||
"Clean" ==> "AssemblyInfo" ==> "Build" ==> "BuildTests" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
source http://nuget.org/api/v2 | ||
source https://api.nuget.org/v3/index.json | ||
source https://nuget.org/api/v2 | ||
redirects: on | ||
|
||
nuget FSharp.Data | ||
nuget FAKE | ||
nuget CommandLineParser | ||
nuget FSharp.Core | ||
nuget FSharp.Core 4.0.0.1 redirects:force | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume upgrading this did lead to errors (same as FSharp.Compiler.Service)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there were some binding redirect issues that popped up like NUnit was the problem initially
I didn't upgrade FCS though |
||
nuget Microsoft.AspNet.Razor | ||
nuget RazorEngine | ||
nuget NUnit ~> 2 | ||
nuget NUnit.Runners ~> 2 | ||
nuget RazorEngine 3.9.3 framework: net45 | ||
nuget NuGet.CommandLine | ||
nuget FSharp.Compiler.Service == 2.0.0.6 | ||
nuget FSharp.Compiler.Service 2.0.0.6 | ||
// See http://fsprojects.github.io/Paket/nuget-dependencies.html | ||
// This basically means we need the lowest version for its dependencies (FSharp.Compiler.Service) | ||
// Otherwise we get runtime errors without binding redirects | ||
|
@@ -20,3 +19,12 @@ nuget FSharpVSPowerTools.Core !>= 0 | |
nuget ILRepack | ||
|
||
github matthid/Yaaf.FSharp.Scripting src/source/Yaaf.FSharp.Scripting/YaafFSharpScripting.fs | ||
|
||
group Test | ||
source https://api.nuget.org/v3/index.json | ||
redirects: on | ||
|
||
nuget FSharp.Core 4.0.0.1 redirects:force | ||
nuget FsUnit 3.0.0 framework:net45 | ||
nuget NUnit | ||
nuget NUnit.Console |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering... Does this need to be on top now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally setting the directory should be the first thing that you do, i changed the way it's done because the old environment way doesn't work on netcore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think after opening the namespaces works as well and makes the code shorter :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have to load the packages before you can open the namespaces, you need to set the dir if you want to load the packages properly, this is to account for the weird working dir that fsi is set to automatically when you use it in VS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest I don't even remember why its needed (I'm pretty sure the author of this). Now you are :)