Skip to content

Commit dc52381

Browse files
Add reference to private feed hosting ARM64 sdk (microsoft#470)
* Add reference to private feed hosting ARM64 sdk, update build script * Update build.ps1 Co-authored-by: Joe Schmitt <[email protected]> * Update build.ps1 Co-authored-by: Joe Schmitt <[email protected]> * Update package step * nit quotes Co-authored-by: Joe Schmitt <[email protected]>
1 parent 58d9020 commit dc52381

File tree

5 files changed

+47
-15
lines changed

5 files changed

+47
-15
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ OperationTracking/Msbuild.OperationTracking.Mixed Platforms.*
164164
*.err
165165
*.prf
166166
*.wrn
167+
*.binlog
167168

168169
*_i.h
169170
*_h.h

NuGet.config

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<packageSources>
66
<clear />
77
<add key="DNCENG-CoreClrPal" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/CoreClrPal/nuget/v3/index.json" />
8+
<add key="privateDependency" value="https://pkgs.dev.azure.com/devdiv/DevDiv/_packaging/ClrInstrumentationEngine-PrivateDependency/nuget/v3/index.json" />
89
</packageSources>
910
<activePackageSource>
1011
<add key="All" value="(Aggregate source)" />

build.ps1

+39-14
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ param(
5757

5858
[Parameter(Mandatory=$false)]
5959
[switch]
60-
$VerboseMsbuild
60+
$VerboseMsbuild,
61+
62+
[Parameter(Mandatory=$false)]
63+
[switch]
64+
$ARM64
6165
)
6266

6367
$ErrorActionPreference = 'Stop'
@@ -210,24 +214,33 @@ if (!$SkipBuild)
210214
Remove-Item -Force -Recurse "$repoPath\obj\"
211215
}
212216

213-
# NuGet restore disregards platform/configuration
214217
# dotnet restore defaults to Debug|Any CPU, which requires the /p:platform specification in order to replicate NuGet restore behavior.
215-
$restoreArgsInit = "restore $repoPath\InstrumentationEngine.sln --configfile $repoPath\NuGet.config"
216-
$restoreArgs = @(
217-
"$restoreArgsInit /p:platform=`"x86`""
218-
"$restoreArgsInit /p:platform=`"x64`""
219-
"$restoreArgsInit /p:platform=`"Any CPU`""
220-
)
221-
Invoke-ExpressionHelper -Executable "dotnet" -Arguments $restoreArgs -Activity 'dotnet Restore Solutions'
218+
$dotnetRestoreArgs = "restore `"$repoPath\InstrumentationEngine.sln`" --configfile `"$repoPath\NuGet.config`" /p:platform=`"Any CPU`""
219+
if ($ARM64)
220+
{
221+
$dotnetRestoreArgs = "$dotnetRestoreArgs /p:IncludeARM64='True'"
222+
}
223+
224+
Invoke-ExpressionHelper -Executable "dotnet" -Arguments $dotnetRestoreArgs -Activity 'dotnet Restore Solutions'
225+
226+
# NuGet restore disregards platform/configuration
227+
$nugetRestoreArgs = "restore `"$repoPath\NativeNugetRestore.sln`" -configfile `"$repoPath\NuGet.config`""
228+
Invoke-ExpressionHelper -Executable "nuget" -Arguments $nugetRestoreArgs -Activity 'nuget Restore Solutions'
222229
}
223230

224231
# Build InstrumentationEngine.sln
225232
$buildArgsInit = "$repoPath\InstrumentationEngine.sln /p:configuration=`"$configuration`" /p:SignType=$SignType /p:BuildVersion=$BuildVersion /clp:$($clParams)"
226-
$buildArgs = @(
233+
$buildArgs = [System.Collections.ArrayList]@(
227234
"$buildArgsInit /p:platform=`"x86`""
228235
"$buildArgsInit /p:platform=`"x64`""
229236
"$buildArgsInit /p:platform=`"Any CPU`" /m"
230237
)
238+
239+
if ($ARM64)
240+
{
241+
$buildArgs.Add("$buildArgsInit /p:platform=`"ARM64`" /m")
242+
}
243+
231244
Invoke-ExpressionHelper -Executable "$msbuild" -Arguments $buildArgs -Activity 'Build InstrumentationEngine.sln'
232245
}
233246

@@ -247,21 +260,33 @@ if (!$SkipPackaging)
247260

248261
# NuGet restore disregards platform/configuration
249262
# dotnet restore defaults to Debug|Any CPU, which requires the /p:platform specification in order to replicate NuGet restore behavior.
250-
$restoreArgsInit = "restore $repoPath\src\InstrumentationEngine.Packages.sln --configfile $repoPath\NuGet.config"
251-
$restoreArgs = @(
263+
$restoreArgsInit = "restore `"$repoPath\src\InstrumentationEngine.Packages.sln`" --configfile $repoPath\NuGet.config"
264+
$restoreArgs = [System.Collections.ArrayList]@(
252265
"$restoreArgsInit /p:platform=`"x86`""
253266
"$restoreArgsInit /p:platform=`"x64`""
254267
"$restoreArgsInit /p:platform=`"Any CPU`""
255268
)
269+
270+
if ($ARM64)
271+
{
272+
$restoreArgs.Add("$restoreArgsInit /p:platform=`"ARM64`"")
273+
}
274+
256275
Invoke-ExpressionHelper -Executable "dotnet" -Arguments $restoreArgs -Activity 'dotnet Restore Solutions'
257276

258277
# Build InstrumentationEngine.Packages.sln
259-
$buildArgsInit = "$repoPath\src\InstrumentationEngine.Packages.sln /p:configuration=`"$configuration`" /p:SignType=$SignType /p:BuildVersion=$BuildVersion /clp:$($clParams) /m"
260-
$buildArgs = @(
278+
$buildArgsInit = "`"$repoPath\src\InstrumentationEngine.Packages.sln`" /p:configuration=`"$configuration`" /p:SignType=$SignType /p:BuildVersion=$BuildVersion /clp:$($clParams) /m"
279+
$buildArgs = [System.Collections.ArrayList]@(
261280
"$buildArgsInit /p:platform=`"x86`""
262281
"$buildArgsInit /p:platform=`"x64`""
263282
"$buildArgsInit /p:platform=`"Any CPU`""
264283
)
284+
285+
if ($ARM64)
286+
{
287+
$buildArgs.Add("$buildArgsInit /p:platform=`"ARM64`"")
288+
}
289+
265290
Invoke-ExpressionHelper -Executable "$msbuild" -Arguments $buildArgs -Activity 'Build InstrumentationEngine.Packages.sln'
266291
}
267292

src/Dependencies/NativeDependencies.csproj

+5
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343
<PrivateAssets>All</PrivateAssets>
4444
</PackageReference>
4545
</ItemGroup>
46+
<ItemGroup Condition="'$(IncludeARM64)'=='True'">
47+
<PackageReference Include="Microsoft.VisualStudio.ARM64.SDK" Version="17.0.0">
48+
<ExcludeAssets>All</ExcludeAssets>
49+
</PackageReference>
50+
</ItemGroup>
4651
</Otherwise>
4752
</Choose>
4853
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />

src/InstrumentationEngine/InstrumentationEngine.vcxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
<AdditionalLibraryDirectories Condition="'$(Platform)'=='ARM64'">$(WindowsSDK_LibraryPath_arm64);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
8282
<AdditionalDependencies>InstrumentationEngine.Lib.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;msxml6.lib;version.lib;Faultrep.lib;Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
8383
<AdditionalDependencies Condition="'$(Platform)'!='ARM64'">mscoree.lib;%(AdditionalDependencies)</AdditionalDependencies>
84-
<AdditionalDependencies Condition="'$(Platform)'=='ARM64'">C:\Users\willxie\Downloads\microsoft.visualstudio.arm64.sdk.17.0.0.nupkg\lib\mscoree.lib;%(AdditionalDependencies)</AdditionalDependencies>
84+
<AdditionalDependencies Condition="'$(Platform)'=='ARM64'">$(PackagesDir)\microsoft.visualstudio.arm64.sdk\17.0.0\lib\mscoree.lib;%(AdditionalDependencies)</AdditionalDependencies>
8585
<AdditionalOptions Condition="'$(Platform)'=='Win32'">/SafeSEH %(AdditionalOptions)</AdditionalOptions>
8686
</Link>
8787
</ItemDefinitionGroup>

0 commit comments

Comments
 (0)