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 inconsistent naming of MSBuild package, add setParams to run* methods #1837

Merged
merged 4 commits into from
Apr 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Fake.sln
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.AssemblyInfoFil
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Cli", "src/app/Fake.DotNet.Cli/Fake.DotNet.Cli.fsproj", "{B2C0063A-FC66-4883-BB69-B1DBE6BF9CA2}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.MsBuild", "src/app/Fake.DotNet.MsBuild/Fake.DotNet.MsBuild.fsproj", "{64195C50-E138-4218-A7CE-13CD4565B87E}"
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.MSBuild", "src/app/Fake.DotNet.MSBuild/Fake.DotNet.MSBuild.fsproj", "{64195C50-E138-4218-A7CE-13CD4565B87E}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.NuGet", "src/app/Fake.DotNet.NuGet/Fake.DotNet.NuGet.fsproj", "{93F1A71E-54E2-4C65-BB1E-1D499890317F}"
EndProject
Expand Down
20 changes: 12 additions & 8 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ nuget Fake.IO.FileSystem prerelease
nuget Fake.IO.Zip prerelease
nuget Fake.Core.ReleaseNotes prerelease
nuget Fake.DotNet.AssemblyInfoFile prerelease
nuget Fake.DotNet.MsBuild prerelease
nuget Fake.DotNet.MSBuild prerelease
nuget Fake.DotNet.Cli prerelease
nuget Fake.DotNet.NuGet prerelease
nuget Fake.DotNet.Paket prerelease
Expand Down Expand Up @@ -176,7 +176,7 @@ Target.create "Clean" (fun _ ->

// Workaround https://github.com/fsprojects/Paket/issues/2830
// https://github.com/fsprojects/Paket/issues/2689
// Basically paket fails if there is already an existing nuspec in obj/ dir because then MsBuild will call paket with multiple nuspec file arguments separated by ';'
// Basically paket fails if there is already an existing nuspec in obj/ dir because then MSBuild will call paket with multiple nuspec file arguments separated by ';'
!! "src/*/*/obj/**/*.nuspec"
-- (sprintf "src/*/*/obj/**/*%s.nuspec" release.NugetVersion)
//-- "src/*/*/obj/*.references"
Expand Down Expand Up @@ -267,7 +267,7 @@ let dotnetAssemblyInfos =
"Fake.Core.Xml", "Core Xml functionality"
"Fake.DotNet.AssemblyInfoFile", "Writing AssemblyInfo files"
"Fake.DotNet.Cli", "Running the dotnet cli"
"Fake.DotNet.MsBuild", "Running msbuild"
"Fake.DotNet.MSBuild", "Running msbuild"
"Fake.DotNet.NuGet", "Running NuGet Client and interacting with NuGet Feeds"
"Fake.DotNet.Paket", "Running Paket and publishing packages"
"Fake.DotNet.FSFormatting", "Running fsformatting.exe and generating documentation"
Expand Down Expand Up @@ -349,7 +349,11 @@ Target.create "UnskipAndRevertAssemblyInfo" (fun _ ->
)

Target.create "BuildSolution_" (fun _ ->
#if BOOTSTRAP
MSBuild.runWithDefaults "Build" ["./src/Legacy-FAKE.sln"; "./src/Legacy-FAKE.Deploy.Web.sln"]
#else
MsBuild.runWithDefaults "Build" ["./src/Legacy-FAKE.sln"; "./src/Legacy-FAKE.Deploy.Web.sln"]
#endif
|> Trace.logItems "AppBuild-Output: "
)

Expand Down Expand Up @@ -721,10 +725,10 @@ Target.create "DotNetPackage_" (fun _ ->
{ c with
Configuration = DotNet.Release
OutputPath = Some nugetDir
Common =
Common =
if CircleCi.isCircleCi then
{ c.Common with CustomParams = Some "/m:1" }
else c.Common
else c.Common
} |> dtntSmpl) "Fake.sln"

let info = DotNet.info dtntSmpl
Expand Down Expand Up @@ -956,13 +960,13 @@ Target.create "FastRelease" (fun _ ->
| s when not (System.String.IsNullOrWhiteSpace s) -> s
| _ -> failwith "please set the github_token environment variable to a github personal access token with repro access."

let files =
let files =
runtimes @ [ "portable"; "packages" ]
|> List.map (fun n -> sprintf "nuget/dotnetcore/Fake.netcore/fake-dotnetcore-%s.zip" n)

GitHub.createClientWithToken token
|> GitHub.draftNewRelease gitOwner gitName release.NugetVersion (release.SemVer.PreRelease <> None) release.Notes
|> GitHub.uploadFiles files
|> GitHub.uploadFiles files
|> GitHub.publishDraft
|> Async.RunSynchronously
)
Expand Down
20 changes: 10 additions & 10 deletions help/markdown/core-targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ nuget Fake.Core.Target //"
open Fake.Core

// *** Define Targets ***
Target.create "Clean" (fun _ ->
Target.create "Clean" (fun _ ->
Trace.trace " --- Cleaning stuff --- "
)

Target.create "Build" (fun _ ->
Target.create "Build" (fun _ ->
Trace.trace " --- Building the app --- "
)

Target.create "Deploy" (fun _ ->
Target.create "Deploy" (fun _ ->
Trace.trace " --- Deploying app --- "
)

Expand Down Expand Up @@ -58,7 +58,7 @@ Now we have the following options:

## Final targets

Final targets can be used for TearDown functionality.
Final targets can be used for TearDown functionality.
These targets will be executed even if the build fails but have to be activated via Target.ActivateFinal().

```fsharp
Expand Down Expand Up @@ -96,7 +96,7 @@ still be exectued in order.
### Setting the number of threads

The number of threads used can be set using the environment variable ``parallel-jobs``.
This can be achieved in various ways where the easiest one is to use FAKE's built-in support for
This can be achieved in various ways where the easiest one is to use FAKE's built-in support for
setting environment variables:

``fake *YourBuildScript* -e parallel-jobs 8``
Expand Down Expand Up @@ -140,34 +140,34 @@ For example this dependency tree:

![](pics/parallel/ParallelExample.png)

This is in addition to that that MsBuild may use multiple threads when building one solution having multiple independent project-files.
This is in addition to that that MSBuild may use multiple threads when building one solution having multiple independent project-files.

# Soft dependencies

Typically you will define dependencies among your targets using the `==>` and `<==` operators, and these
dependencies define the order in which the targets are executed during a build.

You can also define soft dependencies among targets using the `?=>` and `<=?` operators. For example, you might
say that target B has a soft dependency on target A:
say that target B has a soft dependency on target A:

```fsharp
"A" ?=> "B"
// Or equivalently
"B" <=? "A"
```

With this soft dependency, running B will not require that A be run first. However it does mean that *if* A is run
With this soft dependency, running B will not require that A be run first. However it does mean that *if* A is run
(due to other dependencies) it must be run before B.

## Example

```fsharp
// *** Define Targets ***
Target.create "Clean" (fun _ ->
Target.create "Clean" (fun _ ->
Trace.trace " --- Cleaning stuff --- "
)

Target.create "Build" (fun _ ->
Target.create "Build" (fun _ ->
Trace.trace " --- Building the app --- "
)

Expand Down
6 changes: 3 additions & 3 deletions help/markdown/dotnet-assemblyinfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ If you succeeded with the [Getting Started tutorial](gettingstarted.html), then
```fsharp
#r "paket:
nuget Fake.DotNet.AssemblyInfo
nuget Fake.DotNet.MsBuild
nuget Fake.DotNet.MSBuild
nuget Fake.Core.Target //"
open Fake.DotNet

Expand All @@ -30,7 +30,7 @@ Target.Create "BuildApp" (fun _ ->
AssemblyInfo.Version version
AssemblyInfo.FileVersion version]

MsBuild.RunRelease buildDir "Build" appReferences
MSBuild.RunRelease buildDir "Build" appReferences
|> Log "AppBuild-Output: "
)
```
Expand Down Expand Up @@ -73,7 +73,7 @@ One of the easiest ways to retrieve this hash is to load use a reflector program

## Using the SolutionInfo approach

Some companies split their AssemblyInfo into a SolutionInfo.cs which is shared by all projects and a specific AssemblyInfo per project which contains the product data.
Some companies split their AssemblyInfo into a SolutionInfo.cs which is shared by all projects and a specific AssemblyInfo per project which contains the product data.
All versioning data is generated by the AssemblyInfo task into the SolutionInfo.cs and the AssemblyInfo files are edited manually. This could look like this:

![alt text](pics/assemblyinfo/solutioninfo.png "SolutionInfo.cs is shared between projects")
Expand Down
20 changes: 10 additions & 10 deletions help/markdown/fake-gettingstarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,15 @@ In the dependencies section we say that the *Default* target has a dependency on

In the next step we want to compile our C# libraries, which means we want to compile all csproj-files under */src/app* with MSBuild.

Again we need some new module for this, namely `Fake.DotNet.MsBuild`.
Again we need some new module for this, namely `Fake.DotNet.MSBuild`.

Just like before add the required module on top via `nuget Fake.DotNet.MsBuild`, delete the `build.fsx.lock` file and run the script.
Just like before add the required module on top via `nuget Fake.DotNet.MSBuild`, delete the `build.fsx.lock` file and run the script.
Now edit the script like this:

```fsharp
#r "paket:
nuget Fake.IO.FileSystem
nuget Fake.DotNet.MsBuild
nuget Fake.DotNet.MSBuild
nuget Fake.Core.Target //"
#load "./.fake/build.fsx/intellisense.fsx"

Expand All @@ -186,7 +186,7 @@ Target.create "Clean" (fun _ ->

Target.create "BuildApp" (fun _ ->
!! "src/app/**/*.csproj"
|> MsBuild.runRelease buildDir "Build"
|> MSBuild.runRelease buildDir "Build"
|> Trace.Log "AppBuild-Output: "
)

Expand Down Expand Up @@ -221,7 +221,7 @@ Now our main application will be built automatically and it's time to build the
```fsharp
#r "paket:
nuget Fake.IO.FileSystem
nuget Fake.DotNet.MsBuild
nuget Fake.DotNet.MSBuild
nuget Fake.Core.Target //"
#load "./.fake/build.fsx/intellisense.fsx"

Expand All @@ -243,13 +243,13 @@ Target.create "Clean" (fun _ ->

Target.create "BuildApp" (fun _ ->
!! "src/app/**/*.csproj"
|> MsBuild.runRelease buildDir "Build"
|> MSBuild.runRelease buildDir "Build"
|> Trace.logItems "AppBuild-Output: "
)

Target.create "BuildTest" (fun _ ->
!! "src/test/**/*.csproj"
|> MsBuild.runDebug testDir "Build"
|> MSBuild.runDebug testDir "Build"
|> Trace.logItems "TestBuild-Output: "
)

Expand All @@ -276,7 +276,7 @@ Now all our projects will be compiled and we can use FAKE's NUnit task in order
```fsharp
#r "paket:
nuget Fake.IO.FileSystem
nuget Fake.DotNet.MsBuild
nuget Fake.DotNet.MSBuild
nuget Fake.DotNet.Testing.NUnit
nuget Fake.Core.Target //"
#load "./.fake/myscript.fsx/intellisense.fsx"
Expand All @@ -298,13 +298,13 @@ Target.create "Clean" (fun _ ->

Target.create "BuildApp" (fun _ ->
!! "src/app/**/*.csproj"
|> MsBuild.runRelease buildDir "Build"
|> MSBuild.runRelease buildDir "Build"
|> Trace.logItems "AppBuild-Output: "
)

Target.create "BuildTest" (fun _ ->
!! "src/test/**/*.csproj"
|> MsBuild.runDebug testDir "Build"
|> MSBuild.runDebug testDir "Build"
|> Trace.logItems "TestBuild-Output: "
)

Expand Down
34 changes: 17 additions & 17 deletions help/markdown/legacy-core-targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ FAKE has a special param "target" which can be used to run specific targets in a
// include Fake libs
#I @"tools\FAKE"
#r "FakeLib.dll"
open Fake
open Fake

// *** Define Targets ***
Target "Clean" (fun () ->
Target "Clean" (fun () ->
trace " --- Cleaning stuff --- "
)

Target "Build" (fun () ->
Target "Build" (fun () ->
trace " --- Building the app --- "
)

Target "Deploy" (fun () ->
Target "Deploy" (fun () ->
trace " --- Deploying app --- "
)

Expand All @@ -50,7 +50,7 @@ Now we have the following options:

## Final targets

Final targets can be used for TearDown functionality.
Final targets can be used for TearDown functionality.
These targets will be executed even if the build fails but have to be activated via ActivateFinalTarget().

FinalTarget "CloseSomePrograms" (fun _ ->
Expand Down Expand Up @@ -83,7 +83,7 @@ the build script contains a call like this:

```
RunTargetOrDefault "Default"
```
```

### Example

Expand Down Expand Up @@ -118,7 +118,7 @@ still be exectued in order.

## Setting the number of threads
The number of threads used can be set using the environment variable ``parallel-jobs``.
This can be achieved in various ways where the easiest one is to use FAKE's built-in support for
This can be achieved in various ways where the easiest one is to use FAKE's built-in support for
setting environment variables:

``FAKE.exe *YourBuildScript* "parallel-jobs=8"``
Expand All @@ -137,7 +137,7 @@ However when a fast build is desired (and the project is e.g. known to build suc

When using this parallel option, Fake resolves the build dependency hierearchies from the described paths and builds independend paths as parallel if you have multiple CPUs available.
For example this dependency tree:

"Task 1"
==> "Task A2"
==> "Task 3"
Expand All @@ -158,14 +158,14 @@ For example this dependency tree:

![](pics/parallel/ParallelExample.png)

This is in addition to that that MsBuild may use multiple threads when building one solution having multiple independent project-files.
This is in addition to that that MSBuild may use multiple threads when building one solution having multiple independent project-files.


# Writing custom C# tasks for FAKE

**Note: This documentation is for FAKE.exe before version 5 (or the non-netcore version). The documentation needs te be updated, please help! **

"FAKE - F# Make" is intended to be an extensible build framework and therefor it should be as easy as possible to create custom tasks.
"FAKE - F# Make" is intended to be an extensible build framework and therefor it should be as easy as possible to create custom tasks.
This tutorial shows how to create a (very simple) custom task in C#.

## Creating a custom task
Expand Down Expand Up @@ -198,7 +198,7 @@ Compile the project and put the generated assembly into the *tools/FAKE* path of

// include CustomTask
#r "MyCustomTask.dll"
open Fake
open Fake

// open CustomNamespace
open MyCustomTask
Expand All @@ -212,27 +212,27 @@ If you want to use FAKE's standard functionality (like [globbing](http://en.wiki

# Soft dependencies

Typically you will define dependencies among your targets using the `==>` and `<==` operators, and these
Typically you will define dependencies among your targets using the `==>` and `<==` operators, and these
dependencies define the order in which the targets are executed during a build.

You can also define soft dependencies among targets using the `?=>` and `<=?` operators. For example, you might
say that target B has a soft dependency on target A:
say that target B has a soft dependency on target A:

"A" ?=> "B"
// Or equivalently
"B" <=? "A"

With this soft dependency, running B will not require that A be run first. However it does mean that *if* A is run
With this soft dependency, running B will not require that A be run first. However it does mean that *if* A is run
(due to other dependencies) it must be run before B.

## Example

// *** Define Targets ***
Target "Clean" (fun () ->
Target "Clean" (fun () ->
trace " --- Cleaning stuff --- "
)

Target "Build" (fun () ->
Target "Build" (fun () ->
trace " --- Building the app --- "
)

Expand Down
4 changes: 2 additions & 2 deletions help/templates/template.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
<ul>
<li><a href="@(prefix)dotnet-cli.html">Cli</a></li>
<li><a href="@(prefix)dotnet-assemblyinfo.html">AssemblyInfoFile</a></li>
<li><a href="@(prefix)apidocs/fake-dotnet-msbuild.html">MsBuild</a></li>
<li><a href="@(prefix)apidocs/fake-dotnet-msbuild.html">MSBuild</a></li>
<li><a href="@(prefix)apidocs/fake-dotnet-testing-nunit3.html">Testing - NUnit</a></li>
<li><a href="@(prefix)apidocs/fake-dotnet-testing-mspec.html">Testing - MSpec</a></li>
<li><a href="@(prefix)apidocs/fake-dotnet-testing-xunit2.html">Testing - XUnit2</a></li>
Expand Down Expand Up @@ -224,7 +224,7 @@
</ul>
</section>

<!-- Links
<!-- Links
<section>
<h2>Learn F#</h2>
<ul class="divided">
Expand Down
Loading