Replies: 3 comments 7 replies
-
IMO this should be fixed in the following manner:
This is for the problem at hand. |
Beta Was this translation helpful? Give feedback.
4 replies
-
@ata-nas, |
Beta Was this translation helpful? Give feedback.
3 replies
-
Team agreement is to follow the recommendation @ata-nas documented as follows:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Topic
We have some subprojects that have repeating
gradle
task names, for example in:server
and in:suites
we have tasks namedcreateDockerImage
.To Discuss
./gradlew createDockerImage
by default this will run the task both for:server
and:suites
need-to-know
solutionDiscussion
This is a discussion we initially had with @mattp-swirldslabs and @AlfredoG87:
Currently we have some subprojects that have repeating
gradle
task names, for example in:server
and in:suites
we have tasks namedcreateDockerImage
. This means that when we are in repo root and we run./gradlew createDockerImage
by default this will run the task both for:server
and:suites
. Called without any qualifiers, any project that has a task namedcreateDockerImage
(or any other task duplicated task name), that task will be executed. This means that we need to use:server:createDockerImage
if we want to execute the task only for:server
which is aneed-to-know
solution and is not a good thing, since if we see thebuild.gradle.kts
of:server
and we see thecreateDockerImage
task, we might not be aware that the same exists for other subproject. This could mislead us and we could misuse the running of the given (any duplicated)gradle
task. If for example we have a task that would run a project, lets call itrunProject
for example, and we reuse it in a couple of subprojects, running./gradlew runProject
from repo root would attempt to run two projects at once which might be something that should never happen (especially when we havegh actions
jobs that are related to our ci/cd process), but we could easily miss that this is happening, since there could be no problems visible initially. And so would it be better to simply name the tasksserverRunProject
andsuitesRunProject
a better solution than the need to know solution of duplicating the task name and relying on theneed-to-know
nature of it? Also, when do we actually want to have duplicated task names and if we have such, is it possible to extract and reuse them instead of defining these tasks per project (if applicable)?As far as overhead, running things that we should not run due to task name duplication and not having knowledge about it, should theoretically be only once, since
gradle
is cached (please correct me if I am wrong)?This being said, here are a couple of questions I think we should discuss:
need-to-know
solution a valid concern, or is the reliance on thorough documentation solving the issue and it is a fault of the user if they misuse?need-to-know
nature of the issue?gradle
tasks?Beta Was this translation helpful? Give feedback.
All reactions