GithubHelp home page GithubHelp logo

Comments (10)

Piedone avatar Piedone commented on June 12, 2024 1

Yeah, I understood it as such. Just that we publish all of our open-source projects using package.jsons on NuGet, so that'll affect their NuGet publishing (e.g. https://github.com/Lombiq/Orchard-Chart.js, https://github.com/Lombiq/Orchard-Content-Editors, https://github.com/Lombiq/Orchard-Data-Tables).

from helpful-libraries.

Piedone avatar Piedone commented on June 12, 2024

Hmm, very interesting! This would be especially useful for updates done by Dependabot.

from helpful-libraries.

AydinE avatar AydinE commented on June 12, 2024

I've been looking into this issue and playing around with source generators as I've never worked on one before.
There are a few findings that I wanted to share here and get some feedback

The classes that will be marked with the attribute [ConstantFromJson("ChartJsVersion", "package.json", "$..['chart.js']")] will need to be marked as partial: also see Source Generators cookbook
I am assuming that it won't be an issue to mark them as partial but wanted to just call it out.

Also in order to make the package.json file accessible to the generator it would have to be marked as an "AdditionalFiles" in the .csproj as source generators do not have access to the filesystem directly.

I am setting this up as a separate project within this repo for now, let me know if there are any thoughts around that.

from helpful-libraries.

Piedone avatar Piedone commented on June 12, 2024

Partial shouldn't be an issue, nor AdditionalFiles I think but the latter also affects NuGet publishing. Perhaps it'd only result in an unnecessary file being bundled in the package, which is not a significant issue, but I don't know if it can break anything else.

from helpful-libraries.

AydinE avatar AydinE commented on June 12, 2024

Hey @Piedone,

The marking of the AdditionalFiles is actually for the projects that will use the generator not on the generator itself. So the consuming projects would have to mark those files in their own .csproj so that the generator can access them at compile time

from helpful-libraries.

Piedone avatar Piedone commented on June 12, 2024

I get build errors locally with a fresh clone of OSOCE:

Build log.txt

image

Repeated builds also fail.

from helpful-libraries.

Piedone avatar Piedone commented on June 12, 2024

The earlier OSOCE 509442daa9bdc7dc060d8a0196b8e803881af293 also shows this:

image

from helpful-libraries.

sarahelsaig avatar sarahelsaig commented on June 12, 2024

Considering that it works with dotnet but not with VS, perhaps this is a VS bug. Then @AydinE please make a bug report.

from helpful-libraries.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.