Skip to content

Create our own .NET SDKs (OSOE-1208) #1190

@Piedone

Description

@Piedone

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:

  • Orchard Core module, extending Microsoft.NET.Sdk.Razor, adding the .NET framework version, common OC package references, <FrameworkReference Include="Microsoft.AspNetCore.App" />.
  • Orchard Core theme, similar to the module one.
  • Test project with xUnit and Microsoft.NET.Test.Sdk package references. Perhaps separately for unit and UI test projects.
  • Auto-detect LibMan and import our MSBuild Targets project in the Module SDK.
  • Add Renovate custom manager

Questions:

  1. ✅ 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.
  2. ✅ 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.
  3. ✅ 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.
  4. ✅ 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.
  5. ✅ 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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions