better use of kotlin DSL

This commit is contained in:
Aria Moradi 2021-05-20 10:24:33 +04:30
parent 10dee8b345
commit cf8e274883

View File

@ -6,15 +6,15 @@ node {
nodeProjectDir.set(file("${project.projectDir}/react/")) nodeProjectDir.set(file("${project.projectDir}/react/"))
} }
tasks.named("yarn_build") { tasks {
dependsOn("yarn") // install node_modules register<Copy>("copyBuild") {
} from(file("${node.nodeProjectDir}/build"))
tasks.register<Copy>("copyBuild") {
from(file("$rootDir/webUI/react/build"))
into(file("$rootDir/server/src/main/resources/react")) into(file("$rootDir/server/src/main/resources/react"))
}
tasks.named("copyBuild") {
dependsOn("yarn_build") dependsOn("yarn_build")
}
named("yarn_build") {
dependsOn("yarn") // install node_modules
}
} }