Skip to content
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

Use Whippet #282

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Use Whippet #282

wants to merge 10 commits into from

Conversation

Smaug123
Copy link
Owner

@Smaug123 Smaug123 commented Oct 6, 2024

Proof-of-concept of what it looks like to use Whippet instead of Myriad.

<CurriedNoAttr>GenerateMock</CurriedNoAttr>
<TypeWithInterfaceNoAttr>GenerateMock</TypeWithInterfaceNoAttr>
</MyriadParams>
<WhippetFile>MockExampleNoAttributes.fs</WhippetFile>
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the choice to flatten these params, because the contents of this XML node are presented through msbuild only as a string, not as an XML node!

</Compile>
</ItemGroup>

<ItemGroup>
<PackageReference Include="RestEase" Version="1.6.4"/>
<ProjectReference Include="..\WoofWare.Myriad.Plugins.Attributes\WoofWare.Myriad.Plugins.Attributes.fsproj" />
<ProjectReference Include="..\WoofWare.Myriad.Plugins\WoofWare.Myriad.Plugins.fsproj" PrivateAssets="all" />
<PackageReference Include="Myriad.Sdk" Version="0.8.3" PrivateAssets="all" />
<ProjectReference Include="..\WoofWare.Myriad.Plugins\WoofWare.Myriad.Plugins.fsproj" PrivateAssets="all" WhippetPlugin="true" />
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now all you need to do is add WhippetPlugin="true" and that's all the plugin registration done.

@@ -47,6 +47,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1"/>
<PackageReference Include="NUnit" Version="4.2.2"/>
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0"/>
<PackageReference Include="RestEase" Version="1.6.4"/>
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dunno why this transitive reference became required.

interface IMyriadGenerator with
member _.ValidInputExtensions = [ ".fs" ]
interface IGenerateRawFromRaw with
member _.GenerateRawFromRaw (context : RawSourceGenerationArgs) =
Copy link
Owner Author

@Smaug123 Smaug123 Oct 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the most basic API on which all other APIs are built. I intend adding optional convenience APIs on top, eventually, but this API shape is how we get the most modular design (which e.g. allows the consumer to freely upgrade Fantomas).

@Smaug123 Smaug123 mentioned this pull request Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant