#@Win I have a question about the dotnet

1 messages ยท Page 1 of 1 (latest)

chilly nova
#

๐Ÿ‘‹ hi.

dense smelt
# chilly nova ๐Ÿ‘‹ hi.

๐Ÿ‘‹ I was trying to understand what dagger call sdk dotnet generate does. It look like it only exports sdk/dotnet/sdk/Dagger.SDK/introspection.json? But then it's git-ignored

#

I think I understand now, basically we don't publish a generated .net client lib at all - to use the SDK, users need to checkout the dagger repo, call generate locally, then build their app in their IDE - and the client library is generated a compile time by the .net compiler?

chilly nova
light orbit
#

Ideally the source generator would be published along with the Dagger.SDK would be published as a NuGet package, this package could be pulled into a '.dagger' C# project, and *that project, when dagger initalizes it, e.g dagger init --sdk=c#/dotnet it also

  1. creates the developers MyDaggerModule.csproj (and even this is no longer needed in .NET10) it could maybe create a /sdk/introspection.json)

  2. when the user builds it triggers the .NET Analyzers to kick in, one of which, is the Dagger.SDK nuget package (which has the source generator .net 2.0 library also referenced) and then boom, the sdk is generated at build time

#

I kind of think the only thing we would need to publish is a Source Generator netstandard2.0 nuget package.

dagger init --sdk=dotnet would then

Create a project for the developer, using latest version of .NET available, but that could be customized after the inital template, so long as the source generator is .NET Standard 2.0 library it can be used by any .NET runtime in theory, .NET Framework (eh, dont see this happening without windows containers since .NET Framework is limited to Windows OS only)

But for our 'template' sake, we create a empty project for the user, and it pulls in 1 package from nuget.org published by dagger: Dagger.SDK (which itself is the source generator)

Along with this, the dagger init --sdk=dotnet also injects a introspection.json file, allowing the source generator to produce the SDK on the fly/build time.

#

a nuget package can be sourced locally from a .nupkg file (.NET basically uses zip files for packages) its just rebranded or a registry. So could be used to make testing easier for loading/referencing the nuget package