-
Notifications
You must be signed in to change notification settings - Fork 13
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
Issues with subproject setup #5
Comments
Sorry for the slow response. I've been covered over in other work. Thanks so much for using the project and for raising an issue. This behavior is definitely something I'd love to fix. That said, I don't think this is working for me. It's also possible I'm not understanding. :) I created a simple project with two subprojects (
Is this what you'd expect? If so, what's the use case you're trying to address? edit: btw, I renamed |
I'm not sure if this is related, but I have a project with 3 sub-projects. I set
And the latest in the branch will become 0.0.4-SNAPSHOT |
@nathanalderson Hey, thanks for creating this plugin! I'm also having the same issue as @smiklos. I've created a project to demonstrate the issue here https://github.com/adamdougal/scala-multiversion-issue you should be able to check it out and play around with it. When running the same task for all projects: >> ./gradlew dummy --dry-run
:subproject1:dummy SKIPPED
:subproject2:dummy SKIPPED
:subproject1:recurseWithScalaVersion_2.11.11 SKIPPED
BUILD SUCCESSFUL in 0s This works fine and as expected. When I just run the dummy task for >> ./gradlew subproject2:dummy --dry-run
:subproject2:dummy SKIPPED
:subproject1:recurseWithScalaVersion_2.11.11 SKIPPED
BUILD SUCCESSFUL in 0s No tasks in |
@adamdougal Thanks for the report and the test case repo! I can see why you are confused, but this is actually behaving correctly. The task you are seeing from subproject1 is just the recursion task, and the task dummy() { doLast { println it } } You can see that it is only run for the requested subproject:
If you run it with
|
But should that recursion task be run at all given that subproject2 has nothing to do with subproject1 which declares the plugin? It also looks like the Run without the plugin: >> ./gradlew subproject2:dummy --console=plain
:subproject2:dummy
task ':subproject2:dummy'
BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed Run with the plugin: >> ./gradlew subproject2:dummy --console=plain
:subproject2:dummy
task ':subproject2:dummy'
:subproject1:recurseWithScalaVersion_2.11.11
:scala-multiversion-issue:subproject2:dummy
task ':scala-multiversion-issue:subproject2:dummy'
BUILD SUCCESSFUL in 0s
2 actionable tasks: 2 executed This does seem to be causing issues with some of my subprojects that do deployments as it means the deployment happens twice. |
Yes, this is acting as intended. The recursion task just exists to run the other tasks recursively and just gets sort of arbitrarily attached to subproject1. The dummy task is executed twice for subproject2, once for each scala version (try this: If you have tasks that should only run once, you can add them to
|
@nathanalderson, if it is the intended behavior, then the default |
I disagree. Internally at Adtran, for example, we absolutely want to
publish our libraries for both versions. That's kind of the point.
What *can* become problematic is if you have a mix of Scala and not-Scala
subprojects (or Scala projects that don't apply this plugin). Those other
subprojects' tasks will unnecessarily run once for each Scala version. That
can be problematic for tasks like uploadArchives since it will try to
publish the *same* artifact twice (which will usually fail, depending on
your artifact repo potentially). A PR to avoid this behavior would be
welcome, which is where this issue initially started.
…On Wed, Apr 11, 2018, 20:35 sinwe ***@***.***> wrote:
@nathanalderson <https://github.com/nathanalderson>, if it is the
intended behavior, then the default runOnceTasks should be clean, release
and upload archives. I can't imagine if people would like to run multiple
upload or releases per scalaVersion
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACLksLe5r-I6qY8x46Jw02sGLUL4kaWuks5tnq9ZgaJpZM4PYorx>
.
|
Are you saying runOnceTasks means run once during the entire build or run
once per scala version? I was assuming that it run once per scala version.
My problem was that the tasks run as many as the number of subprojects. So
for example if you run release task and you have 3 sub projects, on one of
the subproject it will run 3 release tasks.
So if your current version is 0.0.1, with release task being executed 3x,
you'll end up generating version 0.0.2, 0.0.3, and 0.0.4. Which I believe
is not the intended target here.
|
@sinwe Thanks for clarifying. Yes, |
Hello @nathanalderson ! Thanks for the work on this plugin. steps to reproduce:
after it completes, if you check the commit log there will be 2 entries similar to this:
so the problem here is that the |
@lombardo-chcg I think this plugin and the I'm really not sure how to fix or even work around this. Using That said, it does appear that the |
@nathanalderson thank you for the reply - taught me something new about Gradle! |
@lombardo-chcg np! Thanks for using. This issue has become cluttered with several unrelated issues. I'm going to close this issue. If any of the previous commenters wish to continue discussion, please start a new issue. |
Hi,
First of all, thank you for the plugin.
I'm trying to use this plugin in a subproject and facing an issue where all my projects, even unrelated subprojects are built multiple times as the plugin always adds 1-2 more tasks (depending on how many scala versions we use).
If found the following configuration to work better as it adds the extra build tasks to one of the active tasks that the current scala (sub)project has, effectively making it only run for projects that has the plugin turned on for.
Let me know if you have a better solution or if I should open a pr with my changes.
The text was updated successfully, but these errors were encountered: