This message was deleted.
# community-support
s
This message was deleted.
s
It has to be a zip file with the modules build.gradle file and everything present in the module. Can I customize sourcesJar task to include these?
v
Do you really want to package for example
ModuleName/build
?
And yes, you can include what you want in the sources jar, you just most probably shouldn't 😄
e
a jar file is a zip file
v
Just packing the build script additionally into it would most probably also not help much
e
if you need to export a buildable snapshot, https://git-scm.com/docs/git-archive or whatever is appropriate for your version control system is almost certainly a better option
v
Not necessarily. I for example prefer things to also build properly without the VCS available, for example from such a snapshot. 😄
e
git archive
produces a zip or tar file containing all the files but none of
.git
v
But why using an external process that might not be available, when you can simply zip everything except
build/
up? Given a sanely designed build where only in
build
things get produced.
e
everything else in
.gitignore
? e.g.
.idea
,
*.pyc
, etc. which you can't just shove into
build
v
Yeah, well, I don't expect
.idea
on a machine or worktree doing a release build and I don't know what
.pyc
is. 😄
e
if you have any
.py
scripts that you run, Python saves the parsed bytecode into
.pyc
files alongside them
v
Ah, ok, I usually don't have anything in Python 🙂
So, yeah, of course depends on the project as almost everything g
s
To give context to the requirement and our setup… a tool is setup to automatically download the zip, unzip it and run a specific gradle command to run validation tests against an environment. I will look into customizing the sourcesJar task.
d
Ran into something similar this with upgrading to Gradle 8. Is there additional output in the logs that says something akin to Declare explicit dependency of taskA from taskB using Task#finalizedBy Or something similar?
s
Update: It turns out all I needed to do was exclude the build folder and the warnings went away.
v
Yes, that's why I asked whether you really intend to pack that along in my first message. 😉
👍 1
e
and it would also be automatically excluded by
git archive
as it's not part of the sources