fix gradle task output (zip depends on browserDistribution), add util function for filtering tasks by name
This commit is contained in:
parent
5cb9fc0a88
commit
11cca3c8c3
2 changed files with 15 additions and 5 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import org.gradle.api.Task
|
||||
import org.gradle.api.artifacts.Configuration
|
||||
import org.gradle.api.attributes.Usage
|
||||
import org.gradle.api.model.ObjectFactory
|
||||
import org.gradle.kotlin.dsl.named
|
||||
import org.gradle.api.tasks.TaskCollection
|
||||
|
||||
// to be moved into gradle-plugins/builder-plugins...
|
||||
|
||||
|
|
@ -23,3 +22,7 @@ fun Configuration.asConsumer() {
|
|||
// attributes {
|
||||
// attribute(Usage.USAGE_ATTRIBUTE, objects.named("dev.adamko.gradle.factorio.typescriptFiles"))
|
||||
// }
|
||||
|
||||
|
||||
fun <T : Task> TaskCollection<T>.withName(name: String): TaskCollection<T> =
|
||||
matching { it.name == name }
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ val installThemeCss by tasks.registering(Copy::class) {
|
|||
}
|
||||
|
||||
|
||||
tasks.matching { it.name == "processResources" }.configureEach {
|
||||
tasks.withName("processResources").configureEach {
|
||||
dependsOn(installThemeCss)
|
||||
}
|
||||
|
||||
|
|
@ -136,9 +136,16 @@ tasks.matching { it.name == "processResources" }.configureEach {
|
|||
val runWebMap by tasks.registering {
|
||||
group = rootProject.name
|
||||
|
||||
dependsOn(tasks.matching { it.name == "browserDevelopmentRun" })
|
||||
dependsOn(tasks.withName("browserDevelopmentRun"))
|
||||
|
||||
}
|
||||
|
||||
|
||||
tasks.zip {
|
||||
dependsOn(tasks.withName("browserDistribution"))
|
||||
}
|
||||
|
||||
|
||||
tasks.dockerComposeBuild {
|
||||
dependsOn(tasks.zip)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue