Skip to content

Commit

Permalink
Remove preBuild dependency on buildTask (BrainiumLLC#47)
Browse files Browse the repository at this point in the history
* Remove preBuild dependency on buildTask

* ensure that preBuild runs after the Rust build tasks.
  • Loading branch information
ArthurKValladares committed Oct 26, 2021
1 parent fe8b064 commit b85b13c
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,18 @@ open class RustPlugin : Plugin<Project> {
group = TASK_GROUP
description = "Build dynamic library in ${profile} mode for all targets"
}
project.tasks.findByName("preBuild")?.dependsOn(buildTask)
for (targetPair in config.targets!!.withIndex()) {
val targetName = targetPair.value
val targetArch = config.arches!![targetPair.index]
buildTask.dependsOn(project.tasks.maybeCreate("rustBuild${targetArch.capitalize()}${profile.capitalize()}", BuildTask::class.java).apply {
val targetBuildTask = project.tasks.maybeCreate("rustBuild${targetArch.capitalize()}${profile.capitalize()}", BuildTask::class.java).apply {
group = TASK_GROUP
description = "Build dynamic library in ${profile} mode for $targetArch"
rootDirRel = File(config.rootDirRel)
target = targetName
release = profile == "release"
})
}
buildTask.dependsOn(targetBuildTask)
project.tasks.findByName("preBuild")?.mustRunAfter(targetBuildTask)
}
}
}
Expand Down

0 comments on commit b85b13c

Please sign in to comment.