Skip to content

Commit b0fe5cb

Browse files
committedMay 13, 2016
Added checks for an existing installation to Install-Tools.ps1 and InstallCMSIS.ps1 so that the automated build doesn't need to install the files if they are already available.
1 parent e89b2ce commit b0fe5cb

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed
 

‎Install-BinTools.ps1

+7
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
Import-Module .\tools\scripts\Build-netmf.psm1
2+
if( Test-Path -PathType Container (Join-Path $SPOROOT "bin\automation") )
3+
{
4+
Write-Host "Existing tools installation found"
5+
return
6+
}
7+
28
Invoke-WebRequest -UseBasicParsing -Uri "http://netmf.github.io/downloads/build-tools.zip" | Expand-Stream -Destination $SPOROOT
9+

‎Install-CMSIS.ps1

+19-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,23 @@ $packFileName = "ARM.CMSIS.$packVersion.pack"
2020
$packSourceURLBase = "https://github.com/ARM-software/CMSIS/releases/download/v$packVersion"
2121

2222
# download the pack and extract the files into the curent directory
23-
$dstPath = [System.IO.Path]::Combine( $SPOCLIENT, "CMSIS" )
23+
$dstPath = Join-Path $SPOCLIENT "CMSIS"
24+
25+
$packDescriptionPath = Join-Path $dstPath ARM.CMSIS.pdsc
26+
if( Test-Path -PathType Leaf $packDescriptionPath )
27+
{
28+
# check for the correct version
29+
[System.Xml.XmlDocument] $pdsc = New-Object System.Xml.XmlDocument
30+
$pdsc.Load( $packDescriptionPath )
31+
$releases = $pdsc.SelectNodes("/package/releases/release[@version='$packVersion']")
32+
if( $releases.Count -ne 1 )
33+
{
34+
Write-Error "ERROR: Detected existing but Incompatible CMSIS version installed"
35+
return
36+
}
37+
38+
Write-Host "Existing installation of CMSIS found"
39+
return
40+
}
41+
2442
Invoke-WebRequest -UseBasicParsing -Uri "$packSourceURLBase/$packFileName" | Expand-Stream -Destination $dstPath

0 commit comments

Comments
 (0)
Please sign in to comment.