-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
module support #7
base: main
Are you sure you want to change the base?
Conversation
@@ -320,7 +320,7 @@ private static string RenderArgumentValue(InputValue arg, bool addVarSuffix = fa | |||
} | |||
} | |||
|
|||
throw new Exception($"The type {arg.Type.OfType.Kind} should not be enter here."); | |||
throw new Exception($"The argument {arg} should not be enter here."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not be entered
This is looking exciting 👍 |
UPDATE: I just getting register module and simple invoke works in |
potato/dagger/Potato/Program.cs
Outdated
{ | ||
var potato = JsonSerializer.Deserialize<Potato.Potato>(ParentJson.Value); | ||
Debug.Assert(potato != null, nameof(potato) + " != null"); | ||
return await potato.Echo("C#"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just hit a bug that program got crash when asking input args. So I do temporary hard code argument here to make it works.
4546383
to
b2b38f9
Compare
@@ -0,0 +1,13 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the source generator plan is going well, we don't need this package anymore. 🎉
namespace Dagger.SDK.Mod.SourceGenerator.Tests; | ||
|
||
[TestClass] | ||
public class SourceGeneratorTests : VerifyBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have discussion with Microsoft team in C# discord. They're recommended me to use https://www.nuget.org/packages/Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing#supportedframeworks-body-tab rather than Verify
. I don't see much example from it but it would be nice if we strict with the Microsoft tools.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I thought I had added here: https://github.com/wingyplus/dagger-dotnet-sdk/blob/main/sdk/Dagger.SDK.SourceGenerator/Dagger.SDK.SourceGenerator.Tests/Dagger.SDK.SourceGenerator.Tests.csproj#L17
postInitializationContext.AddSource("Dagger.SDK.Mod_Attributes.g.cs", ModuleAttributesSource()); | ||
postInitializationContext.AddSource("Dagger.SDK.Mod_Interfaces.g.cs", ModuleInterfacesSource()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm current stuck with the unit tests because in unit test, it has no reference to the Dagger.SDK.Mod
, cause it to fail because it cannot find any class related to our SDK. That's why I put it to generator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its difficult to convert to source generator once starting with reflection. It makes you need to change how to design/solution with TDD from the beginning
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Dagger.SDK.Mod hold the logic for construct and invoke function. Current implmentation using `System.Reflection` to scan class and method. Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
And fix bug return list type broken. Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Introduce a library to uses for generate sources via Source Generator. Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Tasks
Dagger.Module
for registering to the Dagger Engine.Potato.Potato
for example) and generate child type from their.Dagger.SDK
support JSON serializationDagger.Container
must serialize intoDagger.ContainerID.Value
and deserialize it back.Dagger.SDK.SourceGenerator
by implementing json converter.Idea on the next PR
Codegen
get call.RemoveDagger.SDK.Mod
?Closes #3