Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix race condition on Nuget build #2930

Merged
merged 7 commits into from
Jan 16, 2025
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
35 changes: 22 additions & 13 deletions Stack/Opc.Ua.Core/Opc.Ua.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<Description>OPC UA Core Class Library</Description>
<IsPackable>true</IsPackable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
Expand Down Expand Up @@ -88,23 +89,31 @@

<Target Name="GetPackagingOutputs" />

<!-- Produces a zipped version of the Nodeset 2 to reduce assembly size by 2.7MB ! -->
<ItemGroup>
<EmbeddedResource Include="Schema\Opc.Ua.NodeSet2.xml.zip" />
</ItemGroup>

<!-- Produces a zipped version of the Nodeset 2 to reduce assembly size! -->
<PropertyGroup>
<ZipTmp>$(BaseIntermediateOutputPath)/zipnodeset2</ZipTmp>
<ZipNodeSet2XML>Schema/Opc.Ua.NodeSet2.xml</ZipNodeSet2XML>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ZipTmp>$(BaseIntermediateOutputPath)$(Configuration)/$(TargetFramework)/zipnodeset2</ZipTmp>
<NodeSet2XML>Schema/Opc.Ua.NodeSet2.xml</NodeSet2XML>
<ZipNodeSet2XML>$(BaseIntermediateOutputPath)$(Configuration)/$(TargetFramework)/Opc.Ua.NodeSet2.xml.zip</ZipNodeSet2XML>
</PropertyGroup>

<Target Name="ZipNodeSet2" BeforeTargets="PrepareForBuild" Inputs="$(ZipNodeSet2XML)" Outputs="$(ZipNodeSet2XML).zip">
<Message Text="Zip $(ZipNodeSet2XML) in $(ZipTmp)." Importance="high" />
<Copy SourceFiles="$(ZipNodeSet2XML)" DestinationFolder="$(ZipTmp)" />
<ZipDirectory SourceDirectory="$(ZipTmp)" DestinationFile="$(ZipNodeSet2XML).zip" Overwrite="true" />
<!-- Embed the zipped Nodeset2 file -->
<ItemGroup>
<EmbeddedResource Include="$(ZipNodeSet2XML)" Link="$(NodeSet2XML).zip" />
</ItemGroup>

<!-- Zip the NodeSet2 file -->
<Target Name="ZipNodeSet2" BeforeTargets="PrepareForBuild" Inputs="$(NodeSet2XML)" Outputs="$(ZipNodeSet2XML)">
<Message Text="Zip $(NodeSet2XML) in $(ZipNodeSet2XML)." Importance="high" />
<Copy SourceFiles="$(NodeSet2XML)" DestinationFolder="$(ZipTmp)" />
<ZipDirectory SourceDirectory="$(ZipTmp)" DestinationFile="$(ZipNodeSet2XML)" Overwrite="true" />
<RemoveDir Directories="$(ZipTmp)" />
<Message Text="Zip NodeSet2 completed, $(ZipTmp) removed." Importance="high" />
</Target>


<!-- Clean up the zip file -->
<Target Name="RemoveZipNodeset2" AfterTargets="Clean" Condition="Exists('$(ZipNodeSet2XML)')">
<Message Text="Delete Zip $(ZipNodeSet2XML)" Importance="high"></Message>
<Delete Files="$(ZipNodeSet2XML)"></Delete>
</Target>

</Project>
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ stages:
parameters:
configuration: Release
framework: net6.0
agents: '@{ windows = "windows-2022"; linux="ubuntu-22.04"; mac = "macOS-12"}'
agents: '@{ windows = "windows-2022"; linux="ubuntu-22.04"; mac = "macOS-15"}'
jobnamesuffix: net60
customtestarget: net6.0
- stage: testreleasepr
Expand Down
Loading