This repository has been archived by the owner on Jun 25, 2021. It is now read-only.
forked from NETMF/netmf-interpreter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Update-DeviceSdkAssembly.ps1
48 lines (41 loc) · 2 KB
/
Update-DeviceSdkAssembly.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# copy 4 files to Sdk endian specific folder
# <assembly>.dll
# <assembly>.pdb
# <assembly>.pdbx
# <assembly>.pe
Function Update-SdkEndianBins
{
Param( [String] $assemblyName, [String] $endian )
$BUILD_CLIENT_DLL = Join-Path ${env:BUILD_TREE_CLIENT} "dll"
$BUILD_CLIENT_PE = Join-Path ${env:BUILD_TREE_CLIENT} "pe"
$SdkInstallRoot = Join-Path ${env:ProgramFiles(x86)} "Microsoft .NET Micro Framework\v4.4"
$endianName = Join-Path $endian $assemblyName
Copy-Item (Join-Path $BUILD_CLIENT_DLL "$assemblyName.dll") (Join-Path $SdkInstallRoot "Assemblies\$endianName.dll")
Copy-Item (Join-Path $BUILD_CLIENT_DLL "$assemblyName.pdb") (Join-Path $SdkInstallRoot "Assemblies\$endianName.pdb")
Copy-Item (Join-Path $BUILD_CLIENT_PE "$endianName.pdbx") (Join-Path $SdkInstallRoot "Assemblies\$endianName.pdbx")
Copy-Item (Join-Path $BUILD_CLIENT_PE "$endianName.pe") (Join-Path $SdkInstallRoot "Assemblies\$endianName.pe")
}
# copy 2 files into Reference Assemblies location
# <assembly>.pdb
# <assembly>.dll
Function Update-SdkRefAssembly
{
Param( [String] $assemblyName )
$RefAssembliesDir = Join-Path ${env:ProgramFiles(x86)} "Reference Assemblies\Microsoft\Framework\.NETMicroFramework\v4.4"
$BUILD_CLIENT_DLL = Join-Path ${env:BUILD_TREE_CLIENT} "dll"
$BUILD_CLIENT_PE = Join-Path ${env:BUILD_TREE_CLIENT} "pe"
Copy-Item (Join-Path $BUILD_CLIENT_DLL "$assemblyName.dll") (Join-Path $RefAssembliesDir "$assemblyName.dll")
Copy-Item (Join-Path $BUILD_CLIENT_DLL "$assemblyName.pdb") (Join-Path $RefAssembliesDir "$assemblyName.pdb")
}
Function Update-SdkAssembly
{
Param( [String] $assemblyName )
if( [String]::IsNullOrWhiteSpace( ${env:BUILD_TREE_CLIENT} ) )
{
Write-Error "You must run one of the setenv_xxx scripts to initialize the environment before using this command"
return
}
Update-SdkRefAssembly $AssemblyName
Update-SdkEndianBins $AssemblyName "le"
Update-SdkEndianBins $AssemblyName "be"
}