With custom .NET SDKs, we can further DRY projects by adding common code that would normally go into csproj files, to cut down repetition between projects. This would also reduce the amount of Renovate updates in submodules. Check out this blog post for details and inspiration, but, for example, we could have the following SDKs:
Questions:
- ✅ How would this work with both submodules and NuGet packages?
- No local SDKs, but we can
<Import> the props and targets files.
<Sdk Name="name" Version="version" /> can't use Condition, but we can use <Import Project="Sdk.props" Sdk="name" Version="version" /> which is still much better than a Targets NuGet package.
- ✅ How can Renovate handle updates, within the SDKs (like, is it simply updating package references there too)?
- The SDK just contains props and targets files, which should already work with Renovate.
- ✅ How can Renovate handle updates of the references to SDKs in consumer projects?
- We have to figure out if
<Import Project="..." Sdk="..." Version="..." /> is detected by Renovate or not. I'd guess probably not and we will have to add a custom resolver.
- ✅ We'd version the SDK references, but then how can we avoid e.g. having to update that in all test projects when the xUnit version is updated in the test SDK?
- This is why we should only include high impact packages such as HL and UITT in the SDK. When we have to update those, it cascades down anyway.
- ✅ Can we just use the latest version when in submodules? (Kind of how submodules have version-less references to other projects coming from submodules, but use concrete versions in NuGet package references.)
- There is no versioning when using submodules (we don't want to, but it's also not even possible).
Jira issue
With custom .NET SDKs, we can further DRY projects by adding common code that would normally go into csproj files, to cut down repetition between projects. This would also reduce the amount of Renovate updates in submodules. Check out this blog post for details and inspiration, but, for example, we could have the following SDKs:
Microsoft.NET.Sdk.Razor, adding the .NET framework version, common OC package references,<FrameworkReference Include="Microsoft.AspNetCore.App" />.Microsoft.NET.Test.Sdkpackage references. Perhaps separately for unit and UI test projects.Questions:
<Import>the props and targets files.<Sdk Name="name" Version="version" />can't useCondition, but we can use<Import Project="Sdk.props" Sdk="name" Version="version" />which is still much better than a Targets NuGet package.<Import Project="..." Sdk="..." Version="..." />is detected by Renovate or not. I'd guess probably not and we will have to add a custom resolver.Jira issue