oyvindberg / bleep

A bleeping fast scala build tool!
MIT License
150 stars 22 forks source link

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

Open KaranAhlawat opened 4 months ago

KaranAhlawat commented 4 months ago

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 commented 4 months ago

If you could try two things:

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

KaranAhlawat commented 4 months ago

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.