Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/fsharp/FAKE
Browse files Browse the repository at this point in the history
Conflicts:
	RELEASE_NOTES.md
  • Loading branch information
forki committed Oct 30, 2015
2 parents c15602c + 806ec69 commit 454614a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#### 4.7.3 - 30.10.2015
* Option ignore failing tests DotCover https://github.com/fsharp/FAKE/pull/990
* Add code to replace new assemblyinfo attributes - https://github.com/fsharp/FAKE/pull/991

#### 4.7.2 - 19.10.2015
* Use WorkingDir in Paket helpers

Expand Down
8 changes: 7 additions & 1 deletion src/app/FakeLib/AssemblyInfoHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ type AssemblyInfoReplacementParams =
AssemblyVersion : string
AssemblyFileVersion : string
AssemblyInformationalVersion : string
AssemblyCompany : string
AssemblyCopyright : string
AssemblyConfiguration : string
AssemblyMetadata : (string * string) list }

Expand All @@ -215,7 +217,9 @@ let AssemblyInfoReplacementDefaults =
AssemblyConfiguration = null
AssemblyVersion = null
AssemblyFileVersion = null
AssemblyInformationalVersion = null
AssemblyInformationalVersion = null
AssemblyCompany = null
AssemblyCopyright = null
AssemblyMetadata = [] }

let ReplaceAssemblyInfoVersions param =
Expand Down Expand Up @@ -246,6 +250,8 @@ let ReplaceAssemblyInfoVersions param =
|> replaceAttribute "AssemblyConfiguration" parameters.AssemblyConfiguration
|> replaceAttribute "AssemblyFileVersion" parameters.AssemblyFileVersion
|> replaceAttribute "AssemblyInformationalVersion" parameters.AssemblyInformationalVersion
|> replaceAttribute "AssemblyCompany" parameters.AssemblyCompany
|> replaceAttribute "AssemblyCopyright" parameters.AssemblyCopyright
|> replaceMetadataAttributes parameters.AssemblyMetadata

ReadFile parameters.OutputFileName
Expand Down
20 changes: 15 additions & 5 deletions src/app/FakeLib/DotCover.fs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type DotCoverParams =
TargetWorkingDir: string
Output: string
Filters: string
ErrorLevel: TestRunnerErrorLevel
AttributeFilters: string
CustomParameters: string }

Expand All @@ -36,7 +37,8 @@ let DotCoverDefaults =
Filters = ""
AttributeFilters = ""
Output = "dotCoverSnapshot.dcvr"
CustomParameters = "" }
CustomParameters = ""
ErrorLevel = ErrorLevel.Error}

type DotCoverMergeParams =
{ ToolPath: string
Expand Down Expand Up @@ -105,14 +107,22 @@ let getWorkingDir workingDir =
Seq.find isNotNullOrEmpty [workingDir; environVar("teamcity.build.workingDir"); "."]
|> Path.GetFullPath

let buildParamsAndExecute parameters buildArguments toolPath workingDir =
let buildParamsAndExecute parameters buildArguments toolPath workingDir failBuild =
let args = buildArguments parameters
trace (toolPath + " " + args)
let result = ExecProcess (fun info ->
info.FileName <- toolPath
info.WorkingDirectory <- getWorkingDir workingDir
info.Arguments <- args) TimeSpan.MaxValue
if result <> 0 then failwithf "Error running %s" toolPath
let ExitCodeForFailedTests = -3
if (result = ExitCodeForFailedTests && not failBuild) then
trace (sprintf "DotCover %s exited with errorcode %d" toolPath result)
else if (result = ExitCodeForFailedTests && failBuild) then
failwithf "Failing tests, use ErrorLevel.DontFailBuild to ignore failing tests. Exited %s with errorcode %d" toolPath result
else if (result <> 0) then
failwithf "Error running %s with exitcode %d" toolPath result
else
trace (sprintf "DotCover exited successfully")

/// Runs the dotCover "cover" command, using a target executable (such as NUnit or MSpec) and generates a snapshot file.
///
Expand All @@ -121,7 +131,7 @@ let buildParamsAndExecute parameters buildArguments toolPath workingDir =
/// - `setParams` - Function used to overwrite the dotCover default parameters.
let DotCover (setParams: DotCoverParams -> DotCoverParams) =
let parameters = (DotCoverDefaults |> setParams)
buildParamsAndExecute parameters buildDotCoverArgs parameters.ToolPath parameters.WorkingDir
buildParamsAndExecute parameters buildDotCoverArgs parameters.ToolPath parameters.WorkingDir (parameters.ErrorLevel <> ErrorLevel.DontFailBuild)

/// Runs the dotCover "merge" command. This combines dotCover snaphots into a single
/// snapshot, enabling you to merge test coverage from multiple test running frameworks
Expand All @@ -137,7 +147,7 @@ let DotCover (setParams: DotCoverParams -> DotCoverParams) =
/// Output = artifactsDir @@ "dotCoverSnapshot.dcvr" })
let DotCoverMerge (setParams: DotCoverMergeParams -> DotCoverMergeParams) =
let parameters = (DotCoverMergeDefaults |> setParams)
buildParamsAndExecute parameters buildDotCoverMergeArgs parameters.ToolPath parameters.WorkingDir
buildParamsAndExecute parameters buildDotCoverMergeArgs parameters.ToolPath parameters.WorkingDir false

/// Runs the dotCover "report" command. This generates a report from a dotCover snapshot
/// ## Parameters
Expand Down
2 changes: 1 addition & 1 deletion src/app/FakeLib/Git/Branches.fs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ let pushTag repositoryDir remote tag = directRunGitCommand repositoryDir (sprint
///
/// - `repositoryDir` - The git repository.
/// - `remote` - The remote.
/// - `branch` - The tag.
/// - `branch` - The branch.
let pushBranch repositoryDir remote branch = directRunGitCommand repositoryDir (sprintf "push %s %s" remote branch) |> ignore

/// Pulls a given branch from the given remote.
Expand Down

0 comments on commit 454614a

Please sign in to comment.