MoiraeSoftware / myriad

Myriad is a code generator for F#
https://moiraesoftware.github.io/myriad/
Apache License 2.0
344 stars 43 forks source link

Cut all dependencies from Myriad.Sdk #174

Closed Smaug123 closed 8 months ago

Smaug123 commented 9 months ago

The point is that while Myriad itself has strict requirements for which FSharp.Core, FCS, Fantomas versions it's using, there's no need to propagate those requirements to consumers who merely want to invoke Myriad. (This is a pretty serious handicap at the moment if you want to use Myriad through MSBuild in a project that also imports FCS at a different version.)

I'm not super confident in the correctness of this change, but I have tested it as follows, which makes me perhaps 75% sure it's correct.

7sharp9 commented 8 months ago

Im sat thinking how this stuff is supposed to work...

I think the stuff the sdk needs is merged in via the command like so there is no direct dependecy as the paket import suggests, I think :-/

7sharp9 commented 8 months ago
<Exec Command='dotnet mergenupkg --source "$(NupkgsDir)/Myriad.Sdk.$(Version).nupkg" --other "$(NupkgsDir)/Myriad.$(Version).nupkg" --tools --only-files' />

So technically the myraid package is a dependency but for sdk use we smush it together, I think this was a limitation with the tools stuff but I forget now...

Smaug123 commented 8 months ago

I think people writing plugins should depend on Core, not SDK; and I haven't yet found a reason SDK needs any deps, because they all seem to be packaged into the tool without reference to the nuget cache, in my testing.

7sharp9 commented 8 months ago

Yes, mergenupkg merges the two packages.

Smaug123 commented 8 months ago

Ah sorry, I misunderstood your previous post - thanks!