-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from dependency-check/develop
5.3.2 Release
- Loading branch information
Showing
119 changed files
with
135 additions
and
718 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
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,66 @@ | ||
if ([string]::IsNullOrWhiteSpace($env:BUILD_VERSION)) { | ||
Write-Host "Error: Major version number environment variable is required" | ||
exit 1 | ||
} | ||
|
||
if ([string]::IsNullOrWhiteSpace($env:BUILD_ENVIRONMENT)) { | ||
Write-Host "Error: Build environment variable is required" | ||
exit 2 | ||
} | ||
|
||
$taskDefPath = ".\src\Tasks\dependency-check-build-task\task.json" | ||
if (!(Test-Path $taskDefPath -PathType Leaf)) { | ||
Write-Host "Error: $taskDefPath not found" | ||
exit 3 | ||
} | ||
|
||
# Set build env vars | ||
if ($env:BUILD_ENVIRONMENT -eq "Release") { | ||
$taskId = "47EA1F4A-57BA-414A-B12E-C44F42765E72" | ||
$taskName = "dependency-check-build-task" | ||
$vssExtensionPath = ".\vss-extension.prod.json" | ||
} | ||
else { | ||
$taskId = "04450B31-9F11-415A-B37A-514D69EF69A1" | ||
$taskName = "dependency-check-build-task-dev" | ||
$vssExtensionPath = ".\vss-extension.dev.json" | ||
} | ||
|
||
#Parse version vars | ||
$versionMajor,$versionMinor,$versionPatch,$versionRevision = $env:BUILD_VERSION.Split('.') | ||
$versionPatchRevision = [string]::Format("{0}{1}", $versionPatch, $versionRevision.PadLeft(3, '0')) | ||
|
||
if (!(Test-Path $vssExtensionPath -PathType Leaf)) { | ||
Write-Host "Error: $vssExtensionPath not found" | ||
exit 4 | ||
} | ||
|
||
Write-Host "Setting build environment for $env:BUILD_ENVIRONMENT" | ||
Write-Host "Setting extension version: $env:BUILD_VERSION" | ||
Write-Host "Setting build task version: $versionMajor.$versionMinor.$versionPatchRevision" | ||
|
||
# task.json (set build task id / name) | ||
Write-Host "Reading task.json" | ||
$task = Get-Content $taskDefPath -raw | ConvertFrom-Json | ||
|
||
Write-Host "Setting task definition id and name" | ||
$task.id = $taskId | ||
$task.name = $taskName | ||
|
||
Write-Host "Setting task definition version" | ||
$task.version.Major = $versionMajor | ||
$task.version.Minor = $versionMinor | ||
$task.version.Patch = $versionPatchRevision | ||
|
||
Write-Host "Saving new task definition..." | ||
$task | ConvertTo-Json -depth 32| set-content $taskDefPath | ||
|
||
# vss-extension-[env].json (set vesion) | ||
Write-Host "Reading $vssExtensionPath" | ||
$vssExtension = Get-Content $vssExtensionPath -raw | ConvertFrom-Json | ||
|
||
Write-Host "Setting version" | ||
$vssExtension.version = $env:BUILD_VERSION | ||
|
||
Write-Host "Saving new task definition..." | ||
$vssExtension | ConvertTo-Json -depth 32| set-content $vssExtensionPath |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
202 changes: 0 additions & 202 deletions
202
src/Tasks/dependency-check-build-task/dependency-check/LICENSE.txt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.