Parallel Task Execution Gradle Plugin
This plugin allows tasks that are defined within the same module to be executed in parallel (as specified in the parallelTasks configuration). It should not be confused with the --parallel option that allows tasks from separate projects in a decoupled multi-project build to be executed in parallel.
Usage
Add the dependency to your build script
buildscript {
repositories {
maven {
url "http://dl.bintray.com/barryearles/maven"
}
}
dependencies {
classpath "com.github.paralleltasks:parallel-tasks-gradle-plugin:1.0.1"
}
}
Apply the plugin
apply plugin: 'com.github.paralleltasks'
After applying the plugin, a new task named runParallelTasks is now available
$ ./gradlew tasks
:tasks
...
Other tasks
-----------
runParallelTasks - Provides the ability to execute tasks in parallel
Configure the tasks that you wish to be executed in parallel
task webpackDevServer << {
// Start Webpack Dev Server
}
task browsersyncServer << {
// Start Browsersync Server
}
parallelTasks {
taskNames = [
"browsersyncServer",
"webpackDevServer",
"bootRun" // Task provided by "spring-boot" gradle plugin (e.g. apply plugin: 'spring-boot')
]
}
Execute the tasks in parallel
./gradlew runParallelTasks
Building from Source
./gradlew clean build