Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Commit

Permalink
script update
Browse files Browse the repository at this point in the history
  • Loading branch information
arturl committed May 31, 2016
1 parent 242ea01 commit ad474ea
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
2 changes: 1 addition & 1 deletion AzureIoTHubConnectedServiceLibrary/Handler.CSharp.WAC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protected override HandlerManifest BuildHandlerManifest(bool useTPM)

manifest.PackageReferences.Add(new NuGetReference("Newtonsoft.Json", "8.0.3"));
manifest.PackageReferences.Add(new NuGetReference("Microsoft.Azure.Amqp", "1.1.5"));
manifest.PackageReferences.Add(new NuGetReference("Microsoft.Azure.Devices.Client", "1.0.9"));
manifest.PackageReferences.Add(new NuGetReference("Microsoft.Azure.Devices.Client", "1.0.11"));
manifest.PackageReferences.Add(new NuGetReference("PCLCrypto", "2.0.147"));
manifest.PackageReferences.Add(new NuGetReference("PInvoke.BCrypt", "0.3.2"));
manifest.PackageReferences.Add(new NuGetReference("PInvoke.Kernel32", "0.3.2"));
Expand Down
37 changes: 30 additions & 7 deletions AzureIoTHubConnectedServiceLibrary/packages/get-latest-pkg.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ function SplitNameToPkgAndVersion($filename) {
Write-Host "Error: Unable to extract package name and version from $filename" -foregroundcolor "red"
}

$target_folder = "new"

if(Test-Path $target_folder)
{
Remove-Item $target_folder -recurse
}

$packages = @();

ls *.nupkg | % {$_.FullName} | % {
Expand Down Expand Up @@ -39,15 +46,31 @@ ls -r *.nupkg | % {$_.FullName} | % {
}
}

$target_folder = "new"

if(Test-Path $target_folder)
{
Remove-Item $target_folder -recurse
}

mkdir $target_folder

$map.Values | % {
cp $_ $target_folder
}

# Iterate over the old nupkg files and see if we have a newer version

ls *.nupkg | % {$_.FullName} | % {
($pkg, $version) = SplitNameToPkgAndVersion($_)
$search_path = "$target_folder\\*.nupkg"
$up_to_date = $True
ls $search_path | % {$_.FullName} | % {
($pkg2, $version2) = SplitNameToPkgAndVersion($_)
if($pkg -eq $pkg2)
{
if( (New-Object System.Version($version)) -lt (New-Object System.Version($version2)))
{
Write-Host "$pkg version $version --> $version2" -foregroundcolor "magenta"
$up_to_date = $False
}
}
}
if($up_to_date -eq $True)
{
Write-Host "$pkg is up to date" -foregroundcolor "gray"
}
}

0 comments on commit ad474ea

Please sign in to comment.