<#C01SPQQ2WK1|> I'm Nadir and started wearing :jea...
# general
a
#C01SPQQ2WK1 I'm Nadir and started wearing 👖 🥳 , awesome project!!! I'm creating a Conventional Commits plugins to handle
git tags
,
automatic versioning
and
changelog
I already have this working using
GeneratedSources
but I want the output of the files to be in the monorepo package dir, I didn't find something on the docs and I was curious how can I create the files in the desired folder 10x! 🙏
b
Just to clarify the question: are you wanting to output the files into
dist/
when running a command like
pants package ::
? Or maybe something else?
a
@broad-processor-92400 thanks for responding Lets say I have the following structure
root
| dist
| src
| project1
| project2
In my implementation the generated sources are written in ‘/dist’ but this directory is in .gitignore So I want the generated sources to be in the project folder so they can be committed and also they will be in the corresponding place where other developers will see the files
i also want those files to be included in the package But my first need is to include them in the git repo
pls, can someone point on how generated sources can be put in the src folder?
b
a
10x @broad-processor-92400 just curious there is no other way?
b
That's the way I do it, others may do something else. The rest of that post is talking about a future possibility for similar problems
a
I do run the code with
pants export-codegen ::
and created a dedicated target
conventional_commits(version=True, changelog=True, tag=True)
and I do it with an
ExternalTool
so it can be download and used as a plugin in any project and then I use the
GeneratedSources
with Snapshot so how can I add this part
Copy code
run_shell_command(
    name="write-foo",
    # different file name so that they can be compared in the test
    command="cp {chroot}/path/to/foo-generated.txt foo.txt",
    execution_dependencies=[":generate-foo"]
)
into my rule
b
The conventional commits target just replaces the shell_command one, that’s the part that does the codegen. The other three are for doing the copying. You’ll need to change the file names to match what your target outputs
a
but I want the
conventional_commits
target that to be atomic without adding another target
b
If you have a custom plugin already, I think https://github.com/pantsbuild/pants/pull/19264 might contain some hints about how to do it, as it is implementing something similar
a
mm can you point me more to the comment or code line?
b
No, sorry, I don’t know where it is. Maybe involving a method or function with
write
or
save
in the name?
a
will update later, when I reach to that again, much appreciate