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
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Key mechanics (defined in `src/Directory.Build.props` and `test/Directory.Build.
- **ANTLR expression parser**: the grammar is `src/Spring/Spring.Core/Expressions/Expression.g`. The generated lexer/parser under `Expressions/Parser/` and a vendored, hand-patched ANTLR 2.7.7 runtime under `Expressions/Parser/antlr/` are **committed — never hand-edit generated files**; regenerate with `./build.cmd Antlr` (see `src/Spring/Spring.Core/README_ANTLR.txt`).
- **Versioning**: the git tag is the version authority (`v3.1.0` → 3.1.0); untagged builds fall back to the `ProjectVersion` placeholder in `build-support/build/Build.cs` plus a `dev-`/`preview-` suffix. Publishing runs from the tag workflow only. `DetermineVersion()` sets three distinct facets, applied to **both** `Compile` and `Pack` so packaged and `bin/` assemblies agree: `AssemblyVersion` is pinned to `major.minor.0.0` (the assemblies are strong-named, so this is their binding identity — keeping it stable across patches means consumers need no new binding redirect for a fix release), `FileVersion` carries the exact numeric version, and `InformationalVersion` is left to MSBuild so SourceLink can append `+<sha>`. Never set a bare `Version` property instead — it overrides the prefix/suffix composition and silently drops the preview suffix.
- **Trusted publishing**: `.github/workflows/publish.yml` is the only workflow allowed to push to nuget.org. It needs `permissions: id-token: write` and `environment: nuget`; the `Publish` target exchanges that OIDC token for a short-lived API key in `build-support/build/Build.Publish.cs`. The nuget.org policy is keyed to the **workflow filename** `publish.yml` plus the `nuget` environment, so renaming, moving or splitting that workflow breaks publishing until the policy is updated. Do not reintroduce a `NUGET_API_KEY` secret — the `NuGetApiKey` parameter stays only as a manual override.
- **Package READMEs and package validation**: every packable project under `src/Spring` has a `README.md` next to its csproj, which `src/Directory.Build.props` packs as the NuGet readme; a new package needs one (what it does, `dotnet add package`, target frameworks, a minimal snippet whose types, members and XML are checked against the code, and links). Pack also runs package validation (`EnablePackageValidation`) against the 3.1.0 packages (`PackageValidationBaselineVersion`) and between the target frameworks of one package; never suppress a difference between two TFMs of one package (Spring.Messaging turns validation off for that reason, see its csproj). Accepted baseline differences live in each project's `CompatibilitySuppressions.xml`; regenerate one with `dotnet pack <csproj> -c Release -p:ApiCompatGenerateSuppressionFile=true -p:AssemblyVersion=<major>.<minor>.0.0` and review the diff. A direct `dotnet pack` needs that `-p:AssemblyVersion=<major>.<minor>.0.0` (what Fallout passes), because the default 1.0.0.0 is below the baseline and fails with CP0003; do not gate the baseline on AssemblyVersion, since Fallout's Restore passes no version and the baseline download would vanish. The baseline has a coverage gap: 3.1.0 shipped net462, which no 4.0 asset is compatible with, so Spring.Web, Spring.Web.Mvc5, Spring.Web.Conversation.NHibernate5 and Spring.Testing.NUnit get no baseline API comparison (PKV006), and for the other packages the 3.1.0 net462 asset is compared with the 4.0 netstandard2.0 build, so no net472 build is compared with 3.1.0. The gap closes when the baseline moves to 4.0.0 once 4.0.0 ships; then delete the 3.1.0 suppression files.
- In test projects, `ILog` is a global using alias for `Microsoft.Extensions.Logging.ILogger`.

## Code style
Expand Down
12 changes: 6 additions & 6 deletions BreakingChanges.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ Changes (3.1 to 4.0)
7. Spring.Aop no longer depends on Antlr3.Runtime.

8. The libraries now include a net10.0 build (Spring.Core, Spring.Aop, Spring.Data,
Spring.Data.NHibernate5, Spring.Messaging, Spring.Messaging.Nms and Spring.Scheduling.Quartz3
target netstandard2.0, net472 and net10.0). NuGet picks lib/net10.0 on .NET 10, where
.NET 10 applications used the netstandard2.0 build before. Applications on .NET 8 and .NET 9
keep getting the netstandard2.0 build. Spring.Testing.Microsoft stays netstandard2.0 and
net472. Spring.Testing.NUnit targets net10.0 and net472 (see item 9).
Spring.Data.NHibernate5, Spring.Messaging, Spring.Messaging.Nms, Spring.Scheduling.Quartz3 and
Spring.Testing.Microsoft target netstandard2.0, net472 and net10.0). NuGet picks lib/net10.0
on .NET 10, where .NET 10 applications used the netstandard2.0 build before. Applications on
.NET 8 and .NET 9 keep getting the netstandard2.0 build. Spring.Testing.NUnit targets net10.0
and net472 (see item 9).
- Partial-trust (medium-trust) hosting is no longer supported. Code runs with the caller's
trust only: the ExecutePrivileged wrappers and the permission demands are gone.
- Code access security is gone. SecurityPermission demands, the SecurityCritical and
Expand Down Expand Up @@ -108,7 +108,7 @@ Changes (3.1 to 4.0)
C# versions use NUnit.Framework.Legacy.ClassicAssert or Assert.That. StringAssert,
CollectionAssert, FileAssert and DirectoryAssert remain in NUnit.Framework.
- Spring.Testing.Microsoft requires MSTest.TestFramework 4.5.2 or later (was 3.4.3). The base classes
are source compatible with it, and still build for netstandard2.0 and net472.
are source compatible with it, and build for netstandard2.0, net472 and net10.0.

Changes (3.0.x to 3.1)
========================
Expand Down
17 changes: 16 additions & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
<PackageIconUrl>https://springframework.net/images/SpringSource_Leaves32x32.png</PackageIconUrl>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://www.springframework.net/</PackageProjectUrl>
<PackageTags>Library</PackageTags>
<!-- Each project appends its own terms: <PackageTags>$(PackageTags);aop</PackageTags> -->
<PackageTags>spring;springframework;ioc;di</PackageTags>

<NeutralLanguage>en-US</NeutralLanguage>

Expand All @@ -34,6 +35,11 @@

<TreatWarningsAsErrors>True</TreatWarningsAsErrors>

<!-- Pack-time API compatibility checks: against the previous major's packages, and between the TFMs of one package.
The baseline moves to 4.0.0 once 4.0.0 ships. Accepted differences are in each project's CompatibilitySuppressions.xml. -->
<EnablePackageValidation>true</EnablePackageValidation>
<PackageValidationBaselineVersion>3.1.0</PackageValidationBaselineVersion>

<ComVisible>False</ComVisible>

<DebugSymbols>True</DebugSymbols>
Expand Down Expand Up @@ -67,4 +73,13 @@
<None Include="..\..\SpringSource_Leaves32x32.png" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>

<!-- A README.md next to the project file becomes the package's readme on nuget.org. -->
<PropertyGroup Condition=" Exists('$(MSBuildProjectDirectory)\README.md') ">
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup Condition=" Exists('$(MSBuildProjectDirectory)\README.md') ">
<None Include="README.md" Pack="true" PackagePath="" />
</ItemGroup>

</Project>
25 changes: 25 additions & 0 deletions src/Spring/Spring.Aop/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- https://learn.microsoft.com/dotnet/fundamentals/package-validation/diagnostic-ids -->
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Suppression>
<DiagnosticId>CP0008</DiagnosticId>
<Target>T:AopAlliance.Aop.AspectException</Target>
<Left>lib/net462/Spring.Aop.dll</Left>
<Right>lib/netstandard2.0/Spring.Aop.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0008</DiagnosticId>
<Target>T:Spring.Aop.Framework.Adapter.UnknownAdviceTypeException</Target>
<Left>lib/net462/Spring.Aop.dll</Left>
<Right>lib/netstandard2.0/Spring.Aop.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0008</DiagnosticId>
<Target>T:Spring.Aop.Framework.AopConfigException</Target>
<Left>lib/net462/Spring.Aop.dll</Left>
<Right>lib/netstandard2.0/Spring.Aop.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
</Suppressions>
41 changes: 41 additions & 0 deletions src/Spring/Spring.Aop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Spring.Aop

Aspect-oriented programming for Spring.NET: dynamic proxies, advice (before, after, around, throws), advisors and
pointcuts, and the `aop:` XML namespace for applying them to objects declared in a Spring container. Interceptors
implement the AOP Alliance interfaces.

```
dotnet add package Spring.Aop
```

Target frameworks: netstandard2.0, net472, net10.0. Depends on Spring.Core.

## Usage

Wrap a target in a proxy that runs an interceptor around every call to the target's interfaces:

```csharp
using AopAlliance.Intercept;
using Spring.Aop.Framework;

public class LoggingInterceptor : IMethodInterceptor
{
public object Invoke(IMethodInvocation invocation)
{
Console.WriteLine("Calling {0}", invocation.Method.Name);
return invocation.Proceed();
}
}

var factory = new ProxyFactory(new OrderService());
factory.AddAdvice(new LoggingInterceptor());
var service = (IOrderService) factory.GetProxy();
```

`OrderService` is your own class and implements `IOrderService`.

## Links

- [Spring.NET website](https://www.springframework.net/)
- [GitHub repository](https://github.com/spring-projects/spring-net)
- [Breaking changes since 3.x](https://github.com/spring-projects/spring-net/blob/main/BreakingChanges.txt)
1 change: 1 addition & 0 deletions src/Spring/Spring.Aop/Spring.Aop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;$(TargetFullFrameworkVersion);$(TargetModernFrameworkVersion)</TargetFrameworks>
<Description>Interfaces and classes that provide AOP support in Spring.Net</Description>
<PackageTags>$(PackageTags);aop;proxy;interception</PackageTags>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading
Loading