diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index cbcb3b210..abb4feb9f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,9 +2,7 @@ kotlin = "2.2.0" dokka = "2.0.0" openapi-generator = "7.14.0" -jupyter-api = "0.12.0-398" -jupyter-testkit = "0.12.0-398" -jupyter-plugin = "0.12.0-398" +jupyter = "0.12.0-398" okio = "3.16.0" moshi = "1.15.2" okhttp = "5.1.0" @@ -26,8 +24,8 @@ retrofit-converter-moshi = { module = "com.squareup.retrofit2:converter-moshi", retrofit-converter-scalars = { module = "com.squareup.retrofit2:converter-scalars", version.ref = "retrofit" } kotlin-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlin-coroutines" } kotlin-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlin-coroutines" } -kotlin-jupyter-api = { module = "org.jetbrains.kotlinx:kotlin-jupyter-api", version.ref = "jupyter-api" } -kotlin-jupyter-testkit = { module = "org.jetbrains.kotlinx:kotlin-jupyter-test-kit", version.ref = "jupyter-testkit" } +kotlin-jupyter-api = { module = "org.jetbrains.kotlinx:kotlin-jupyter-api", version.ref = "jupyter" } +kotlin-jupyter-testkit = { module = "org.jetbrains.kotlinx:kotlin-jupyter-test-kit", version.ref = "jupyter" } kotlin-binary-compatibility-validator-plugin = { module = "org.jetbrains.kotlinx:binary-compatibility-validator", version.ref = "kotlin-binary-compatibility-validator" } kotlin-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } dokka-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" } @@ -35,6 +33,3 @@ openapi-generator-plugin = { module = "org.openapitools:openapi-generator-gradle slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" } slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" } guava = { module = "com.google.guava:guava", version.ref = "guava" } - -[plugins] -kotlin-jupyter = { id = "org.jetbrains.kotlin.jupyter.api", version.ref = "jupyter-plugin" } diff --git a/library/api/library.api b/library/api/library.api index 7ac387327..e8fc8f4c3 100644 --- a/library/api/library.api +++ b/library/api/library.api @@ -300,9 +300,32 @@ public final class com/gabrielfeo/develocity/api/internal/infrastructure/UUIDAda public final fun toJson (Ljava/util/UUID;)Ljava/lang/String; } -public final class com/gabrielfeo/develocity/api/internal/jupyter/DevelocityApiJupyterIntegration : org/jetbrains/kotlinx/jupyter/api/libraries/JupyterIntegration { +public final class com/gabrielfeo/develocity/api/internal/jupyter/DevelocityApiJupyterIntegration : org/jetbrains/kotlinx/jupyter/api/libraries/LibraryDefinition { public fun ()V - public fun onLoaded (Lorg/jetbrains/kotlinx/jupyter/api/libraries/JupyterIntegration$Builder;)V + public fun getAfterCellExecution ()Ljava/util/List; + public fun getClassAnnotations ()Ljava/util/List; + public fun getCodePreprocessors ()Ljava/util/List; + public fun getColorSchemeChangedCallbacks ()Ljava/util/List; + public fun getConverters ()Ljava/util/List; + public fun getDependencies ()Ljava/util/List; + public fun getDescription ()Ljava/lang/String; + public fun getFileAnnotations ()Ljava/util/List; + public fun getImports ()Ljava/util/List; + public fun getInit ()Ljava/util/List; + public fun getInitCell ()Ljava/util/List; + public fun getIntegrationTypeNameRules ()Ljava/util/List; + public fun getInternalVariablesMarkers ()Ljava/util/List; + public fun getInterruptionCallbacks ()Ljava/util/List; + public fun getMinKernelVersion ()Lorg/jetbrains/kotlinx/jupyter/api/KotlinKernelVersion; + public fun getOptions ()Ljava/util/Map; + public fun getOriginalDescriptorText ()Ljava/lang/String; + public fun getRenderers ()Ljava/util/List; + public fun getRepositories ()Ljava/util/List; + public fun getResources ()Ljava/util/List; + public fun getShutdown ()Ljava/util/List; + public fun getTextRenderers ()Ljava/util/List; + public fun getThrowableRenderers ()Ljava/util/List; + public fun getWebsite ()Ljava/lang/String; } public final class com/gabrielfeo/develocity/api/model/ApiProblem { diff --git a/library/build.gradle.kts b/library/build.gradle.kts index 3f15abe21..be9e0e015 100644 --- a/library/build.gradle.kts +++ b/library/build.gradle.kts @@ -1,4 +1,3 @@ -import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.dsl.KotlinVersion import org.jetbrains.kotlin.gradle.tasks.KotlinCompile @@ -7,13 +6,6 @@ plugins { id("com.gabrielfeo.develocity-api-code-generation") id("com.gabrielfeo.integration-test-suite") id("com.gabrielfeo.examples-test-suite") - alias(libs.plugins.kotlin.jupyter) -} - -tasks.processJupyterApiResources { - libraryProducers = listOf( - "com.gabrielfeo.develocity.api.internal.jupyter.DevelocityApiJupyterIntegration", - ) } // Order matters as this library is used as a Kotlin Jupyter kernel dependency (see #440) diff --git a/library/src/main/kotlin/com/gabrielfeo/develocity/api/internal/jupyter/DevelocityApiJupyterIntegration.kt b/library/src/main/kotlin/com/gabrielfeo/develocity/api/internal/jupyter/DevelocityApiJupyterIntegration.kt index 59aeeb4b2..249e5542b 100644 --- a/library/src/main/kotlin/com/gabrielfeo/develocity/api/internal/jupyter/DevelocityApiJupyterIntegration.kt +++ b/library/src/main/kotlin/com/gabrielfeo/develocity/api/internal/jupyter/DevelocityApiJupyterIntegration.kt @@ -1,13 +1,16 @@ package com.gabrielfeo.develocity.api.internal.jupyter -import org.jetbrains.kotlinx.jupyter.api.libraries.JupyterIntegration +import org.jetbrains.kotlinx.jupyter.api.KotlinKernelVersion +import org.jetbrains.kotlinx.jupyter.api.libraries.LibraryDefinition @Suppress("unused") -class DevelocityApiJupyterIntegration : JupyterIntegration() { +class DevelocityApiJupyterIntegration : LibraryDefinition { - override fun Builder.onLoaded() { - import("com.gabrielfeo.develocity.api.*") - import("com.gabrielfeo.develocity.api.model.*") - import("com.gabrielfeo.develocity.api.extension.*") - } + override val minKernelVersion = KotlinKernelVersion.from("0.12.0.217") + + override val imports = listOf( + "com.gabrielfeo.develocity.api.*", + "com.gabrielfeo.develocity.api.model.*", + "com.gabrielfeo.develocity.api.extension.*", + ) } diff --git a/library/src/main/resources/META-INF/kotlin-jupyter-libraries/libraries.json b/library/src/main/resources/META-INF/kotlin-jupyter-libraries/libraries.json new file mode 100644 index 000000000..816b9bf3d --- /dev/null +++ b/library/src/main/resources/META-INF/kotlin-jupyter-libraries/libraries.json @@ -0,0 +1,8 @@ +{ + "producers": [], + "definitions": [ + { + "fqn": "com.gabrielfeo.develocity.api.internal.jupyter.DevelocityApiJupyterIntegration" + } + ] +}