Skip to content

Commit

Permalink
fix issue #10: Incorrect task execution order in multi-project builds
Browse files Browse the repository at this point in the history
  • Loading branch information
siordache committed Apr 4, 2019
1 parent 2bdd53f commit bd83f24
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package org.moditect.gradleplugin
import groovy.transform.CompileStatic
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.plugins.JavaPlugin
import org.moditect.gradleplugin.add.AddDependenciesModuleInfoTask
import org.moditect.gradleplugin.add.AddMainModuleInfoTask
Expand Down Expand Up @@ -68,6 +69,13 @@ class ModitectPlugin implements Plugin<Project> {
def jarTask = project.tasks[JavaPlugin.JAR_TASK_NAME]
def compileJavaTask = project.tasks[JavaPlugin.COMPILE_JAVA_TASK_NAME]

compileJavaTask.taskDependencies.getDependencies(compileJavaTask).each { Task depTask ->
def depJarTask = depTask.project.tasks.findByName(JavaPlugin.JAR_TASK_NAME)
[addMainModuleInfoTask, addDependenciesModuleInfoTask, generateModuleInfoTask, createRuntimeImageTask].each {
it.dependsOn(depJarTask)
}
}

addDependenciesModuleInfoTask.dependsOn(generateModuleInfoTask)
compileJavaTask.dependsOn(addDependenciesModuleInfoTask)

Expand Down

0 comments on commit bd83f24

Please sign in to comment.