Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ on_failure:
& $env:APPVEYOR_BUILD_FOLDER\appveyor-discord.ps1 failure $env:APPVEYOR_DISCORD_WEBHOOK_URL

on_success:
- dotnet tool install --global NuKeeper
- ps: .\update-dependencies.ps1

cache:
Expand Down
42 changes: 21 additions & 21 deletions update-dependencies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ else
"lib-Windows.Devices.Pwm",
"lib-Windows.Devices.Spi",
"lib-nanoFramework.Networking.Sntp",
"lib-nanoFramework.Hardware.Stm32")
"lib-nanoFramework.Hardware.Stm32",
"lib-nanoFramework.System.Math")

ForEach($library in $librariesToUpdate)
{
Expand All @@ -46,30 +47,29 @@ else
# find solution file in repository
$solutionFile = (Get-ChildItem -Path ".\" -Include "*.sln" -Recurse)

# run NuKeeper inspect
if ($env:APPVEYOR_REPO_BRANCH -like '*release*' -or $env:APPVEYOR_REPO_BRANCH -like '*master*')
{
# use NuGet ONLY for release and master branches
$nukeeperInspect = NuKeeper inspect --source https://api.nuget.org/v3/index.json
}
else
{
# use NuGet and MyGet for all others
$nukeeperInspect = NuKeeper inspect
}
# find packages.config
$packagesConfig = (Get-ChildItem -Path ".\" -Include "packages.config" -Recurse)

# load packages.config as XML doc
[xml]$packagesDoc = Get-Content $packagesConfig

"NuGet update inspection result:" | Write-Host -ForegroundColor Cyan
$nukeeperInspect | Write-Host -ForegroundColor White
$nodes = $packagesDoc.SelectNodes("*").SelectNodes("*")

$packageCountMatch = [regex]::Match($nukeeperInspect, "Found (\d) possible updates").captures.groups[1].value
[int]$packageCount = 0
[int]::TryParse($packageCountMatch, [ref]$packageCount)
$packageList = @()

foreach ($node in $nodes)
{
# filter out NuProj packages
if($node.id -notlike "NuProj*")
{
$packageList += $node.id
}
}

if ($packageCount -gt 0)
if ($packageList.length -gt 0)
{
# get packages to update
$packageListRaw = [regex]::Match($nukeeperInspect, "(?>possible updates([^$]*)Found)").captures.Groups[1].Value;
[array]$packageList = $packageListRaw.Split([Environment]::NewLine, [StringSplitOptions]::RemoveEmptyEntries).Replace([Environment]::NewLine, "")
"NuGet packages to update:" | Write-Host -ForegroundColor White
$packageList | Write-Host -ForegroundColor White

# restore NuGet packages, need to do this before anything else
if ($env:APPVEYOR_REPO_BRANCH -like '*release*' -or $env:APPVEYOR_REPO_BRANCH -like '*master*')
Expand Down