Adjust js distribution name and move task to configuraition time.

This commit is contained in:
Alexander Nozik 2019-12-30 17:02:12 +03:00
parent 99fdcfe60d
commit e00642bb34
3 changed files with 19 additions and 17 deletions

View File

@ -7,7 +7,7 @@ plugins {
}
group = "scientifik"
version = "0.3.1"
version = "0.3.2"
repositories {
gradlePluginPortal()

View File

@ -45,11 +45,12 @@ open class ScientifikJSPlugin : Plugin<Project> {
outputFileName = "main.bundle.js"
}
afterEvaluate {
val installJsDist by creating(Copy::class) {
group = "distribution"
dependsOn(browserWebpack)
from(fileTree("src/main/web"))
val installJsDist by creating(Copy::class) {
group = "distribution"
dependsOn(browserWebpack)
from(fileTree("src/main/web"))
afterEvaluate {
into(browserWebpack.destinationDirectory!!)
doLast {
val indexFile = File(browserWebpack.destinationDirectory!!, "index.html")
@ -58,10 +59,10 @@ open class ScientifikJSPlugin : Plugin<Project> {
}
}
}
findByName("assemble")?.dependsOn(installJsDist)
}
findByName("assemble")?.dependsOn(installJsDist)
}
}

View File

@ -115,17 +115,18 @@ open class ScientifikMPPlugin : Plugin<Project> {
tasks.apply {
val jsBrowserWebpack by getting(KotlinWebpack::class) {
afterEvaluate {
val destination = listOf(name, version.toString()).joinToString("-")
val destination = listOf(name, "js", version.toString()).joinToString("-")
destinationDirectory = destinationDirectory?.resolve(destination)
}
outputFileName = "main.bundle.js"
}
afterEvaluate {
val installJsDist by creating(Copy::class) {
group = "distribution"
dependsOn(jsBrowserWebpack)
from(project.fileTree("src/jsMain/web"))
val installJsDist by creating(Copy::class) {
group = "distribution"
dependsOn(jsBrowserWebpack)
from(project.fileTree("src/jsMain/web"))
afterEvaluate {
into(jsBrowserWebpack.destinationDirectory!!)
doLast {
val indexFile = File(jsBrowserWebpack.destinationDirectory!!, "index.html")
@ -134,10 +135,10 @@ open class ScientifikMPPlugin : Plugin<Project> {
}
}
}
findByName("assemble")?.dependsOn(installJsDist)
}
findByName("assemble")?.dependsOn(installJsDist)
// withType<Test>(){
// useJUnitPlatform()
// }