MrPowerGamerBR
06/04/2021, 1:38 PMjsBrowserDistribution
output to another project?
What I want to do is to copy the output from my :frontend
module to the resources of my :backend
(a ktor webserver) moduleturansky
06/04/2021, 2:07 PMturansky
06/04/2021, 2:10 PMval copyDist by tasks.registering(Copy::class) {
// task path used
from(":other-project:super-build-task")
into("my-dist-folder")
}
hfhbd
06/04/2021, 3:14 PMMrPowerGamerBR
06/04/2021, 5:38 PMval copyFrontendJavaScript by registering(Copy::class) {
val jsBrowserProductionWebpack = rootProject.allprojects.first { it.name == "frontend" }.tasks.getByName<org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpack>("jsBrowserProductionWebpack")
from(File(jsBrowserProductionWebpack.destinationDirectory, jsBrowserProductionWebpack.outputFileName))
into("build/resources/main/static/v3/assets/js/")
}
It works, but it isn't as pretty and doesn't have dev mode like @turansky 😛hfhbd
06/04/2021, 5:57 PMval jsBrowserProductionWebpack: org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpack by projects.frontend.tasks
EDIT: looks like it is not possibleturansky
06/04/2021, 6:09 PMtasks.getByPath(":frontend:jsBrowserProductionWebpack")
?MrPowerGamerBR
06/04/2021, 6:30 PMturansky
06/04/2021, 6:32 PMturansky
06/04/2021, 6:32 PMMrPowerGamerBR
06/04/2021, 7:00 PMjsBrowserProductionWebpack
task to a folder within the resources
folder of the JVM JAR (but maybe I'm just being dumb, I don't really know a lot about Gradle :P)MrPowerGamerBR
06/04/2021, 7:19 PMval jsBrowserProductionWebpack = tasks.getByPath(":frontend:jsBrowserProductionWebpack") as org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpack
processResources {
dependsOn(jsBrowserProductionWebpack)
from(jsBrowserProductionWebpack.destinationDirectory) {
into("static/v3/assets/js/")
}
}