Skip to content

Commit

Permalink
(chocolatey#172) Ensured that all artifacts are uploaded
Browse files Browse the repository at this point in the history
- Although the reports for dupfinder and inspectcode were being generated, they were not being pushed to AppVeyor
- Restructed the code to ensure that this happens
  • Loading branch information
gep13 authored and RichiCoder1 committed Jun 29, 2015
1 parent e1e475d commit ad6418d
Showing 1 changed file with 20 additions and 23 deletions.
43 changes: 20 additions & 23 deletions BuildScripts/default.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,18 @@ function analyseCodeAnalysisResults( [Parameter(ValueFromPipeline=$true)]$codeAn
}
}

function analyseDupFinderResults( [Parameter(ValueFromPipeline=$true)]$dupFinderResultsFile ) {
if(isAppVeyor) {
Push-AppveyorArtifact $dupFinderResultsFile;
}
}

function analyseInspectCodeResults( [Parameter(ValueFromPipeline=$true)]$inspectCodeResultsFile ) {
if(isAppVeyor) {
Push-AppveyorArtifact $inspectCodeResultsFile;
}
}

function testEnvironmentVariable($envVariableName, $envVariableValue) {
if($envVariableValue -ne "") {
Write-Host "$envVariableName : $envVariableValue";
Expand All @@ -116,6 +128,10 @@ function applyXslTransform($xmlFile, $xslFile, $outputFile) {
$xslt.Transform($xmlFile, $outputFile);

Write-Host "XSL Transform completed."

if(isAppVeyor) {
Push-AppveyorArtifact $outputFile;
}
}

Task -Name Default -Depends BuildSolution
Expand Down Expand Up @@ -342,11 +358,9 @@ Task -Name RunInspectCode -Depends __InstallReSharperCommandLineTools -Descripti
exec {
Invoke-Expression "$inspectCodeExe /config=$inspectCodeConfigFile";

if(isAppVeyor) {
if(Test-Path $inspectCodeXmlFile) {
Push-AppveyorArtifact $inspectCodeXmlFile;
}
}
if(Test-Path $inspectCodeXmlFile) {
$inspectCodeXmlFile | analyseInspectCodeResults;
}
}
}

Expand All @@ -365,14 +379,9 @@ Task -Name RunDupFinder -Depends __InstallReSharperCommandLineTools -Description
Invoke-Expression "$dupFinderExe /config=$dupFinderConfigFile";

if(Test-Path $dupFinderXmlFile) {
$dupFinderXmlFile | analyseDupFinderResults;
applyXslTransform $dupFinderXmlFile $dupFinderXslFile $dupFinderHtmlFile;
}

if(isAppVeyor) {
if(Test-Path $dupFinderXmlFile) {
Push-AppveyorArtifact $dupFinderXmlFile;
}
}
}
}

Expand Down Expand Up @@ -430,12 +439,6 @@ Task -Name BuildSolution -Depends __RemoveBuildArtifactsDirectory, __VerifyConfi
$reportHtmlFile = $reportXmlFile -replace ".xml", ".html";
Join-Path -Path $buildArtifactsDirectory -ChildPath $styleCopResultsFile | analyseStyleCopResults;
applyXslTransform $reportXmlFile $styleCopXslFile $reportHtmlFile;

if(isAppVeyor) {
if(Test-Path $reportHtmlFile) {
Push-AppveyorArtifact $reportHtmlFile;
}
}
}

$codeAnalysisFiles = Get-ChildItem $buildArtifactsDirectory -Filter "CodeAnalysis*.xml"
Expand All @@ -444,12 +447,6 @@ Task -Name BuildSolution -Depends __RemoveBuildArtifactsDirectory, __VerifyConfi
$reportHtmlFile = $reportXmlFile -replace ".xml", ".html";
Join-Path -Path $buildArtifactsDirectory -ChildPath $codeAnalysisFile | analyseCodeAnalysisResults;
applyXslTransform $reportXmlFile $codeAnalysisXslFile $reportHtmlFile;

if(isAppVeyor) {
if(Test-Path $reportHtmlFile) {
Push-AppveyorArtifact $reportHtmlFile;
}
}
}

if(isAppVeyor) {
Expand Down

0 comments on commit ad6418d

Please sign in to comment.