83 lines
1.9 KiB
Groovy
83 lines
1.9 KiB
Groovy
buildscript {
|
|
ext.kotlin_version = '1.3.50'
|
|
|
|
repositories {
|
|
jcenter()
|
|
maven {
|
|
url "http://nexus.astraeus.nl/nexus/content/groups/public"
|
|
}
|
|
maven {
|
|
url "https://plugins.gradle.org/m2/"
|
|
}
|
|
mavenCentral()
|
|
}
|
|
dependencies {
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
classpath "com.eriwen:gradle-js-plugin:1.12.1"
|
|
}
|
|
}
|
|
|
|
apply plugin: "com.eriwen.gradle.js"
|
|
apply plugin: 'kotlin-platform-js'
|
|
apply plugin: 'kotlin-dce-js'
|
|
|
|
group 'nl.astraeus'
|
|
version '0.0.1-SNAPSHOT'
|
|
|
|
allprojects {
|
|
ext {
|
|
kotlin_version = '1.3.50'
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
maven {
|
|
url "http://nexus.astraeus.nl/nexus/content/groups/public"
|
|
}
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
|
|
compile "nl.astraeus:komp:0.1.9"
|
|
}
|
|
|
|
compileKotlin2Js {
|
|
kotlinOptions.metaInfo = true
|
|
|
|
kotlinOptions.sourceMap = true
|
|
kotlinOptions.sourceMapEmbedSources = "always"
|
|
kotlinOptions.suppressWarnings = true
|
|
kotlinOptions.verbose = true
|
|
}
|
|
|
|
runDceKotlinJs.doLast {
|
|
copy {
|
|
from("build/kotlin-js-min/main")
|
|
|
|
into("web/js/generated")
|
|
}
|
|
}
|
|
|
|
// Create new CombineJsTasks if you have multiple sets of JS files
|
|
combineJs {
|
|
dependsOn runDceKotlinJs
|
|
source = [
|
|
"${projectDir}/web/js/generated/kotlin.js",
|
|
"${projectDir}/web/js/generated/kotlinx-html-js.js",
|
|
"${projectDir}/web/js/generated/komp.js",
|
|
"${projectDir}/web/js/generated/komp-todo.js"
|
|
]
|
|
dest = file("${projectDir}/web/js/generated/todo.all.js")
|
|
}
|
|
|
|
minifyJs {
|
|
dependsOn combineJs
|
|
source = "${projectDir}/web/js/generated/todo.all.js"
|
|
dest = file("${projectDir}/web/js/generated/todo.all.min.js")
|
|
closure {
|
|
warningLevel = 'QUIET'
|
|
compilerOptions.languageIn = "ECMASCRIPT5"
|
|
}
|
|
}
|