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

Running sourcegen -w doesn't re-trigger on changes in additional source directories #389

Open
KaranAhlawat opened this issue Jun 20, 2024 · 2 comments

Comments

@KaranAhlawat
Copy link

I have a Smithy project, for which I have written a codegen script. I have then added this script to the project where the Smithy sources reside, and running the codegen works fine.
Now, if I do bleep sourcegen -w shared, where shared is the project with the Smithy sources, it doesn't retrigger the codegen script when I change any of the smithy files, even though the the smithy folder is added as a source root in my bleep.yaml.

As show:

  shared:
    dependencies:
      - com.disneystreaming.smithy4s::smithy4s-core:0.18.22
      - com.disneystreaming.alloy:alloy-core:0.3.8
    extends: template-common
    sources: ./src/smithy
    sourcegen:
      main: Smithy4sCodegen
      project: scripts

Not sure if I'm doing something wrong or missing a piece of configuration. Any help is appreciated :D

@oyvindberg
Copy link
Owner

If you could try two things:

  • move the sources: ./src/smithy to scripts project. changing thing in the shared project shouldn't affect the sourcegen in another project
  • another options is that the sourcegen structure supports a sourceGlobs field, which are for other files read by the sourcegen script outside of the build. I think this is relative to the project folder for shared

It would be great if you can experiment a bit with two options and report back, so we can update the docs

@KaranAhlawat
Copy link
Author

I tried both approaches.

  1. This works well, and the sourceGen is fast enough so no complains here.
  2. This feels like it should work. The description of sourceGlobs says that it is relative to the project of the script. So for me, I should add a sourceGlobs: ../shared/src/smithy to it. That however, doesn't seem to have any effect. Neither does sourceGlobs: ./src/smithy, assuming it's relative to the shared project and not the scripts project.

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

No branches or pull requests

2 participants