Skip to content

Commit ef826ad

Browse files
committed
Add AOT publisj test job
1 parent de3b92c commit ef826ad

3 files changed

Lines changed: 69 additions & 0 deletions

File tree

eng/pipelines/pr.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,3 +284,20 @@ stages:
284284
displayName: Log Environment Variables
285285
- script: dotnet format whitespace --verify-no-changes NuGet.sln
286286
displayName: Run dotnet format whitespace
287+
288+
- stage:
289+
displayName: AOT Compatibility
290+
dependsOn: []
291+
jobs:
292+
- job:
293+
displayName: AOT Publish Smoke Test (win-x64)
294+
timeoutInMinutes: 20
295+
pool:
296+
vmImage: windows-latest
297+
steps:
298+
- task: PowerShell@2
299+
displayName: Run configure.ps1
300+
inputs:
301+
filePath: configure.ps1
302+
- script: dotnet publish test/NuGet.AotCompatibility.Test/NuGet.AotCompatibility.Test.csproj -r win-x64 -c Release
303+
displayName: AOT publish NuGet libraries
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<OutputType>Exe</OutputType>
4+
<TargetFramework>$(LatestNETCoreTargetFramework)</TargetFramework>
5+
<PublishAot>true</PublishAot>
6+
<IlcTreatWarningsAsErrors>true</IlcTreatWarningsAsErrors>
7+
<PackProject>false</PackProject>
8+
<UsePublicApiAnalyzer>false</UsePublicApiAnalyzer>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<ProjectReference Include="..\..\src\NuGet.Core\NuGet.Commands\NuGet.Commands.csproj" />
13+
<ProjectReference Include="..\..\src\NuGet.Core\NuGet.Common\NuGet.Common.csproj" />
14+
<ProjectReference Include="..\..\src\NuGet.Core\NuGet.Configuration\NuGet.Configuration.csproj" />
15+
<ProjectReference Include="..\..\src\NuGet.Core\NuGet.Credentials\NuGet.Credentials.csproj" />
16+
<ProjectReference Include="..\..\src\NuGet.Core\NuGet.DependencyResolver.Core\NuGet.DependencyResolver.Core.csproj" />
17+
<ProjectReference Include="..\..\src\NuGet.Core\NuGet.Frameworks\NuGet.Frameworks.csproj" />
18+
<ProjectReference Include="..\..\src\NuGet.Core\NuGet.LibraryModel\NuGet.LibraryModel.csproj" />
19+
<ProjectReference Include="..\..\src\NuGet.Core\NuGet.Packaging\NuGet.Packaging.csproj" />
20+
<ProjectReference Include="..\..\src\NuGet.Core\NuGet.ProjectModel\NuGet.ProjectModel.csproj" />
21+
<ProjectReference Include="..\..\src\NuGet.Core\NuGet.Protocol\NuGet.Protocol.csproj" />
22+
<ProjectReference Include="..\..\src\NuGet.Core\NuGet.Resolver\NuGet.Resolver.csproj" />
23+
<ProjectReference Include="..\..\src\NuGet.Core\NuGet.Versioning\NuGet.Versioning.csproj" />
24+
</ItemGroup>
25+
26+
<!--
27+
Root all public types in each NuGet assembly so the ILC compiler analyzes
28+
the full public surface of every library, not just what Program.cs reaches.
29+
-->
30+
<ItemGroup>
31+
<TrimmerRootAssembly Include="NuGet.Commands" />
32+
<TrimmerRootAssembly Include="NuGet.Common" />
33+
<TrimmerRootAssembly Include="NuGet.Configuration" />
34+
<TrimmerRootAssembly Include="NuGet.Credentials" />
35+
<TrimmerRootAssembly Include="NuGet.DependencyResolver.Core" />
36+
<TrimmerRootAssembly Include="NuGet.Frameworks" />
37+
<TrimmerRootAssembly Include="NuGet.LibraryModel" />
38+
<TrimmerRootAssembly Include="NuGet.Packaging" />
39+
<TrimmerRootAssembly Include="NuGet.ProjectModel" />
40+
<TrimmerRootAssembly Include="NuGet.Protocol" />
41+
<TrimmerRootAssembly Include="NuGet.Resolver" />
42+
<TrimmerRootAssembly Include="NuGet.Versioning" />
43+
</ItemGroup>
44+
</Project>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
// AOT compatibility smoke test entry point.
5+
// All NuGet assemblies with IsAotCompatible=true are referenced via ProjectReference
6+
// and rooted via TrimmerRootAssembly so the ILC compiler analyzes their full public
7+
// surface. A successful publish with IlcTreatWarningsAsErrors=true confirms AOT
8+
// compatibility. No application logic is needed here.

0 commit comments

Comments
 (0)