From bf5d47fd0e934a82e6e21b9dc1b74819ad453f8d Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Sun, 2 Jan 2022 19:43:31 +0300 Subject: [PATCH] remove production build from intermediate libraries --- demo/playground/build.gradle.kts | 28 +++++++++++++-------------- visionforge-gdml/build.gradle.kts | 7 +++++-- visionforge-markdown/build.gradle.kts | 22 +-------------------- visionforge-plotly/build.gradle.kts | 15 +------------- visionforge-threejs/build.gradle.kts | 6 ++++++ 5 files changed, 26 insertions(+), 52 deletions(-) diff --git a/demo/playground/build.gradle.kts b/demo/playground/build.gradle.kts index 9a845c50..8bad3769 100644 --- a/demo/playground/build.gradle.kts +++ b/demo/playground/build.gradle.kts @@ -29,9 +29,10 @@ kotlin { jvm { withJava() compilations.all { - kotlinOptions{ + kotlinOptions { 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 { @@ -39,18 +40,6 @@ kotlin { } } - afterEvaluate { - val jsBrowserDistribution = tasks.getByName("jsBrowserDevelopmentExecutableDistribution") - - tasks.getByName("jvmProcessResources") { - dependsOn(jsBrowserDistribution) - afterEvaluate { - from(jsBrowserDistribution) - } - } - } - - sourceSets { val commonMain by getting { 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("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") } diff --git a/visionforge-gdml/build.gradle.kts b/visionforge-gdml/build.gradle.kts index 7ad37466..98a474ec 100644 --- a/visionforge-gdml/build.gradle.kts +++ b/visionforge-gdml/build.gradle.kts @@ -3,10 +3,13 @@ plugins { } kotlin { + js{ + binaries.library() + } sourceSets { - val commonMain by getting { + commonMain{ dependencies { - api(project(":visionforge-solid")) + api(projects.visionforgeSolid) api("space.kscience:gdml:0.4.0") } } diff --git a/visionforge-markdown/build.gradle.kts b/visionforge-markdown/build.gradle.kts index 210e4ee8..1a8e4efd 100644 --- a/visionforge-markdown/build.gradle.kts +++ b/visionforge-markdown/build.gradle.kts @@ -10,27 +10,7 @@ kscience { kotlin { js { - //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("jvmProcessResources") { - dependsOn(jsBrowserDistribution) - from(jsBrowserDistribution) + binaries.library() } sourceSets { diff --git a/visionforge-plotly/build.gradle.kts b/visionforge-plotly/build.gradle.kts index b0b5a9c2..caeb4e52 100644 --- a/visionforge-plotly/build.gradle.kts +++ b/visionforge-plotly/build.gradle.kts @@ -10,20 +10,7 @@ kscience { kotlin { js { - //binaries.library() - binaries.executable() - browser { - webpackTask { - this.outputFileName = "js/visionforge-three.js" - } - } - } - - val jsBrowserDistribution by tasks.getting - - tasks.getByName("jvmProcessResources") { - dependsOn(jsBrowserDistribution) - from(jsBrowserDistribution) + binaries.library() } sourceSets { diff --git a/visionforge-threejs/build.gradle.kts b/visionforge-threejs/build.gradle.kts index 37b8772f..5ae86f41 100644 --- a/visionforge-threejs/build.gradle.kts +++ b/visionforge-threejs/build.gradle.kts @@ -2,6 +2,12 @@ plugins { id("ru.mipt.npm.gradle.js") } +kotlin{ + js{ + binaries.library() + } +} + dependencies { api(project(":visionforge-solid")) implementation(npm("three", "0.130.1"))