Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Commit

Permalink
Adding build files
Browse files Browse the repository at this point in the history
  • Loading branch information
StanleyGoldman committed Jan 20, 2019
1 parent ac4e674 commit a7fe179
Show file tree
Hide file tree
Showing 8 changed files with 1,143 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ ModelManifest.xml

# Paket dependency manager
.paket/paket.exe
paket-files

# FAKE - F# Make
.fake/

reports/
SharedAssemblyInfo.cs
nuget/*
300 changes: 300 additions & 0 deletions .paket/Paket.Restore.targets

Large diffs are not rendered by default.

109 changes: 109 additions & 0 deletions Build.fsx
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"
3 changes: 3 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
branches: {}
ignore:
sha: []
7 changes: 7 additions & 0 deletions SonOfPicasso.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SonOfPicasso.Core", "src\So
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SonOfPicasso.UI", "src\SonOfPicasso.UI\SonOfPicasso.UI.csproj", "{B9FBDA9B-B6C7-4AD7-916C-E1FB8FF520F1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{30DC3442-C225-4FC5-9439-77BD1B3EE895}"
ProjectSection(SolutionItems) = preProject
appveyor.yml = appveyor.yml
Build.fsx = Build.fsx
paket.dependencies = paket.dependencies
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
17 changes: 17 additions & 0 deletions appveyor.yml
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
16 changes: 16 additions & 0 deletions paket.dependencies
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
Loading

0 comments on commit a7fe179

Please sign in to comment.