Skip to content

Commit

Permalink
build script fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
scrthq committed May 15, 2019
1 parent 3283bf2 commit 648e821
Show file tree
Hide file tree
Showing 6 changed files with 219 additions and 33 deletions.
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $env:BuildProjectName = 'PSGSuite'
$env:_BuildStart = Get-Date -Format 'o'
$env:BuildScriptPath = $PSScriptRoot

Get-ChildItem (Join-Path $PSScriptRoot "ci") -Filter "*.ps1" | ForEach-Object {. $_.FullName}
. ([System.IO.Path]::Combine($PSScriptRoot,"ci","AzurePipelinesHelpers.ps1"))

Add-EnvironmentSummary "Build started"

Expand Down
11 changes: 7 additions & 4 deletions ci/AzurePipelinesHelpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ function Install-NuGetDependencies {
[parameter()]
[String[]]
$AddlSearchString

)
try {
Import-Module PackageManagement -Force
$dllStgPath = Join-Path $PSScriptRoot "NuGetStaging"
$packagesToInstall = Import-Csv (Join-Path $PSScriptRoot "NuGetDependencies.csv") | Sort-Object BaseName
$packagesToInstall = Get-Content (Join-Path $PSScriptRoot "NuGetDependencies.json") -Raw | ConvertFrom-Json | Sort-Object BaseName
if (-not (Test-Path $dllStgPath)) {
New-Item $dllStgPath -Force -ItemType Directory | Out-Null
}
Expand All @@ -36,6 +36,9 @@ function Install-NuGetDependencies {
$nugHash[$_.Name] = $_
}
}
if ($nugHash.Keys.Count) {
. ([System.IO.Path]::Combine($PSScriptRoot,"UpdateNuGetDependenciesJson.ps1"))
}
foreach ($inst in $packagesToInstall) {
try {
$pkg = if ($nugHash.ContainsKey($inst.BaseName)) {
Expand All @@ -44,8 +47,8 @@ function Install-NuGetDependencies {
else {
[PSCustomObject]@{
Name = $inst.BaseName
Version = $inst.Version
TagId = $inst.BaseName + '#' + $inst.Version
Version = $inst.LatestVersion
TagId = $inst.BaseName + '#' + $inst.LatestVersion
}
}
Write-BuildLog ("[{0}.{1}] Downloading latest package from NuGet" -f $pkg.Name,$pkg.Version)
Expand Down
26 changes: 0 additions & 26 deletions ci/NuGetDependencies.csv

This file was deleted.

164 changes: 164 additions & 0 deletions ci/NuGetDependencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
[
{
"Name": "BouncyCastle.Crypto.dll",
"BaseName": "BouncyCastle.Crypto.dll",
"Target": "1.8.1",
"LatestVersion": "1.8.1"
},
{
"Name": "Google.Apis.dll",
"BaseName": "Google.Apis",
"Target": "Latest",
"LatestVersion": "1.40.0"
},
{
"Name": "Google.Apis.Admin.DataTransfer.datatransfer_v1.dll",
"BaseName": "Google.Apis.Admin.DataTransfer.datatransfer_v1",
"Target": "Latest",
"LatestVersion": "1.40.0.418"
},
{
"Name": "Google.Apis.Admin.Directory.directory_v1.dll",
"BaseName": "Google.Apis.Admin.Directory.directory_v1",
"Target": "Latest",
"LatestVersion": "1.40.0.1505"
},
{
"Name": "Google.Apis.Admin.Reports.reports_v1.dll",
"BaseName": "Google.Apis.Admin.Reports.reports_v1",
"Target": "Latest",
"LatestVersion": "1.40.0.1578"
},
{
"Name": "Google.Apis.Auth.dll",
"BaseName": "Google.Apis.Auth",
"Target": "Latest",
"LatestVersion": "1.40.0"
},
{
"Name": "Google.Apis.Auth.PlatformServices.dll",
"BaseName": "Google.Apis.Auth.PlatformServices",
"Target": "Latest",
"LatestVersion": "1.40.0"
},
{
"Name": "Google.Apis.Calendar.v3.dll",
"BaseName": "Google.Apis.Calendar.v3",
"Target": "Latest",
"LatestVersion": "1.40.0.1580"
},
{
"Name": "Google.Apis.Classroom.v1.dll",
"BaseName": "Google.Apis.Classroom.v1",
"Target": "Latest",
"LatestVersion": "1.40.0.1587"
},
{
"Name": "Google.Apis.Core.dll",
"BaseName": "Google.Apis.Core",
"Target": "Latest",
"LatestVersion": "1.40.0"
},
{
"Name": "Google.Apis.Docs.v1.dll",
"BaseName": "Google.Apis.Docs.v1",
"Target": "Latest",
"LatestVersion": "1.40.0.1581"
},
{
"Name": "Google.Apis.Drive.v3.dll",
"BaseName": "Google.Apis.Drive.v3",
"Target": "Latest",
"LatestVersion": "1.40.0.1587"
},
{
"Name": "Google.Apis.DriveActivity.v2.dll",
"BaseName": "Google.Apis.DriveActivity.v2",
"Target": "Latest",
"LatestVersion": "1.40.0.1589"
},
{
"Name": "Google.Apis.Gmail.v1.dll",
"BaseName": "Google.Apis.Gmail.v1",
"Target": "Latest",
"LatestVersion": "1.40.0.1572"
},
{
"Name": "Google.Apis.Groupssettings.v1.dll",
"BaseName": "Google.Apis.Groupssettings.v1",
"Target": "Latest",
"LatestVersion": "1.40.0.1534"
},
{
"Name": "Google.Apis.HangoutsChat.v1.dll",
"BaseName": "Google.Apis.HangoutsChat.v1",
"Target": "Latest",
"LatestVersion": "1.40.0.1583"
},
{
"Name": "Google.Apis.Licensing.v1.dll",
"BaseName": "Google.Apis.Licensing.v1",
"Target": "Latest",
"LatestVersion": "1.40.0.774"
},
{
"Name": "Google.Apis.Oauth2.v2.dll",
"BaseName": "Google.Apis.Oauth2.v2",
"Target": "Latest",
"LatestVersion": "1.40.0.1532"
},
{
"Name": "Google.Apis.PeopleService.v1.dll",
"BaseName": "Google.Apis.PeopleService.v1",
"Target": "Latest",
"LatestVersion": "1.40.0.1588"
},
{
"Name": "Google.Apis.PlatformServices.dll",
"BaseName": "Google.Apis.PlatformServices",
"Target": "Latest",
"LatestVersion": "1.40.0"
},
{
"Name": "Google.Apis.Script.v1.dll",
"BaseName": "Google.Apis.Script.v1",
"Target": "Latest",
"LatestVersion": "1.40.0.1589"
},
{
"Name": "Google.Apis.Sheets.v4.dll",
"BaseName": "Google.Apis.Sheets.v4",
"Target": "Latest",
"LatestVersion": "1.40.0.1588"
},
{
"Name": "Google.Apis.Slides.v1.dll",
"BaseName": "Google.Apis.Slides.v1",
"Target": "Latest",
"LatestVersion": "1.40.0.1579"
},
{
"Name": "Google.Apis.Tasks.v1.dll",
"BaseName": "Google.Apis.Tasks.v1",
"Target": "Latest",
"LatestVersion": "1.40.0.1513"
},
{
"Name": "Google.Apis.Urlshortener.v1.dll",
"BaseName": "Google.Apis.Urlshortener.v1",
"Target": "Latest",
"LatestVersion": "1.40.0.138"
},
{
"Name": "MimeKit.dll",
"BaseName": "MimeKit",
"Target": "1.10.1.0",
"LatestVersion": "1.10.1.0"
},
{
"Name": "Newtonsoft.Json.dll",
"BaseName": "Newtonsoft.Json",
"Target": "10.0.3",
"LatestVersion": "10.0.3"
}
]
46 changes: 46 additions & 0 deletions ci/UpdateNuGetDependenciesJson.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
if ($items = Get-ChildItem (Resolve-Path $PSScriptRoot\..\BuildOutput\PSGSuite\*\lib\net45 -ErrorAction SilentlyContinue).Path -Filter '*.dll') {
$items |
#Where-Object |
Sort-Object BaseName |
Select-Object Name,
@{
N = 'BaseName'
E = {
if ($_.BaseName -eq 'BouncyCastle.Crypto') {
'BouncyCastle.Crypto.dll'
}
else {
$_.BaseName
}
}
},
@{
N='Target'
E={
if ($_.BaseName -match 'Google') {
'Latest'
}
else {
switch ($_.BaseName) {
'BouncyCastle.Crypto' {
'1.8.1'
}
'MimeKit' {
'1.10.1.0'
}
'Newtonsoft.Json' {
'10.0.3'
}
}
}
}
},
@{
N='LatestVersion'
E={
[System.Diagnostics.FileVersionInfo]::GetVersionInfo($_.FullName).ProductVersion
}
} |
ConvertTo-Json |
Set-Content (Join-Path $PSScriptRoot 'NuGetDependencies.json') -Force
}
3 changes: 1 addition & 2 deletions psake.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ Properties {
}
}

# Dot-source all helper scripts/functions in the ci folder
Get-ChildItem (Join-Path $PSScriptRoot "ci") -Filter "*.ps1" | ForEach-Object {. $_.FullName}
. ([System.IO.Path]::Combine($PSScriptRoot,"ci","AzurePipelinesHelpers.ps1"))

Set-BuildVariables

Expand Down

0 comments on commit 648e821

Please sign in to comment.