Skip to content

Commit

Permalink
Migrate to mpp project model
Browse files Browse the repository at this point in the history
  • Loading branch information
altavir committed Feb 6, 2024
1 parent 2cc24a2 commit a26a092
Show file tree
Hide file tree
Showing 18 changed files with 48 additions and 98 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ val plotlyVersion by extra("2.29.0")

allprojects {
group = "space.kscience"
version = "0.7.0-dev-2"
version = "0.7.0"
}

apiValidation {
ignoredProjects.addAll(listOf("examples", "fx-demo", "js-demo"))
ignoredProjects.addAll(listOf("examples", "fx-demo", "js-demo", "compose-demo"))
}

ksciencePublish{
Expand Down
2 changes: 1 addition & 1 deletion examples/compose-demo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("multiplatform")
id("org.jetbrains.compose") version "1.5.12"
alias(spclibs.plugins.compose)
}

repositories {
Expand Down
17 changes: 10 additions & 7 deletions examples/js-demo/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
kotlin("js")
kotlin("multiplatform")
}

repositories {
Expand All @@ -12,13 +12,16 @@ kotlin {
browser()
binaries.executable()
}
}

dependencies {
implementation(projects.plotlyktCore)
implementation(spclibs.kotlinx.coroutines.core)
sourceSets{
jsMain{
dependencies{
implementation(projects.plotlyktCore)
implementation(spclibs.kotlinx.coroutines.core)
}
}
}
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.freeCompilerArgs = kotlinOptions.freeCompilerArgs +"-Xopt-in=kotlin.RequiresOptIn"
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
}
61 changes: 0 additions & 61 deletions plotlykt-core/api/plotlykt-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -79,74 +79,13 @@ public final class space/kscience/plotly/PlotExtensionsKt {
public static final fun violin (Lspace/kscience/plotly/Plot;Lkotlin/jvm/functions/Function1;)Lspace/kscience/plotly/models/Violin;
}

public final class space/kscience/plotly/PlotGrid {
public fun <init> ()V
public final fun get (Ljava/lang/String;)Lspace/kscience/plotly/PlotGrid$PlotCell;
public final fun getGrid ()Ljava/util/List;
public final fun plot (Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;ILkotlin/jvm/functions/Function1;)Lspace/kscience/plotly/Plot;
public final fun plot (Lspace/kscience/plotly/Plot;Ljava/lang/String;ILjava/lang/Integer;Ljava/lang/Integer;)Lspace/kscience/plotly/Plot;
public static synthetic fun plot$default (Lspace/kscience/plotly/PlotGrid;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;ILkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lspace/kscience/plotly/Plot;
public static synthetic fun plot$default (Lspace/kscience/plotly/PlotGrid;Lspace/kscience/plotly/Plot;Ljava/lang/String;ILjava/lang/Integer;Ljava/lang/Integer;ILjava/lang/Object;)Lspace/kscience/plotly/Plot;
}

public final class space/kscience/plotly/PlotGrid$PlotCell {
public fun <init> (Ljava/lang/String;Lspace/kscience/plotly/Plot;III)V
public synthetic fun <init> (Ljava/lang/String;Lspace/kscience/plotly/Plot;IIIILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Ljava/lang/String;
public final fun component2 ()Lspace/kscience/plotly/Plot;
public final fun component3 ()I
public final fun component4 ()I
public final fun component5 ()I
public final fun copy (Ljava/lang/String;Lspace/kscience/plotly/Plot;III)Lspace/kscience/plotly/PlotGrid$PlotCell;
public static synthetic fun copy$default (Lspace/kscience/plotly/PlotGrid$PlotCell;Ljava/lang/String;Lspace/kscience/plotly/Plot;IIIILjava/lang/Object;)Lspace/kscience/plotly/PlotGrid$PlotCell;
public fun equals (Ljava/lang/Object;)Z
public final fun getCol ()I
public final fun getId ()Ljava/lang/String;
public final fun getPlot ()Lspace/kscience/plotly/Plot;
public final fun getRow ()I
public final fun getWidth ()I
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class space/kscience/plotly/PlotGridKt {
public static final fun grid (Lspace/kscience/plotly/Plotly;Lkotlin/jvm/functions/Function1;)Lspace/kscience/plotly/PlotlyPage;
}

public final class space/kscience/plotly/PlotKt {
public static final fun Plot (Lspace/kscience/dataforge/meta/Meta;)Lspace/kscience/plotly/Plot;
public static final fun layout (Lspace/kscience/plotly/Plot;Lkotlin/jvm/functions/Function1;)V
public static final fun toJsonString (Lspace/kscience/plotly/Plot;)Ljava/lang/String;
public static final fun trace (Lspace/kscience/plotly/Plot;Lkotlin/jvm/functions/Function1;)Lspace/kscience/plotly/models/Trace;
}

public final class space/kscience/plotly/PlotTabs {
public fun <init> ()V
public final fun getTabs ()Ljava/util/List;
public final fun tab (Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function2;)V
public static synthetic fun tab$default (Lspace/kscience/plotly/PlotTabs;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)V
}

public final class space/kscience/plotly/PlotTabs$Tab {
public fun <init> (Ljava/lang/String;Ljava/lang/String;Lspace/kscience/plotly/PlotlyFragment;)V
public final fun component1 ()Ljava/lang/String;
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Lspace/kscience/plotly/PlotlyFragment;
public final fun copy (Ljava/lang/String;Ljava/lang/String;Lspace/kscience/plotly/PlotlyFragment;)Lspace/kscience/plotly/PlotTabs$Tab;
public static synthetic fun copy$default (Lspace/kscience/plotly/PlotTabs$Tab;Ljava/lang/String;Ljava/lang/String;Lspace/kscience/plotly/PlotlyFragment;ILjava/lang/Object;)Lspace/kscience/plotly/PlotTabs$Tab;
public fun equals (Ljava/lang/Object;)Z
public final fun getContent ()Lspace/kscience/plotly/PlotlyFragment;
public final fun getId ()Ljava/lang/String;
public final fun getTitle ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class space/kscience/plotly/PlotTabsKt {
public static final fun tabs (Lspace/kscience/plotly/Plotly;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Lspace/kscience/plotly/PlotlyPage;
public static synthetic fun tabs$default (Lspace/kscience/plotly/Plotly;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lspace/kscience/plotly/PlotlyPage;
}

public final class space/kscience/plotly/Plotly {
public static final field INSTANCE Lspace/kscience/plotly/Plotly;
public static final field PLOTLY_CDN Ljava/lang/String;
Expand Down
9 changes: 6 additions & 3 deletions plotlykt-jupyter/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
plugins {
id("space.kscience.gradle.jvm")
id("space.kscience.gradle.mpp")
kotlin("jupyter.api")
`maven-publish`
}

val dataforgeVersion: String by rootProject.extra

dependencies {
api(projects.plotlyktCore)
kscience{
jvm()
jvmMain{
api(projects.plotlyktCore)
}
}

tasks.processJupyterApiResources{
Expand Down
28 changes: 15 additions & 13 deletions plotlykt-script/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
plugins {
id("space.kscience.gradle.jvm")
id("space.kscience.gradle.mpp")
application
`maven-publish`
}

repositories {
maven("https://dl.bintray.com/kotlin/ktor/")
}

val ktorVersion: String by rootProject.extra
val dataforgeVersion: String by rootProject.extra

dependencies {
api(projects.plotlyktCore)
api(spclibs.kotlinx.html)
api(kotlin("scripting-jvm-host"))
api(kotlin("scripting-jvm"))
api("io.github.microutils:kotlin-logging:3.0.5")
implementation(spclibs.logback.classic)
implementation(spclibs.kotlinx.cli)
kscience{
jvm{
withJava()
}
jvmMain{
api(projects.plotlyktCore)
api(spclibs.kotlinx.html)
api(kotlin("scripting-jvm-host"))
api(kotlin("scripting-jvm"))
api("io.github.microutils:kotlin-logging:3.0.5")
implementation(spclibs.logback.classic)
implementation(spclibs.kotlinx.cli)
}
}


application{
mainClass.set("space.kscience.plotly.script.CliKt")
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import kotlin.script.experimental.jvm.jvm
fileExtension = "plotly.kts",
compilationConfiguration = PlotlyScriptCompilationConfiguration::class
)
abstract class PlotlyScript
public abstract class PlotlyScript


class PlotlyScriptCompilationConfiguration: ScriptCompilationConfiguration({
public class PlotlyScriptCompilationConfiguration: ScriptCompilationConfiguration({
baseClass(PlotlyScript::class)
implicitReceivers(FlowContent::class)
defaultImports(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import java.io.File
import java.nio.file.Path

@OptIn(UnstablePlotlyAPI::class)
fun main(args: Array<String>) {
public fun main(args: Array<String>) {
val parser = ArgParser("plotlykt-script")
val input by parser.argument(ArgType.String, description ="Input file path")
val output by parser.argument(ArgType.String, description = "Output file path").optional()
Expand Down
19 changes: 11 additions & 8 deletions plotlykt-server/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
import space.kscience.gradle.KScienceVersions

plugins {
id("space.kscience.gradle.jvm")
id("space.kscience.gradle.mpp")
kotlin("jupyter.api")
`maven-publish`
}

val dataforgeVersion: String by rootProject.extra
val ktorVersion = KScienceVersions.ktorVersion

dependencies {
api(projects.plotlyktCore)
api("io.ktor:ktor-server-cio:$ktorVersion")
api("io.ktor:ktor-server-html-builder:$ktorVersion")
api("io.ktor:ktor-server-websockets:$ktorVersion")
api("io.ktor:ktor-server-cors:$ktorVersion")
api("space.kscience:dataforge-context:$dataforgeVersion")
kscience{
jvm()
jvmMain{
api(projects.plotlyktCore)
api("io.ktor:ktor-server-cio:$ktorVersion")
api("io.ktor:ktor-server-html-builder:$ktorVersion")
api("io.ktor:ktor-server-websockets:$ktorVersion")
api("io.ktor:ktor-server-cors:$ktorVersion")
api("space.kscience:dataforge-context:$dataforgeVersion")
}
}

tasks.processJupyterApiResources{
Expand Down

0 comments on commit a26a092

Please sign in to comment.