Zaid-Ajaj / Snowflaqe

A dotnet CLI to generate type-safe GraphQL clients for F# and Fable with automatic deserialization, static query verification and type checking
MIT License
154 stars 25 forks source link

[MSBuild] Smart way to generate code only if changed #58

Open xperiandri opened 2 years ago

xperiandri commented 2 years ago

I suppose we need to create a cache file with the MSBuild task version and a map of the file name and its hash. In the next generation, the task will read the cache and compare the MSBuild task version. If it is different then remove all and generate. Then compare files lists, if they are equivalent then hash each file and compare hashes. If lists are different or any GraphQL file is different, then remove all and generate.

@dim-37 @Zaid-Ajaj what do you think?

njlr commented 2 years ago

I would definitely keep an eye on Bazel, which excels at this kind of thing. The F# rules are still pretty early though: https://github.com/bazelbuild/rules_dotnet