Username404-Website/build.gradle.kts

67 lines
1.8 KiB
Plaintext
Raw Normal View History

2021-06-20 13:27:01 +02:00
plugins {
id("org.jetbrains.kotlin.js") version "1.8.20"
2021-06-20 13:27:01 +02:00
}
group = "fr.username404"
version = "2"
2021-06-20 13:27:01 +02:00
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib-js"))
implementation("org.jetbrains.kotlinx:kotlinx-html:${rootProject.property("kotlinx-html_version")}")
2021-06-20 13:27:01 +02:00
}
val outputDirectory = file("$rootDir/compiledOutput")
2021-06-20 13:27:01 +02:00
kotlin {
js(IR) {
moduleName = "Username404_Website"
2021-06-20 15:20:32 +02:00
compilations.all {
with(kotlinOptions) {
val secondDot = coreLibrariesVersion.let { it.indexOf('.', startIndex = it.indexOf('.') + 1) }
apiVersion = coreLibrariesVersion.run {
substring(0 until secondDot)
}
languageVersion = apiVersion!!.substringBefore('.') + '.' + (apiVersion!!.substringAfter('.').toInt() + 1).toString()
2021-06-20 15:42:32 +02:00
moduleKind = "plain"
2021-06-20 15:20:32 +02:00
freeCompilerArgs = freeCompilerArgs + listOf(
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.js.ExperimentalJsExport",
2021-06-20 15:34:54 +02:00
"-Xir-property-lazy-initialization"
2021-06-20 15:20:32 +02:00
)
}
}
2021-06-20 13:27:01 +02:00
browser {
webpackTask {
destinationDirectory = outputDirectory
2021-06-20 16:20:53 +02:00
output.library = "Web404"
output.libraryTarget = "this"
cssSupport { isEnabled = true }
2021-06-20 13:27:01 +02:00
}
runTask {
cssSupport { isEnabled = true }
2021-06-20 13:27:01 +02:00
}
testTask {
useKarma {
useFirefoxNightlyHeadless()
webpackConfig.cssSupport { isEnabled = true }
2021-06-20 13:27:01 +02:00
}
}
}
binaries.executable()
}
}
tasks {
clean.get().delete.add(outputDirectory)
withType(ProcessResources::class) {
destinationDir = outputDirectory
}
}