Skip to content
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

Fix performance #1694

Merged
merged 26 commits into from
Oct 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
374d314
Split FileUtils in two files and remove allFiles function (returns tr…
devcrafting Sep 19, 2017
09cff4c
Separate modules FileInfo, FileSystemInfo, Operators
devcrafting Sep 19, 2017
42e4ddd
Adjust fsproj and remove FileFilter use
devcrafting Sep 19, 2017
b204d63
Split Directory module in its own file
devcrafting Sep 19, 2017
76c584d
Split DirectoryInfo into its own file, leaving File alone (then renam…
devcrafting Sep 19, 2017
5cfe171
Add Obsolete for all DirectoryInfo module functions
devcrafting Sep 19, 2017
beb7e53
Propose additional design guidelines on consistent naming/casing
devcrafting Sep 22, 2017
9eac867
Normalize and add Obsolete for Directory module
devcrafting Sep 25, 2017
8be5e66
Fix tests (switched 2 parameters when removing duplicate functions in…
devcrafting Sep 26, 2017
20f7d25
Normalize naming and add Obsolete for File module
devcrafting Sep 26, 2017
cce4762
Fix build waiting releas of breaking changes
devcrafting Sep 26, 2017
8d293b8
Fix failed build on BootstrapTest
devcrafting Sep 27, 2017
13a8c33
Use new API in build.fsx
devcrafting Sep 27, 2017
c5f963b
update contributing.md
matthid Sep 30, 2017
6b384f6
release notes
matthid Sep 30, 2017
a708f21
new paket version
matthid Oct 1, 2017
3582e9d
paket update
matthid Oct 1, 2017
c6e1fe0
fix performance by upgrading paket and compile new scripts for netcor…
matthid Oct 1, 2017
8a3aae9
Merge branch 'feature/io-filesystem-rework' of https://github.com/dev…
matthid Oct 1, 2017
55b0042
move Fake.IO.FileSystem into Fake.IO namespace.
matthid Oct 1, 2017
8503683
fix compilation
matthid Oct 1, 2017
4ec4bc0
fix compilation
matthid Oct 1, 2017
d4a2422
fix some stuff
matthid Oct 1, 2017
2ca61ce
doc.
matthid Oct 1, 2017
9b5b175
failure
matthid Oct 2, 2017
eb1bda9
use NETStandard.Library for netstandard20 references.
matthid Oct 2, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ tools/SourceLink.Fake

release.cmd
release.sh
*.pfx
Samples/typescript/out/
help/markdown/RELEASE_NOTES.md
paket.exe
Expand Down
5 changes: 5 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#### 5.0.0-beta004 - 30.09.2017
* BUILD: Remove hardcoded paths to FSharpTargets, replace with FSharp.Compiler.Tools - https://github.com/fsharp/FAKE/pull/1693
* ENHANCEMENT: Fake.IO.FileSystem Rework, functionality moved from `Fake.IO.FileSystem` to `Fake.IO` and APIs have been adapted to the new design guideline - https://github.com/fsharp/FAKE/pull/1670
* PERFORMANCE: Fake should be a lot faster now - https://github.com/fsharp/FAKE/pull/1694

#### 5.0.0-beta003 - 26.09.2017
* ENHANCEMENT: Fix some migration warnings, Docs and bugs - https://github.com/fsharp/FAKE/pull/1686

Expand Down
103 changes: 69 additions & 34 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

open System.Reflection

// Remove '#load' once released
#load "src/app/Fake.DotNet.AssemblyInfoFile/AssemblyInfoFile.fs"

#else
// Load this before FakeLib, see https://github.com/fsharp/FSharp.Compiler.Service/issues/763
#r "packages/Mono.Cecil/lib/net40/Mono.Cecil.dll"
Expand All @@ -25,12 +22,21 @@ open System.Reflection

#endif

// TODO Remove '#load' once released
#load "src/app/Fake.IO.FileSystem/Path.fs"
#load "src/app/Fake.IO.FileSystem/FileInfo.fs"
#load "src/app/Fake.IO.FileSystem/FileSystemOperators.fs"
#load "src/app/Fake.IO.FileSystem/DirectoryInfo.fs"
#load "src/app/Fake.IO.FileSystem/File.fs"
#load "src/app/Fake.IO.FileSystem/Directory.fs"
#load "src/app/Fake.IO.FileSystem/FileSystemInfo.fs"
#load "src/app/Fake.IO.FileSystem/Shell.fs"

open System.IO
open Fake.Core
open Fake.Tools
open Fake.IO
open Fake.IO.FileSystem
open Fake.IO.FileSystem.Operators
open Fake.IO.FileSystemOperators
open Fake.Core.Globbing.Operators
open Fake.Windows
open Fake.DotNet
Expand Down Expand Up @@ -120,7 +126,7 @@ Target.Create "Clean" (fun _ ->
//-- "src/*/*/obj/*.props"
//-- "src/*/*/obj/*.paket.references.cached"
//-- "src/*/*/obj/*.NuGet.Config"
|> File.DeleteFiles
|> File.deleteAll

Shell.CleanDirs [buildDir; testDir; docsDir; apidocsDir; nugetDncDir; nugetLegacyDir; reportDir]

Expand All @@ -134,7 +140,7 @@ Target.Create "RenameFSharpCompilerService" (fun _ ->
for framework in ["netstandard1.6"; "net45"] do
let dir = __SOURCE_DIRECTORY__ </> "packages"</>packDir</>"lib"</>framework
let targetFile = dir </> "FAKE.FSharp.Compiler.Service.dll"
File.DeleteFile targetFile
File.delete targetFile

#if DOTNETCORE
let reader =
Expand Down Expand Up @@ -270,7 +276,7 @@ Target.Create "UnskipAndRevertAssemblyInfo" (fun _ ->
Git.CommandHelper.directRunGitCommandAndFail "." (sprintf "checkout HEAD %s" assemblyFile)
)

Target.Create "BuildSolution" (fun _ ->
Target.Create "BuildSolution_" (fun _ ->
MsBuild.MSBuildWithDefaults "Build" ["./FAKE.sln"; "./FAKE.Deploy.Web.sln"]
|> Trace.Log "AppBuild-Output: "
)
Expand All @@ -293,8 +299,8 @@ Target.Create "GenerateDocs" (fun _ ->
let layoutroots = [ "./help/templates"; "./help/templates/reference" ]

Shell.CopyDir (docsDir) "help/content" FileFilter.allFiles
File.WriteStringToFile false "./docs/.nojekyll" ""
File.WriteStringToFile false "./docs/CNAME" "fake.build"
File.writeString false "./docs/.nojekyll" ""
File.writeString false "./docs/CNAME" "fake.build"
//CopyDir (docsDir @@ "pics") "help/pics" FileFilter.allFiles

Shell.Copy (source @@ "markdown") ["RELEASE_NOTES.md"]
Expand Down Expand Up @@ -331,7 +337,7 @@ Target.Create "GenerateDocs" (fun _ ->
-- "./build/**/Fake.IIS.dll"
-- "./build/**/Fake.Deploy.Lib.dll"

Shell.ensureDirectory apidocsDir
Directory.ensure apidocsDir
dllFiles
|> FSFormatting.CreateDocsForDlls (fun s ->
{ s with
Expand Down Expand Up @@ -376,7 +382,7 @@ Target.Create "BootstrapTest" (fun _ ->
let buildScript = "build.fsx"
let testScript = "testbuild.fsx"
// Check if we can build ourself with the new binaries.
let test clearCache script =
let test clearCache (script:string) =
let clear () =
// Will make sure the test call actually compiles the script.
// Note: We cannot just clean .fake here as it might be locked by the currently executing code :)
Expand Down Expand Up @@ -482,7 +488,7 @@ Target.Create "SourceLink" (fun _ ->
)

Target.Create "ILRepack" (fun _ ->
Directory.CreateDir buildMergedDir
Directory.ensure buildMergedDir

let internalizeIn filename =
let toPack =
Expand All @@ -503,7 +509,7 @@ Target.Create "ILRepack" (fun _ ->
internalizeIn "FAKE.exe"

!! (buildDir </> "FSharp.Compiler.Service.**")
|> Seq.iter File.DeleteFile
|> Seq.iter File.delete

Shell.DeleteDir buildMergedDir
)
Expand Down Expand Up @@ -536,7 +542,7 @@ Target.Create "CreateNuGet" (fun _ ->
Shell.CleanDir nugetLibDir
Shell.DeleteDir nugetLibDir

File.DeleteFile "./build/FAKE.Gallio/Gallio.dll"
File.delete "./build/FAKE.Gallio/Gallio.dll"

let deleteFCS _ =
//!! (dir </> "FSharp.Compiler.Service.**")
Expand Down Expand Up @@ -564,7 +570,7 @@ Target.Create "CreateNuGet" (fun _ ->
| _ ->
Shell.CopyDir nugetToolsDir (buildDir @@ package) FileFilter.allFiles
Shell.CopyTo nugetToolsDir additionalFiles
!! (nugetToolsDir @@ "*.srcsv") |> File.DeleteFiles
!! (nugetToolsDir @@ "*.srcsv") |> File.deleteAll

let setParams (p:NuGet.NuGet.NuGetParams) =
{p with
Expand Down Expand Up @@ -608,6 +614,7 @@ let appDir = srcDir</>"app"

let netCoreProjs =
!! "src/app/Fake.Core.*/*.fsproj"
++ "src/app/Fake.Api.*/*.fsproj"
++ "src/app/Fake.DotNet.*/*.fsproj"
++ "src/app/Fake.Windows.*/*.fsproj"
++ "src/app/Fake.IO.*/*.fsproj"
Expand All @@ -627,7 +634,7 @@ Target.Create "DotnetRestore" (fun _ ->
// Workaround bug where paket integration doesn't generate
// .nuget\packages\.tools\dotnet-compile-fsc\1.0.0-preview2-020000\netcoreapp1.0\dotnet-compile-fsc.deps.json
let t = Path.GetFullPath "workaround"
Shell.ensureDirectory t
Directory.ensure t
Cli.Dotnet { Cli.DotnetOptions.Default with WorkingDirectory = t } "new console --language f#"
|> ignore
Cli.Dotnet { Cli.DotnetOptions.Default with WorkingDirectory = t } "restore"
Expand All @@ -640,7 +647,7 @@ Target.Create "DotnetRestore" (fun _ ->
!! "lib/nupgks/**/*.nupkg"
|> Seq.iter (fun file ->
let dir = nugetDncDir //@@ "dotnetcore"
Shell.ensureDirectory dir
Directory.ensure dir
File.Copy(file, dir @@ Path.GetFileName file, true))

let result = Cli.Dotnet { Cli.DotnetOptions.Default with WorkingDirectory = root } "sln src/Fake-netcore.sln list"
Expand Down Expand Up @@ -722,6 +729,7 @@ Target.Create "DotnetPackage" (fun _ ->
Framework = Some "netcoreapp2.0"
OutputPath = Some outDir
}) netcoreFsproj

)

Target.Create "DotnetCoreCreateZipPackages" (fun _ ->
Expand All @@ -742,7 +750,7 @@ Target.Create "DotnetCoreCreateZipPackages" (fun _ ->

Target.Create "DotnetCoreCreateChocolateyPackage" (fun _ ->
// !! ""
Shell.ensureDirectory "nuget/dotnetcore/chocolatey"
Directory.ensure "nuget/dotnetcore/chocolatey"
Choco.PackFromTemplate (fun p ->
{ p with
PackageId = "fake"
Expand Down Expand Up @@ -941,49 +949,76 @@ Target.Create "EnsureTestsRun" (fun _ ->
Target.Create "Default" ignore
Target.Create "StartDnc" ignore
Target.Create "Release" ignore
Target.Create "BuildSolution" ignore
Target.Create "AfterBuild" ignore

open Fake.Core.TargetOperators


// DotNet Core Build
"Clean"
==> "StartDnc"
?=> "StartDnc"
==> "InstallDotnetCore"
==> "DownloadPaket"
//==> "DotnetRestore"
==> "DotnetPackage"

// Dependencies
// Full framework build
"Clean"
==> "RenameFSharpCompilerService"
?=> "RenameFSharpCompilerService"
==> "SetAssemblyInfo"
==> "BuildSolution"
==> "DotnetPackage"
==> "BuildSolution_"
==> "UnskipAndRevertAssemblyInfo"
==> "DotnetCoreCreateZipPackages"
=?> ("TestDotnetCore", not <| Environment.hasEnvironVar "SkipIntegrationTests" && not <| Environment.hasEnvironVar "SkipTests")
////==> "ILRepack"
=?> ("Test", not <| Environment.hasEnvironVar "SkipTests")
=?> ("BootstrapTest",not <| Environment.hasEnvironVar "SkipTests")
=?> ("BootstrapTestDotnetCore",not <| Environment.hasEnvironVar "SkipTests")
//=?> ("SourceLink", isLocalBuild && not isLinux)
==> "BuildSolution"

// AfterBuild -> Both Builds completed
"BuildSolution"
==> "AfterBuild"
"DotnetPackage"
==> "AfterBuild"

// Create artifacts when build is finished
"AfterBuild"
=?> ("CreateNuGet", not Environment.isLinux)
==> "CopyLicense"
=?> ("DotnetCoreCreateChocolateyPackage", not Environment.isLinux)
=?> ("GenerateDocs", BuildServer.isLocalBuild && not Environment.isLinux)
==> "Default"

// Test the full framework build
"BuildSolution"
=?> ("Test", not <| Environment.hasEnvironVar "SkipTests")
=?> ("BootstrapTest",not <| Environment.hasEnvironVar "SkipTests")
==> "Default"

// Test the dotnetcore build
"DotnetPackage"
==> "DotnetCoreCreateZipPackages"
=?> ("TestDotnetCore", not <| Environment.hasEnvironVar "SkipIntegrationTests" && not <| Environment.hasEnvironVar "SkipTests")
=?> ("BootstrapTestDotnetCore",not <| Environment.hasEnvironVar "SkipTests")
==> "Default"

// Release stuff ('FastRelease' is to release after running 'Default')
"EnsureTestsRun"
=?> ("DotnetCorePushChocolateyPackage", not Environment.isLinux)
=?> ("ReleaseDocs", BuildServer.isLocalBuild && not Environment.isLinux)
==> "DotnetCorePushNuGet"
==> "PublishNuget"
==> "FastRelease"

// If 'Default' happens it needs to happen before 'EnsureTestsRun'
"Default"
?=> "EnsureTestsRun"

// A 'Default' includes a 'Clean'
"Clean"
==> "Default"

// A 'Release' includes a 'Default'
"Default"
==> "Release"
// A 'Release' includes a 'FastRelease'
"FastRelease"
==> "Release"
"Default"
?=> "EnsureTestsRun"

// start build
Target.RunOrDefault "Default"
13 changes: 12 additions & 1 deletion help/markdown/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ to automatically deploy a preconfigured virtual machine. See the [Vagrant docs](

> Note: The vagrant file might be outdated at this time, please help updating it and removing this banner.

* Ubuntu / Windows Subsystem for Linux:
- Install Mono, as of today 2017-09-30 you need at least alpha to have the msbuild package (http://www.mono-project.com/download/beta/#download-lin)
- `apt-get install msbuild mono-complete`
- `apt-cache search libunwind`
- `# apt-get Install the libunwind runtime (one of the search results)`
- `apt-cache search libcurl # Install`
- `# apt-get Install the libcurl library (one of the search results)`
- `./build.sh`

### Programming

* Checkout the `master` branch.
Expand Down Expand Up @@ -107,7 +116,9 @@ to automatically deploy a preconfigured virtual machine. See the [Vagrant docs](
We [learned from our mistakes](fake-fake5-learn-more.html), so we use the following guidelines, **please read them very carefully** (ask if you don't understand any rule):

- AutoOpen is no longer used
- we replace `<verb><module>` functions with `<module>.<verb>`
- We replace `<verb><module>` functions with `<module>.<verb>`
- Use Verbs as much as possible for functions
- In order, to have a more consistent API we propose to always use camelCase naming for functions
- We assume the caller is not opening the module but only the global namespaces `Fake.Core`, `Fake.IO`, ...
and make sure the code looks nice and structured on the caller side.
- For compatibility reasons (migration from legacy). We assume the user doesn't open the global `Fake` namespace.
Expand Down
7 changes: 5 additions & 2 deletions help/markdown/core-targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

**Note: This documentation is for FAKE 5. The old documentation can be found [here](legacy-core-targets.html)! **

[API-Reference](apidocs/fake-core-target.html), [Operators](apidocs/fake-core-targetoperators.html)

## Listing targets

Not jet available in FAKE 5
Not yet available in FAKE 5

> Note: This feature still makes sense, but a good CLI has not been found jet, please propose one.
> For not you can run the target with name '--listTargets' or '-lt'. `fake run build.fsx -t '--list-Targets'`
Expand All @@ -16,7 +18,6 @@ FAKE has a special param "target" which can be used to run specific targets in a
// include Fake modules, see Fake modules section

open Fake.Core
open Fake.Core.TargetOperators

// *** Define Targets ***
Target.Create "Clean" (fun _ ->
Expand All @@ -31,6 +32,8 @@ FAKE has a special param "target" which can be used to run specific targets in a
trace " --- Deploying app --- "
)

open Fake.Core.TargetOperators

// *** Define Dependencies ***
"Clean"
==> "Build"
Expand Down
6 changes: 6 additions & 0 deletions help/markdown/core.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Fake.Core

This namespace bundles some "core" modules which are useful in most scenarios where FAKE is used.

- [Targets](core-targets.html), [API-Reference](apidocs/fake-core-target.html), [Operators](apidocs/fake-core-targetoperators.html)
- To be continued...
2 changes: 1 addition & 1 deletion help/markdown/fake-fake5-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Requirements to modules

You can use any NuGet packages which are compatible with `netcore10`, for example all packages targeting `netstandard16` or lower.
You can use any NuGet packages which are compatible with `netcoreapp20`, for example all packages targeting `netstandard20` or lower.

## Declaring module dependencies

Expand Down
2 changes: 1 addition & 1 deletion help/templates/reference/module.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
var nestTypes = (IEnumerable<FSharp.MetadataFormat.Type>)Model.Module.NestedTypes;
}

<h1>@Model.Module.Name</h1>
<a name="@Model.Module.Name" class="anchor" href="#@Model.Module.Name"><h1>@Model.Module.Name</h1></a>
<div class="xmldoc">
@foreach (var sec in comment.Sections) {
// XML comment for the type has multiple sections that can be labelled
Expand Down
4 changes: 2 additions & 2 deletions help/templates/reference/namespaces.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
Title = "Namespaces - " + Properties["project-name"];
}

<h1>@Model.Name</h1>
<a name="@Model.Name" class="anchor" href="#@Model.Name"><h1>@Model.Name</h1></a>

@foreach (var ns in Model.Namespaces)
{
if (ns.Types.Length + ns.Modules.Length > 0)
{
<h2>@ns.Name Namespace</h2>
<a name="@ns.Name" class="anchor" href="#@ns.Name"><h2>@ns.Name Namespace</h2></a>
<div>
@RenderPart("part-nested", new {
Types = ns.Types,
Expand Down
2 changes: 1 addition & 1 deletion help/templates/reference/part-members.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@if (Enumerable.Count(Model.Members) > 0) {
<h3>@Model.Header</h3>
<a name="@Model.Header" class="anchor" href="#@Model.Header"><h3>@Model.Header</h3></a>
<table class="table table-bordered member-list">
<thead>
<tr><td>@Model.TableHeader</td><td>Description</td></tr>
Expand Down
2 changes: 1 addition & 1 deletion help/templates/reference/type.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
});
}

<h1>@Model.Type.Name</h1>
<a name="@Model.Type.Name" class="anchor" href="#@Model.Type.Name" ><h1>@Model.Type.Name</h1></a>
<div class="xmldoc">
@foreach (var sec in comment.Sections) {
// XML comment for the type has multiple sections that can be labelled
Expand Down
Loading