Skip to content

Commit d96baac

Browse files
committed
(GH-5) Working on adding psake to build process
- Added back in Costura Fody Plugin - Added necessary tool, i.e. NuGet and psake - Added missing AssemblyInfo - Added buildscripts, and xsl files, for dupfinder and inspectcode
1 parent 7f49e91 commit d96baac

21 files changed

+1953
-17
lines changed

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at http://EditorConfig.org
3+
4+
root = true
5+
6+
[*]
7+
end_of_line = CRLF
8+
9+
[*.ps1]
10+
indent_style = space
11+
indent_size = 2
12+
13+
[*.cs]
14+
indent_style = space
15+
indent_size = 4
16+
17+
[*.js]
18+
indent_style = tab
19+
indent_size = 2

BuildScripts/build.ps1

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# The creation of this build script (and associated files) was only possible using the
2+
# work that was done on the BoxStarter Project on GitHub:
3+
# http://boxstarter.codeplex.com/
4+
# Big thanks to Matt Wrock (@mwrockx} for creating this project, thanks!
5+
6+
param (
7+
[string]$Action="default",
8+
[string]$Config="Debug",
9+
[switch]$Help
10+
)
11+
12+
$here = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
13+
$psakePath = Join-Path $here -Child "..\Tools\psake\psake.psm1";
14+
Import-Module $psakePath;
15+
16+
if($Help){
17+
try {
18+
Get-Help "$($MyInvocation.MyCommand.Definition)" -full | Out-Host -paging
19+
Write-Output "Available build tasks:"
20+
invoke-psake "$here/default.ps1" -nologo -docs | Out-Host -paging
21+
} catch {}
22+
23+
return
24+
}
25+
26+
if(Test-Path -Path env:\APPVEYOR) {
27+
if($env:APPVEYOR_REPO_BRANCH -eq "develop" -And $env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null) {
28+
Write-Output "Since we are on develop branch with no pull request number, we are ready to deploy to Develop MyGet Feed"
29+
invoke-psake "$here/default.ps1" -task DeployDevelopSolutionToMyGet -properties @{ 'config'='Release'; }
30+
} elseif($env:APPVEYOR_REPO_BRANCH -eq "develop" -And $env:APPVEYOR_PULL_REQUEST_NUMBER -ne $null) {
31+
Write-Output "Since we are on develop branch with a pull request number, we are just going to package the solution, with no deployment"
32+
invoke-psake "$here/default.ps1" -task InspectCodeForProblems -properties @{ 'config'='Release'; }
33+
} elseif($env:APPVEYOR_REPO_BRANCH -eq "master" -And $env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null -And $env:APPVEYOR_REPO_TAG -eq $false) {
34+
Write-Output "Since we are on master branch with no pull request number, and no tag applied, we are ready to deploy to Master MyGet Feed"
35+
invoke-psake "$here/default.ps1" -task DeployMasterSolutionToMyGet -properties @{ 'config'='Release'; }
36+
} elseif($env:APPVEYOR_REPO_BRANCH -eq "master" -And $env:APPVEYOR_PULL_REQUEST_NUMBER -ne $null -And $env:APPVEYOR_REPO_TAG -eq $false) {
37+
Write-Output "Since we are on master branch with a pull request number, and no tag applied, we are just going to package the solution, with no deployment"
38+
invoke-psake "$here/default.ps1" -task InspectCodeForProblems -properties @{ 'config'='Release'; }
39+
} elseif($env:APPVEYOR_REPO_BRANCH -eq "master" -And $env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null -And $env:APPVEYOR_REPO_TAG -eq $true) {
40+
Write-Output "Since we are on master branch with no pull request number, and a tag has been applied, we are ready to deploy Chocolatey.org"
41+
invoke-psake "$here/default.ps1" -task DeploySolutionToChocolatey -properties @{ 'config'='Release'; }
42+
}
43+
} else {
44+
invoke-psake "$here/default.ps1" -task $Action -properties @{ 'config'=$Config; }
45+
}
46+
47+
# If for some reason, the above if statement doesn't actually invoke-psake, the $psake.build_success will be false
48+
# so it will exit with a code of 1 below, which will fail the build.
49+
if ($psake.build_success -eq $false) {
50+
exit 1
51+
} else {
52+
exit 0
53+
}

0 commit comments

Comments
 (0)