Skip to content
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ jobs:
steps:

- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

# -----
# Setup .NET sdk
# -----

- name: Install .NET SDKs
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
Expand Down
4 changes: 3 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,6 @@ for:
# upload packages to AppVeyor
artifacts:
- path: build\*.nupkg
name: core
name: library
- path: build\*.snupkg
name: symbols
10 changes: 5 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ echo ---------------------------
echo Running NET8.0 Tests
echo ---------------------------

dotnet ./src/Castle.Core.Tests/bin/Release/net8.0/Castle.Core.Tests.dll --result=Net80TestResults.xml;format=nunit3
dotnet ./src/Castle.Core.Tests.WeakNamed/bin/Release/net8.0/Castle.Core.Tests.WeakNamed.dll --result=Net80WeakNamedTestResults.xml;format=nunit3

dotnet test ./src/Castle.Core.Tests -f net8.0 -c Release --no-build -- NUnit.TestOutputXml="$PWD" NUnit.TestOutputXmlFileName="Net80TestResults"
dotnet test ./src/Castle.Core.Tests.WeakNamed -f net8.0 -c Release --no-build -- NUnit.TestOutputXml="$PWD" NUnit.TestOutputXmlFileName="Net80WeakNamedTestResults"
# Ensure that all test runs produced a protocol file:
if [[ !( -f Net80TestResults.xml &&
-f Net80WeakNamedTestResults.xml ) ]]; then
Expand All @@ -48,8 +48,8 @@ echo ---------------------------
echo Running NET9.0 Tests
echo ---------------------------

dotnet ./src/Castle.Core.Tests/bin/Release/net9.0/Castle.Core.Tests.dll --result=Net90TestResults.xml;format=nunit3
dotnet ./src/Castle.Core.Tests.WeakNamed/bin/Release/net9.0/Castle.Core.Tests.WeakNamed.dll --result=Net90WeakNamedTestResults.xml;format=nunit3
dotnet test ./src/Castle.Core.Tests -f net9.0 -c Release --no-build -- NUnit.TestOutputXml="$PWD" NUnit.TestOutputXmlFileName="Net90TestResults"
dotnet test ./src/Castle.Core.Tests.WeakNamed -f net9.0 -c Release --no-build -- NUnit.TestOutputXml="$PWD" NUnit.TestOutputXmlFileName="Net90WeakNamedTestResults"

# Ensure that all test runs produced a protocol file:
if [[ !( -f Net90TestResults.xml &&
Expand Down
12 changes: 6 additions & 6 deletions buildscripts/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ echo --------------------
echo Running NET462 Tests
echo --------------------

src\Castle.Core.Tests\bin\%Configuration%\net462\Castle.Core.Tests.exe --result=DesktopClrTestResults.xml;format=nunit3 || exit /b 1
src\Castle.Core.Tests.WeakNamed\bin\%Configuration%\net462\Castle.Core.Tests.WeakNamed.exe --result=DesktopClrWeakNamedTestResults.xml;format=nunit3 || exit /b 1
dotnet test src\Castle.Core.Tests -f net462 -c %Configuration% --no-build -- NUnit.TestOutputXml="%CD%" NUnit.TestOutputXmlFileName="DesktopClrTestResults" || exit /b 1
dotnet test src\Castle.Core.Tests.WeakNamed -f net462 -c %Configuration% --no-build -- NUnit.TestOutputXml="%CD%" NUnit.TestOutputXmlFileName="DesktopClrWeakNamedTestResults" || exit /b 1

echo ---------------------------
echo Running NET8.0 Tests
echo ---------------------------

dotnet .\src\Castle.Core.Tests\bin\%Configuration%\net8.0\Castle.Core.Tests.dll --result=Net80TestResults.xml;format=nunit3 || exit /b 1
dotnet .\src\Castle.Core.Tests.WeakNamed\bin\%Configuration%\net8.0/Castle.Core.Tests.WeakNamed.dll --result=Net80WeakNamedTestResults.xml;format=nunit3 || exit /b 1
dotnet test src\Castle.Core.Tests -f net8.0 -c %Configuration% --no-build -- NUnit.TestOutputXml="%CD%" NUnit.TestOutputXmlFileName="Net80TestResults" || exit /b 1
dotnet test src\Castle.Core.Tests.WeakNamed -f net8.0 -c %Configuration% --no-build -- NUnit.TestOutputXml="%CD%" NUnit.TestOutputXmlFileName="Net80WeakNamedTestResults" || exit /b 1

echo ---------------------------
echo Running NET9.0 Tests
echo ---------------------------

dotnet .\src\Castle.Core.Tests\bin\%Configuration%\net9.0\Castle.Core.Tests.dll --result=Net90TestResults.xml;format=nunit3 || exit /b 1
dotnet .\src\Castle.Core.Tests.WeakNamed\bin\%Configuration%\net9.0/Castle.Core.Tests.WeakNamed.dll --result=Net90WeakNamedTestResults.xml;format=nunit3 || exit /b 1
dotnet test src\Castle.Core.Tests -f net9.0 -c %Configuration% --no-build -- NUnit.TestOutputXml="%CD%" NUnit.TestOutputXmlFileName="Net90TestResults" || exit /b 1
dotnet test src\Castle.Core.Tests.WeakNamed -f net9.0 -c %Configuration% --no-build -- NUnit.TestOutputXml="%CD%" NUnit.TestOutputXmlFileName="Net90WeakNamedTestResults" || exit /b 1
11 changes: 10 additions & 1 deletion buildscripts/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<PropertyGroup>
<LangVersion>14.0</LangVersion>
<NoWarn>$(NoWarn);CS1591;CS3014;CS3003;CS3001;CS3021</NoWarn>
<NoWarn>$(NoWarn);CS0612;CS0618</NoWarn> <!-- TODO: Remove this line once `[Obsolete]` members have been dealt with. -->
<NoWarn>$(NoWarn);CS0612;CS0618</NoWarn>
<!-- TODO: Remove this line once `[Obsolete]` members have been dealt with. -->
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/castleproject/Core</RepositoryUrl>
<BuildVersion>0.0.0</BuildVersion>
Expand Down Expand Up @@ -32,6 +33,14 @@
<ContentTargetFolders>.</ContentTargetFolders>
</PropertyGroup>

<PropertyGroup Condition="'$(CI)' == 'True'">
<!--Deterministic Build and Source Link settings -->
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
Comment on lines +36 to +42
Copy link
Member

@stakx stakx Jan 3, 2026

Choose a reason for hiding this comment

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

I'm noticing that on local builds, we still get (legacy?) .symbols.nupkg files (like before), while on CI, we get .snupkg files. I am not sure whether the former symbols package format makes particular sense for local builds... but I suspect not.

Perhaps it might be better to put both <IncludeSymbols> and <SymbolPackageFormat> in a non-conditional <PropertyGroup>, such that we always get the same symbols package format.

Or do you have a better recommendation?

Copy link
Contributor Author

@Romfos Romfos Jan 3, 2026

Choose a reason for hiding this comment

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

As for me - better solution is to implement it in a right way via dotnet pack and pass this CI = true

https://github.com/Romfos/Core/blob/47eceaf738b4de367a3469f5bc10f52e8eb82dc3/.github/workflows/release.yml#L29

some articles:
https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#continuousintegrationbuild

When set to true, this property enables settings that only apply to official builds as opposed to local builds on a developer machine. 
For example, stored file paths are normalized for official builds. 
But on a local development machine, the debugger isn't able to find local source files if file paths are normalized.

for now this change is not in production =)

Copy link
Member

@stakx stakx Jan 3, 2026

Choose a reason for hiding this comment

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

We're not quite there yet however.

Are you saying that non-CI builds should not emit any NuGet packages at all? In that case we'd still need to change something here.

(Note that I wasn't suggesting taking the <ContinuousIntegrationBuild> out of the conditional group – that one clearly belongs there. I was referring only to the two last properties.)

Copy link
Contributor Author

@Romfos Romfos Jan 3, 2026

Choose a reason for hiding this comment

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

You can build nuget packages locally but probably you don't want to publish to nuget your local package symbols that could contains your local file paths, maybe other sensitive information

As I understand best practice here is to use it on CI

sorry, maybe I'm not filly understand this topic


<ItemGroup>
<Content Include="..\..\CHANGELOG.md" />
<Content Include="..\..\LICENSE" Pack="True" PackagePath="" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,25 @@
</PropertyGroup>

<PropertyGroup>
<OutputType>Exe</OutputType>
<Authors>Castle Contributors</Authors>
<AssemblyName>Castle.Core.Tests.WeakNamed</AssemblyName>
<RootNamespace>Castle</RootNamespace>
<Version>0.0.0.0</Version>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<SignAssembly>False</SignAssembly>
<PublicSign Condition="'$(OS)'=='Unix'">false</PublicSign>
<StartupObject>Program</StartupObject>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\Castle.Core\DynamicProxy\Generators\Emitters\StrongNameUtil.cs" Link="DynamicProxy.Tests\StrongNameUtil.cs" />
</ItemGroup>


<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="6.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Castle.Core\Castle.Core.csproj" />
<ProjectReference Include="..\Castle.Core.Tests\Castle.Core.Tests.csproj" />
Expand Down
13 changes: 0 additions & 13 deletions src/Castle.Core.Tests.WeakNamed/Program.cs

This file was deleted.

11 changes: 5 additions & 6 deletions src/Castle.Core.Tests/Castle.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
</PropertyGroup>

<PropertyGroup>
<OutputType>Exe</OutputType>
<Authors>Castle Contributors</Authors>
<AssemblyName>Castle.Core.Tests</AssemblyName>
<RootNamespace>Castle</RootNamespace>
Expand All @@ -16,7 +15,7 @@
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\buildscripts\CastleKey.snk</AssemblyOriginatorKeyFile>
<PublicSign Condition="'$(OS)'=='Unix'">true</PublicSign>
<StartupObject>Program</StartupObject>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup Condition="'$([MSBuild]::GetTargetFrameworkIdentifier(&quot;$(TargetFramework)&quot;))' == '.NETFramework'">
Expand All @@ -42,9 +41,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
<PackageReference Include="NUnitLite" Version="3.14.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="6.0.1" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="Serilog.Sinks.TextWriter" Version="2.1.0" />
</ItemGroup>

Expand All @@ -59,7 +58,7 @@
<ItemGroup Condition=" '$(TargetFrameworkIdentifier)' != '.NETFramework' ">
<PackageReference Include="System.Diagnostics.EventLog" Version="8.0.2" />
<PackageReference Include="System.Security.Permissions" Version="8.0.0" />
<PackageReference Include="PublicApiGenerator" Version="11.4.6" />
<PackageReference Include="PublicApiGenerator" Version="11.5.4" />
</ItemGroup>

</Project>
13 changes: 0 additions & 13 deletions src/Castle.Core.Tests/Program.cs

This file was deleted.

1 change: 1 addition & 0 deletions tools/Explicit.NuGet.Versions/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ private static void WriteNuspecToPackages(Dictionary<string, NuspecContentEntry>
{
using (var zipFile = ZipFile.Open(packageFile.Key, ZipArchiveMode.Update))
{
zipFile.GetEntry(packageFile.Value.EntryName).Delete();
using (var stream = new StreamWriter(zipFile.CreateEntry(packageFile.Value.EntryName).Open()))
{
stream.Write(packageFile.Value.Contents);
Expand Down