remove production build from intermediate libraries

This commit is contained in:
Alexander Nozik 2022-01-02 19:43:31 +03:00
parent 43285de33c
commit bf5d47fd0e
No known key found for this signature in database
GPG Key ID: F7FCF2DD25C71357
5 changed files with 26 additions and 52 deletions

View File

@ -29,9 +29,10 @@ kotlin {
jvm { jvm {
withJava() withJava()
compilations.all { compilations.all {
kotlinOptions{ kotlinOptions {
jvmTarget = "11" jvmTarget = "11"
freeCompilerArgs = freeCompilerArgs + "-Xjvm-default=all" + "-Xopt-in=kotlin.RequiresOptIn" + "-Xlambdas=indy" freeCompilerArgs =
freeCompilerArgs + "-Xjvm-default=all" + "-Xopt-in=kotlin.RequiresOptIn" + "-Xlambdas=indy"
} }
} }
testRuns["test"].executionTask.configure { testRuns["test"].executionTask.configure {
@ -39,18 +40,6 @@ kotlin {
} }
} }
afterEvaluate {
val jsBrowserDistribution = tasks.getByName("jsBrowserDevelopmentExecutableDistribution")
tasks.getByName<ProcessResources>("jvmProcessResources") {
dependsOn(jsBrowserDistribution)
afterEvaluate {
from(jsBrowserDistribution)
}
}
}
sourceSets { sourceSets {
val commonMain by getting { val commonMain by getting {
dependencies { dependencies {
@ -80,7 +69,16 @@ kotlin {
} }
} }
val processJupyterApiResources by tasks.getting(org.jetbrains.kotlinx.jupyter.api.plugin.tasks.JupyterApiResourcesTask::class){ val jsBrowserDistribution = tasks.getByName("jsBrowserDistribution")
tasks.getByName<ProcessResources>("jvmProcessResources") {
dependsOn(jsBrowserDistribution)
from(jsBrowserDistribution) {
exclude("**/*.js.map")
}
}
val processJupyterApiResources by tasks.getting(org.jetbrains.kotlinx.jupyter.api.plugin.tasks.JupyterApiResourcesTask::class) {
libraryProducers = listOf("space.kscience.visionforge.examples.VisionForgePlayGroundForJupyter") libraryProducers = listOf("space.kscience.visionforge.examples.VisionForgePlayGroundForJupyter")
} }

View File

@ -3,10 +3,13 @@ plugins {
} }
kotlin { kotlin {
js{
binaries.library()
}
sourceSets { sourceSets {
val commonMain by getting { commonMain{
dependencies { dependencies {
api(project(":visionforge-solid")) api(projects.visionforgeSolid)
api("space.kscience:gdml:0.4.0") api("space.kscience:gdml:0.4.0")
} }
} }

View File

@ -10,27 +10,7 @@ kscience {
kotlin { kotlin {
js { js {
//binaries.library() binaries.library()
binaries.executable()
browser {
webpackTask {
outputFileName = "js/visionforge-markdown.js"
}
}
}
jvm {
val processResourcesTaskName =
compilations[org.jetbrains.kotlin.gradle.plugin.KotlinCompilation.MAIN_COMPILATION_NAME]
.processResourcesTaskName
}
val jsBrowserDistribution by tasks.getting
tasks.getByName<ProcessResources>("jvmProcessResources") {
dependsOn(jsBrowserDistribution)
from(jsBrowserDistribution)
} }
sourceSets { sourceSets {

View File

@ -10,20 +10,7 @@ kscience {
kotlin { kotlin {
js { js {
//binaries.library() binaries.library()
binaries.executable()
browser {
webpackTask {
this.outputFileName = "js/visionforge-three.js"
}
}
}
val jsBrowserDistribution by tasks.getting
tasks.getByName<ProcessResources>("jvmProcessResources") {
dependsOn(jsBrowserDistribution)
from(jsBrowserDistribution)
} }
sourceSets { sourceSets {

View File

@ -2,6 +2,12 @@ plugins {
id("ru.mipt.npm.gradle.js") id("ru.mipt.npm.gradle.js")
} }
kotlin{
js{
binaries.library()
}
}
dependencies { dependencies {
api(project(":visionforge-solid")) api(project(":visionforge-solid"))
implementation(npm("three", "0.130.1")) implementation(npm("three", "0.130.1"))