This repository has been archived by the owner on Oct 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac4e674
commit a7fe179
Showing
8 changed files
with
1,143 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
#r "paket: groupref FakeBuild //" | ||
#load "./.fake/build.fsx/intellisense.fsx" | ||
|
||
open Fake.IO | ||
open Fake.BuildServer | ||
open Fake.IO.Globbing.Operators | ||
open Fake.DotNet | ||
open Fake.DotNet.Testing.XUnit2 | ||
open Fake.Core | ||
open Fake.Tools | ||
|
||
BuildServer.install [ | ||
AppVeyor.Installer | ||
] | ||
|
||
let isAppveyor = AppVeyor.detect() | ||
let gitVersion = GitVersion.generateProperties id | ||
|
||
Target.create "Clean" (fun _ -> | ||
["reports" ; "src/common"] | ||
|> Seq.iter Directory.delete | ||
|
||
!! "nuget/*" | ||
-- "nuget/*.txt" | ||
-- "nuget/*.nuspec" | ||
|> File.deleteAll | ||
|
||
let configuration = | ||
(fun p -> { p with | ||
Properties = ["Configuration", "Release"] | ||
Verbosity = Some MSBuildVerbosity.Minimal }) | ||
|
||
!! "SonOfPicasso.sln" | ||
|> MSBuild.run configuration null "Clean" list.Empty | ||
|> Trace.logItems "Clean-Output: " | ||
) | ||
|
||
Target.create "Build" (fun _ -> | ||
CreateProcess.fromRawCommandLine "gitversion" "/updateassemblyinfo src\common\SharedAssemblyInfo.cs /ensureassemblyinfo" | ||
|> Proc.run | ||
|> ignore | ||
|
||
let configuration = (fun p -> { p with | ||
DoRestore = true | ||
Verbosity = Some MSBuildVerbosity.Minimal }) | ||
|
||
!! "SonOfPicasso.sln" | ||
|> MSBuild.runRelease configuration null "Build" | ||
|> Trace.logItems "AppBuild-Output: " | ||
) | ||
|
||
(* | ||
Target.create "Test" (fun _ -> | ||
List.allPairs ["BCC.Core.Tests"] ["net471" ; "netcoreapp2.1"] | ||
|> Seq.iter (fun (proj, framework) -> | ||
let projectPath = sprintf "src\\%s\\%s.csproj" proj proj | ||
let reportFile = sprintf "%s-%s.results.trx" proj framework | ||
let configuration: (DotNet.TestOptions -> DotNet.TestOptions) | ||
= (fun t -> {t with | ||
Configuration = DotNet.BuildConfiguration.Release | ||
NoBuild = true | ||
Framework = Some framework | ||
Logger = Some (sprintf "trx;LogFileName=%s" reportFile) | ||
ResultsDirectory = Some "../../reports"}) | ||
DotNet.test configuration projectPath | ||
Trace.publish ImportData.BuildArtifact (sprintf "reports/%s" reportFile) | ||
) | ||
) | ||
Target.create "Coverage" (fun _ -> | ||
List.allPairs ["BCC.Core.Tests"] ["net471" ; "netcoreapp2.1"] | ||
|> Seq.iter (fun (proj, framework) -> | ||
let dllPath = sprintf "src\\%s\\bin\\Release\\%s\\%s.dll" proj framework proj | ||
let projectPath = sprintf "src\\%s\\%s.csproj" proj proj | ||
let reportPath = sprintf "reports/%s-%s.coverage.xml" proj framework | ||
sprintf "%s --target \"dotnet\" --targetargs \"test -c Release -f %s %s --no-build\" --format opencover --output \"./%s\"" | ||
dllPath framework projectPath reportPath | ||
|> CreateProcess.fromRawCommandLine "coverlet" | ||
|> Proc.run | ||
|> ignore | ||
Trace.publish ImportData.BuildArtifact reportPath | ||
if isAppveyor then | ||
CreateProcess.fromRawCommandLine "codecov" (sprintf "-f \"%s\"" reportPath) | ||
|> Proc.run | ||
|> ignore | ||
) | ||
) | ||
*) | ||
|
||
Target.create "Default" (fun _ -> | ||
() | ||
) | ||
|
||
open Fake.Core.TargetOperators | ||
"Clean" ==> "Build" ==> "Default" | ||
|
||
(* | ||
"Build" ==> "Test" ==> "Default" | ||
"Build" ==> "Coverage" ==> "Default" | ||
*) | ||
|
||
// start build | ||
Target.runOrDefault "Default" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
branches: {} | ||
ignore: | ||
sha: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: 1.0.{build} | ||
image: Visual Studio 2017 | ||
install: | ||
- dotnet tool install fake-cli -g | ||
- dotnet tool install coverlet.console -g --version 1.3.0 | ||
- choco install codecov --no-progress --confirm | ||
- choco install gitversion.portable --no-progress --confirm | ||
cache: | ||
- C:\ProgramData\chocolatey\bin -> appveyor.yml | ||
- C:\ProgramData\chocolatey\lib -> appveyor.yml | ||
- '.fake -> Build.fsx' | ||
before_build: | ||
- ps: gitversion /output buildserver | ||
build_script: | ||
- ps: >- | ||
fake run Build.fsx | ||
test: off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version 5.193.0 | ||
source https://www.nuget.org/api/v2 | ||
|
||
// [ FAKE GROUP ] | ||
group FakeBuild | ||
source https://www.nuget.org/api/v2 | ||
framework: netstandard2.0 | ||
storage:none | ||
|
||
nuget Fake.Core.Target | ||
nuget Fake.BuildServer.AppVeyor | ||
nuget Fake.DotNet.Cli | ||
nuget Fake.DotNet.MSBuild | ||
nuget Fake.DotNet.Testing.XUnit2 | ||
nuget Fake.IO.FileSystem | ||
nuget Fake.Tools.GitVersion |
Oops, something went wrong.