-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[.Net] Add AOT compatible check for AutoGen.Core (#2858)
* add AutoGen.AotCompatibility test * add aot test * fix build error * update ps1 path
- Loading branch information
1 parent
bedc6c0
commit 906c4c7
Showing
13 changed files
with
118 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
param([string]$targetNetFramework) | ||
|
||
$rootDirectory = Split-Path $PSScriptRoot -Parent | ||
$publishOutput = dotnet publish $rootDirectory/test/AutoGen.AotCompatibility.Tests -nodeReuse:false /p:UseSharedCompilation=false /p:ExposeExperimentalFeatures=true | ||
|
||
$actualWarningCount = 0 | ||
|
||
foreach ($line in $($publishOutput -split "`r`n")) | ||
{ | ||
if ($line -like "*analysis warning IL*") | ||
{ | ||
Write-Host $line | ||
|
||
$actualWarningCount += 1 | ||
} | ||
} | ||
|
||
pushd $rootDirectory/test/AutoGen.AotCompatibility.Tests/bin/Release/$targetNetFramework/linux-x64 | ||
|
||
Write-Host "Executing test App..." | ||
./AutoGen.AotCompatibility.Tests | ||
Write-Host "Finished executing test App" | ||
|
||
if ($LastExitCode -ne 0) | ||
{ | ||
Write-Host "There was an error while executing AotCompatibility Test App. LastExitCode is:", $LastExitCode | ||
} | ||
|
||
popd | ||
|
||
Write-Host "Actual warning count is:", $actualWarningCount | ||
$expectedWarningCount = 0 | ||
|
||
$testPassed = 0 | ||
if ($actualWarningCount -ne $expectedWarningCount) | ||
{ | ||
$testPassed = 1 | ||
Write-Host "Actual warning count:", actualWarningCount, "is not as expected. Expected warning count is:", $expectedWarningCount | ||
} | ||
|
||
Exit $testPassed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
dotnet/src/AutoGen.Anthropic/Converters/ContentBaseConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
dotnet/test/AutoGen.AotCompatibility.Tests/AutoGen.AotCompatibility.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<PublishAot>true</PublishAot> | ||
<InvariantGlobalization>true</InvariantGlobalization> | ||
<GenerateDocumentationFile>True</GenerateDocumentationFile> | ||
<SelfContained>true</SelfContained> | ||
<IsAotCompatible>true</IsAotCompatible> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<TrimmerRootAssembly Include="AutoGen.Core" /> | ||
<TrimmerRootAssembly Update="@(TrimmerRootAssembly)" Path="$(RepoRoot)\src\%(Identity)\%(Identity).csproj" /> | ||
<ProjectReference Include="@(TrimmerRootAssembly->'%(Path)')" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Program.cs | ||
|
||
Console.WriteLine("Hello, World!"); |