The docs indicate that I can mark specific tasks as parallelizable using the @ParallelizableTask annotation. As far as I can tell, this annotation doesn’t do anything. Am I missing a piece here, or misunderstanding the purpose of this annotation?
Example build.gradle below - my “taska” and “taskb” scripts are simple bash scripts that do echo "start"; sleep 5; echo "end". With the code below, I see that the tasks are executed separately in series. Can I get them to execute in parallel?
We have test coverage for using this, but it’s possible to write unsafe tasks that we can’t detect as non-parallel safe, so we haven’t taken the time to make this public. Anecdotally, I use this for the gradle build all the time and haven’t noticed any problems. I think eventually this is going to get rolled into --parallel and/or be enabled by default.
but it still doesn’t seem to make a difference. I also tried creating a 3rd task that just depends on the other two and executing that (in case dependencies are parsed differently from tasks directly on the command line), but still no luck. I’m using Gradle 2.11 by the way.
I can dive into the source a little more and see what I can figure out, but let me know if you can think of anything else I’m missing. Thanks!
Just got to check up on this again - and it turns out I didn’t have org.gradle.parallel set on this particular machine. Passing --parallel made things work. Thanks for the help!