diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 82a7f82161..904a288c89 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -13,7 +13,6 @@ plugins { alias(kotlin.jvm) alias(publisher) alias(serialization) - alias(jupyter.api) alias(korro) alias(keywordGenerator) alias(kover) @@ -374,10 +373,6 @@ tasks.test { } } -tasks.processJupyterApiResources { - libraryProducers = listOf("org.jetbrains.kotlinx.dataframe.jupyter.Integration") -} - kotlinPublications { publication { publicationName.set("core") diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/CodeWithConverter.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/CodeWithConverter.kt index dd48b739f4..232518cda8 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/CodeWithConverter.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/CodeWithConverter.kt @@ -1,7 +1,7 @@ package org.jetbrains.kotlinx.dataframe.codeGen -import org.jetbrains.kotlinx.jupyter.api.Code -import org.jetbrains.kotlinx.jupyter.api.VariableName +public typealias Code = String +public typealias VariableName = String /** * Class representing generated code declarations for a [Marker]. diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/ReplCodeGenerator.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/ReplCodeGenerator.kt index 63ceb4ffd5..01f47fcbb7 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/ReplCodeGenerator.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/ReplCodeGenerator.kt @@ -2,9 +2,9 @@ package org.jetbrains.dataframe.impl.codeGen import org.jetbrains.kotlinx.dataframe.AnyFrame import org.jetbrains.kotlinx.dataframe.AnyRow +import org.jetbrains.kotlinx.dataframe.codeGen.Code import org.jetbrains.kotlinx.dataframe.codeGen.CodeWithConverter import org.jetbrains.kotlinx.dataframe.impl.codeGen.ReplCodeGeneratorImpl -import org.jetbrains.kotlinx.jupyter.api.Code import kotlin.reflect.KClass import kotlin.reflect.KProperty diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/codeGen/CodeGeneratorImpl.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/codeGen/CodeGeneratorImpl.kt index d74f48cb6b..f7bfbb3f84 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/codeGen/CodeGeneratorImpl.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/codeGen/CodeGeneratorImpl.kt @@ -19,6 +19,7 @@ import org.jetbrains.kotlinx.dataframe.annotations.DataSchema import org.jetbrains.kotlinx.dataframe.api.ColumnSelectionDsl import org.jetbrains.kotlinx.dataframe.api.DataSchemaEnum import org.jetbrains.kotlinx.dataframe.codeGen.BaseField +import org.jetbrains.kotlinx.dataframe.codeGen.Code import org.jetbrains.kotlinx.dataframe.codeGen.CodeWithConverter import org.jetbrains.kotlinx.dataframe.codeGen.DefaultReadDfMethod import org.jetbrains.kotlinx.dataframe.codeGen.ExtensionsCodeGenerator @@ -33,7 +34,6 @@ import org.jetbrains.kotlinx.dataframe.codeGen.toNullable import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup import org.jetbrains.kotlinx.dataframe.impl.toSnakeCase import org.jetbrains.kotlinx.dataframe.schema.DataFrameSchema -import org.jetbrains.kotlinx.jupyter.api.Code private fun renderNullability(nullable: Boolean) = if (nullable) "?" else "" diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/codeGen/ReplCodeGeneratorImpl.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/codeGen/ReplCodeGeneratorImpl.kt index 763ac1c871..aa64903c5a 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/codeGen/ReplCodeGeneratorImpl.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/codeGen/ReplCodeGeneratorImpl.kt @@ -9,12 +9,12 @@ import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.DataRow import org.jetbrains.kotlinx.dataframe.annotations.DataSchema import org.jetbrains.kotlinx.dataframe.api.schema +import org.jetbrains.kotlinx.dataframe.codeGen.Code import org.jetbrains.kotlinx.dataframe.codeGen.CodeWithConverter import org.jetbrains.kotlinx.dataframe.codeGen.Marker import org.jetbrains.kotlinx.dataframe.codeGen.MarkerVisibility import org.jetbrains.kotlinx.dataframe.codeGen.MarkersExtractor import org.jetbrains.kotlinx.dataframe.schema.DataFrameSchema -import org.jetbrains.kotlinx.jupyter.api.Code import kotlin.reflect.KClass import kotlin.reflect.KProperty import kotlin.reflect.KType diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/codeGen/SchemaReader.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/codeGen/SchemaReader.kt index b5ed79216f..026cb3df15 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/codeGen/SchemaReader.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/codeGen/SchemaReader.kt @@ -4,6 +4,7 @@ import org.jetbrains.dataframe.impl.codeGen.CodeGenerator import org.jetbrains.kotlinx.dataframe.AnyFrame import org.jetbrains.kotlinx.dataframe.DataFrame import org.jetbrains.kotlinx.dataframe.api.schema +import org.jetbrains.kotlinx.dataframe.codeGen.Code import org.jetbrains.kotlinx.dataframe.codeGen.DefaultReadDfMethod import org.jetbrains.kotlinx.dataframe.io.SupportedCodeGenerationFormat import org.jetbrains.kotlinx.dataframe.io.SupportedDataFrameFormat @@ -12,7 +13,6 @@ import org.jetbrains.kotlinx.dataframe.io.guessFormat import org.jetbrains.kotlinx.dataframe.io.read import org.jetbrains.kotlinx.dataframe.io.readCodeForGeneration import org.jetbrains.kotlinx.dataframe.schema.DataFrameSchema -import org.jetbrains.kotlinx.jupyter.api.Code import java.net.URL /** diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/guess.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/guess.kt index 428254dcc2..2250c91343 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/guess.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/guess.kt @@ -11,8 +11,8 @@ import org.jetbrains.kotlinx.dataframe.annotations.ImportDataSchema import org.jetbrains.kotlinx.dataframe.annotations.Interpretable import org.jetbrains.kotlinx.dataframe.annotations.OptInRefine import org.jetbrains.kotlinx.dataframe.api.single +import org.jetbrains.kotlinx.dataframe.codeGen.Code import org.jetbrains.kotlinx.dataframe.codeGen.DefaultReadDfMethod -import org.jetbrains.kotlinx.jupyter.api.Code import java.io.BufferedInputStream import java.io.File import java.io.FileNotFoundException diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/CellRenderer.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/CellRenderer.kt index 6bf35a1b1a..cd22c3dd3b 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/CellRenderer.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/CellRenderer.kt @@ -1,13 +1,8 @@ package org.jetbrains.kotlinx.dataframe.jupyter import org.jetbrains.kotlinx.dataframe.io.DisplayConfiguration -import org.jetbrains.kotlinx.dataframe.io.internallyRenderable import org.jetbrains.kotlinx.dataframe.io.renderValueForHtml import org.jetbrains.kotlinx.dataframe.io.tooltipLimit -import org.jetbrains.kotlinx.jupyter.api.MimeTypedResult -import org.jetbrains.kotlinx.jupyter.api.Notebook -import org.jetbrains.kotlinx.jupyter.api.Renderable -import org.jetbrains.kotlinx.jupyter.api.libraries.ExecutionHost public data class RenderedContent( val truncatedContent: String, @@ -68,23 +63,3 @@ public object DefaultCellRenderer : CellRenderer { return renderValueForHtml(value, tooltipLimit, configuration.decimalFormat).truncatedContent } } - -internal class JupyterCellRenderer( - private val notebook: Notebook, - private val host: ExecutionHost, -) : ChainedCellRenderer(DefaultCellRenderer) { - override fun maybeContent(value: Any?, configuration: DisplayConfiguration): RenderedContent? { - val renderersProcessor = notebook.renderersProcessor - if (internallyRenderable(value)) return null - val renderedVal = renderersProcessor.renderValue(host, value) - val finalVal = if (renderedVal is Renderable) renderedVal.render(notebook) else renderedVal - if (finalVal is MimeTypedResult && "text/html" in finalVal) return RenderedContent.media( - finalVal["text/html"] ?: "" - ) - return renderValueForHtml(finalVal, configuration.cellContentLimit, configuration.decimalFormat) - } - - override fun maybeTooltip(value: Any?, configuration: DisplayConfiguration): String? { - return null - } -} diff --git a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/testSets/person/HtmlRenderingTests.kt b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/testSets/person/HtmlRenderingTests.kt index 94d351f016..8e259bc7bf 100644 --- a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/testSets/person/HtmlRenderingTests.kt +++ b/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/testSets/person/HtmlRenderingTests.kt @@ -8,7 +8,6 @@ import org.jetbrains.kotlinx.dataframe.api.group import org.jetbrains.kotlinx.dataframe.api.into import org.jetbrains.kotlinx.dataframe.api.parse import org.jetbrains.kotlinx.dataframe.io.toStandaloneHTML -import org.jetbrains.kotlinx.jupyter.util.findNthSubstring import org.junit.Ignore import org.junit.Test import java.awt.Desktop @@ -38,4 +37,18 @@ class HtmlRenderingTests : BaseTest() { html shouldContain "href" html.findNthSubstring(address, 2) shouldNotBe -1 } + + private fun String.findNthSubstring(s: String, n: Int, start: Int = 0): Int { + if (n < 1 || start == -1) return -1 + + var i = start + + for (k in 1..n) { + i = indexOf(s, i) + if (i == -1) return -1 + i += s.length + } + + return i - s.length + } } diff --git a/dataframe-jupyter/build.gradle.kts b/dataframe-jupyter/build.gradle.kts new file mode 100644 index 0000000000..734ce99e23 --- /dev/null +++ b/dataframe-jupyter/build.gradle.kts @@ -0,0 +1,60 @@ +plugins { + alias(libs.plugins.kotlin.jvm) + alias(libs.plugins.publisher) + alias(libs.plugins.jupyter.api) +} + +group = "org.jetbrains.kotlinx" + +repositories { + mavenCentral() +} + +dependencies { + compileOnly(project(":core")) + testImplementation(libs.junit) + testImplementation(libs.serialization.json) + testImplementation(project(":core")) + testImplementation(libs.kotestAssertions) { + exclude("org.jetbrains.kotlin", "kotlin-stdlib-jdk8") + } +} + +kotlin { + explicitApi() +} + +tasks.compileKotlin { + kotlinOptions { + freeCompilerArgs += listOf("-Xfriend-paths=${project(":core").projectDir}") + jvmTarget = "11" + } +} + +tasks.compileTestKotlin { + kotlinOptions { + val friendModule = project(":core") + val jarTask = friendModule.tasks.getByName("jar") as Jar + val jarPath = jarTask.archiveFile.get().asFile.absolutePath + freeCompilerArgs += "-Xfriend-paths=$jarPath" + jvmTarget = "11" + } +} + +tasks.withType { + sourceCompatibility = JavaVersion.VERSION_11.toString() + targetCompatibility = JavaVersion.VERSION_11.toString() +} + +tasks.processJupyterApiResources { + libraryProducers = listOf("org.jetbrains.kotlinx.dataframe.jupyter.Integration") +} + +kotlinPublications { + publication { + publicationName.set("dataframe-jupyter") + artifactId.set("dataframe-jupyter") + description.set("Kotlin DataFrame integration with Kotlin Jupyter") + packageName.set("dataframe-jupyter") + } +} diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/Integration.kt b/dataframe-jupyter/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/Integration.kt similarity index 97% rename from core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/Integration.kt rename to dataframe-jupyter/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/Integration.kt index af4ebd902d..1118f70353 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/Integration.kt +++ b/dataframe-jupyter/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/Integration.kt @@ -1,3 +1,5 @@ +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") + package org.jetbrains.kotlinx.dataframe.jupyter import org.jetbrains.dataframe.impl.codeGen.CodeGenerator @@ -32,7 +34,6 @@ import org.jetbrains.kotlinx.dataframe.api.asColumnGroup import org.jetbrains.kotlinx.dataframe.api.asDataFrame import org.jetbrains.kotlinx.dataframe.api.columnsCount import org.jetbrains.kotlinx.dataframe.api.isColumnGroup -import org.jetbrains.kotlinx.dataframe.api.name import org.jetbrains.kotlinx.dataframe.codeGen.CodeWithConverter import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup import org.jetbrains.kotlinx.dataframe.columns.ColumnReference @@ -230,10 +231,10 @@ internal class Integration( { "DataRow: index = ${it.index()}, columnsCount = ${it.columnsCount()}" }, ) render>( - { """ColumnGroup: name = "${it.name}", rowsCount = ${it.rowsCount()}, columnsCount = ${it.columnsCount()}""" }, + { """ColumnGroup: name = "${it.name()}", rowsCount = ${it.rowsCount()}, columnsCount = ${it.columnsCount()}""" }, ) render( - { """DataColumn: name = "${it.name}", type = ${renderType(it.type())}, size = ${it.size()}""" }, + { """DataColumn: name = "${it.name()}", type = ${renderType(it.type())}, size = ${it.size()}""" }, ) render( { "DataFrame: rowsCount = ${it.rowsCount()}, columnsCount = ${it.columnsCount()}" } diff --git a/dataframe-jupyter/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/JupyterCellRenderer.kt b/dataframe-jupyter/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/JupyterCellRenderer.kt new file mode 100644 index 0000000000..24f83cf470 --- /dev/null +++ b/dataframe-jupyter/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/JupyterCellRenderer.kt @@ -0,0 +1,31 @@ +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") + +package org.jetbrains.kotlinx.dataframe.jupyter + +import org.jetbrains.kotlinx.dataframe.io.DisplayConfiguration +import org.jetbrains.kotlinx.dataframe.io.internallyRenderable +import org.jetbrains.kotlinx.dataframe.io.renderValueForHtml +import org.jetbrains.kotlinx.jupyter.api.MimeTypedResult +import org.jetbrains.kotlinx.jupyter.api.Notebook +import org.jetbrains.kotlinx.jupyter.api.Renderable +import org.jetbrains.kotlinx.jupyter.api.libraries.ExecutionHost + +internal class JupyterCellRenderer( + private val notebook: Notebook, + private val host: ExecutionHost, +) : ChainedCellRenderer(DefaultCellRenderer) { + override fun maybeContent(value: Any?, configuration: DisplayConfiguration): RenderedContent? { + val renderersProcessor = notebook.renderersProcessor + if (internallyRenderable(value)) return null + val renderedVal = renderersProcessor.renderValue(host, value) + val finalVal = if (renderedVal is Renderable) renderedVal.render(notebook) else renderedVal + if (finalVal is MimeTypedResult && "text/html" in finalVal) return RenderedContent.media( + finalVal["text/html"] ?: "" + ) + return renderValueForHtml(finalVal, configuration.cellContentLimit, configuration.decimalFormat) + } + + override fun maybeTooltip(value: Any?, configuration: DisplayConfiguration): String? { + return null + } +} diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/JupyterHtmlRenderer.kt b/dataframe-jupyter/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/JupyterHtmlRenderer.kt similarity index 97% rename from core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/JupyterHtmlRenderer.kt rename to dataframe-jupyter/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/JupyterHtmlRenderer.kt index 4d8e91bffe..dc120a6001 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/JupyterHtmlRenderer.kt +++ b/dataframe-jupyter/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/JupyterHtmlRenderer.kt @@ -1,3 +1,5 @@ +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") + package org.jetbrains.kotlinx.dataframe.jupyter import kotlinx.serialization.ExperimentalSerializationApi @@ -79,8 +81,8 @@ internal inline fun JupyterHtmlRenderer.render( val jsonEncodedDf = when { !ideBuildNumber.supportsDynamicNestedTables() -> { buildJsonObject { - put(NROW, df.size.nrow) - put(NCOL, df.size.ncol) + put(NROW, df.size().nrow) + put(NCOL, df.size().ncol) putJsonArray(COLUMNS) { addAll(df.columnNames()) } put(KOTLIN_DATAFRAME, encodeFrame(df.take(limit))) }.toString() diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/kernelUpdateMessages.kt b/dataframe-jupyter/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/kernelUpdateMessages.kt similarity index 100% rename from core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/kernelUpdateMessages.kt rename to dataframe-jupyter/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/kernelUpdateMessages.kt diff --git a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/CodeGenerationTests.kt b/dataframe-jupyter/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/CodeGenerationTests.kt similarity index 100% rename from core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/CodeGenerationTests.kt rename to dataframe-jupyter/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/CodeGenerationTests.kt diff --git a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/DataFrameJupyterTest.kt b/dataframe-jupyter/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/DataFrameJupyterTest.kt similarity index 100% rename from core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/DataFrameJupyterTest.kt rename to dataframe-jupyter/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/DataFrameJupyterTest.kt diff --git a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/JupyterCodegenTests.kt b/dataframe-jupyter/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/JupyterCodegenTests.kt similarity index 100% rename from core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/JupyterCodegenTests.kt rename to dataframe-jupyter/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/JupyterCodegenTests.kt diff --git a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/RenderingTests.kt b/dataframe-jupyter/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/RenderingTests.kt similarity index 99% rename from core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/RenderingTests.kt rename to dataframe-jupyter/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/RenderingTests.kt index f544c349b0..c34bac1ba6 100644 --- a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/RenderingTests.kt +++ b/dataframe-jupyter/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/RenderingTests.kt @@ -1,3 +1,5 @@ +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") + package org.jetbrains.kotlinx.dataframe.jupyter import io.kotest.assertions.throwables.shouldNotThrow diff --git a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/ResourcesTest.kt b/dataframe-jupyter/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/ResourcesTest.kt similarity index 100% rename from core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/ResourcesTest.kt rename to dataframe-jupyter/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/ResourcesTest.kt diff --git a/core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/SampleNotebooksTests.kt b/dataframe-jupyter/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/SampleNotebooksTests.kt similarity index 100% rename from core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/SampleNotebooksTests.kt rename to dataframe-jupyter/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/SampleNotebooksTests.kt diff --git a/dataframe-openapi/build.gradle.kts b/dataframe-openapi/build.gradle.kts index 9190e3ce28..a361c46bd3 100644 --- a/dataframe-openapi/build.gradle.kts +++ b/dataframe-openapi/build.gradle.kts @@ -31,6 +31,7 @@ dependencies { } testApi(project(":core")) + testImplementation(project(":dataframe-jupyter")) testImplementation(libs.junit) testImplementation(libs.kotestAssertions) { exclude("org.jetbrains.kotlin", "kotlin-stdlib-jdk8") @@ -49,3 +50,15 @@ kotlinPublications { kotlin { explicitApi() } + +// Only for tests. Because tests depend on kotlin-jupyter, and it's compatible with Java 11 +tasks.compileTestJava { + sourceCompatibility = JavaVersion.VERSION_11.toString() + targetCompatibility = JavaVersion.VERSION_11.toString() +} + +tasks.compileTestKotlin { + kotlinOptions { + jvmTarget = "11" + } +} diff --git a/settings.gradle.kts b/settings.gradle.kts index 43ed0bd81f..521364afdb 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -41,3 +41,4 @@ plugins { } include("dataframe-excel") include("core") +include("dataframe-jupyter")