Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/AI/AI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,14 @@
<None Include="..\..\osmfeula.txt" Link="osmfeula.txt" PackagePath="OSMFEULA.txt" />
</ItemGroup>

<Target Name="UpdateSdkPreviewVersion" BeforeTargets="GetPackageContents">
<!-- Update packaging version targets -->
<XmlPoke XmlInputPath="$(MSBuildProjectDirectory)\Devlooped.Extensions.AI.targets"
Query="/Project/PropertyGroup/BuiltWithSdkPreview"
Value="$(_NETCoreSdkIsPreview)"/>
<XmlPoke XmlInputPath="$(MSBuildProjectDirectory)\Devlooped.Extensions.AI.targets"
Query="/Project/PropertyGroup/BuiltSdkPreviewVersion"
Value="$(NETCoreSdkVersion)"/>
</Target>

</Project>
10 changes: 8 additions & 2 deletions src/AI/Devlooped.Extensions.AI.targets
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<Project>

<Project>
<PropertyGroup>
<BuiltWithSdkPreview>true</BuiltWithSdkPreview>
<BuiltSdkPreviewVersion>10.0.100-preview.7.25380.108</BuiltSdkPreviewVersion>
</PropertyGroup>
<Target Name="EnsureSamePreviewSdkVersion" BeforeTargets="Build" Condition="'$(BuiltWithSdkPreview)' == 'true'">
<Error Condition="'$(_NETCoreSdkIsPreview)' == 'false' or '$(NETCoreSdkVersion)' != '$(BuiltSdkPreviewVersion)'" Text="This version was built with a preview SDK and requires a matching one. Please install SDK version $(BuiltSdkPreviewVersion) or update to a newer package version." />
Copy link

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The condition logic could be clearer by separating the two error cases. Consider using separate Error elements for when SDK is not preview vs when versions don't match, as these are different problems requiring different solutions.

Suggested change
<Error Condition="'$(_NETCoreSdkIsPreview)' == 'false' or '$(NETCoreSdkVersion)' != '$(BuiltSdkPreviewVersion)'" Text="This version was built with a preview SDK and requires a matching one. Please install SDK version $(BuiltSdkPreviewVersion) or update to a newer package version." />
<Error Condition="'$(_NETCoreSdkIsPreview)' == 'false'" Text="This version was built with a preview SDK. Please use a preview .NET SDK (version $(BuiltSdkPreviewVersion) or newer)." />
<Error Condition="'$(_NETCoreSdkIsPreview)' == 'true' and '$(NETCoreSdkVersion)' != '$(BuiltSdkPreviewVersion)'" Text="This version was built with .NET SDK version $(BuiltSdkPreviewVersion). Please install and use this SDK version, or update to a newer package version." />

Copilot uses AI. Check for mistakes.
</Target>
</Project>
Loading