@@ -52,68 +52,27 @@ You may also add a Kotlin kernel integration to your library using a
52
52
In the following code snippets ` <jupyterApiVersion> ` is one of the published versions from the link above.
53
53
It is encouraged to use the latest stable version.
54
54
55
- First, adjust your ` settings.gradle ` file:
56
- ``` groovy
57
- pluginManagement {
58
- repositories {
59
- maven("https://kotlin.bintray.com/kotlin-datascience/")
60
- }
61
-
62
- resolutionStrategy {
63
- eachPlugin {
64
- if (requested.id.id == 'org.jetbrains.kotlinx.jupyter.api.plugin') {
65
- useModule('org.jetbrains.kotlinx.jupyter:kotlin-jupyter-api-gradle-plugin:<jupyterApiVersion>')
66
- }
67
- }
68
- }
69
- }
70
- ```
71
-
72
- Or, ** alternatively** , your ` setting.gradle.kts ` file:
73
- ``` kotlin
74
- pluginManagement {
75
- repositories {
76
- maven(" https://kotlin.bintray.com/kotlin-datascience/" )
77
- }
78
-
79
- resolutionStrategy {
80
- eachPlugin {
81
- when (requested.id.id) {
82
- " org.jetbrains.kotlinx.jupyter.api.plugin" -> useModule(" org.jetbrains.kotlinx.jupyter:kotlin-jupyter-api-gradle-plugin:<jupyterApiVersion>" )
83
- }
84
- }
85
- }
86
- }
87
- ```
88
-
89
- Then, add the plugin and API dependencies into your buildscript.
55
+ First, add the plugin dependency into your buildscript.
90
56
91
57
For ` build.gradle ` :
92
58
``` groovy
93
59
plugins {
94
- id "org.jetbrains.kotlinx.jupyter.api.plugin" version "<jupyterApiVersion>"
95
- }
96
-
97
- dependencies {
98
- implementation "org.jetbrains.kotlin:kotlin-stdlib"
99
- implementation "org.jetbrains.kotlin:kotlin-reflect"
100
- compileOnly("org.jetbrains.kotlinx.jupyter:kotlin-jupyter-api:<jupyterApiVersion>")
60
+ id "org.jetbrains.kotlin.jupyter.api" version "<jupyterApiVersion>"
101
61
}
102
62
```
103
63
104
64
For ` build.gradle.kts ` :
105
65
``` kotlin
106
66
plugins {
107
- id(" org.jetbrains.kotlinx.jupyter.api.plugin" ) version " <jupyterApiVersion>"
108
- }
109
-
110
- dependencies {
111
- implementation(kotlin(" stdlib" ))
112
- implementation(kotlin(" reflect" ))
113
- compileOnly(" org.jetbrains.kotlinx.jupyter:kotlin-jupyter-api:<jupyterApiVersion>" )
67
+ kotlin(" jupyter.api" ) version " <jupyterApiVersion>"
114
68
}
115
69
```
116
70
71
+ This plugin adds dependencies to api and annotations ("scanner") artifacts to your project. You may turn of
72
+ the auto-including of these artifacts by specifying following Gradle properties:
73
+ - ` kotlin.jupyter.add.api ` to ` false ` . Add it manually using ` org.jetbrains.kotlinx.jupyter.api.plugin.UtilKt.addKotlinJupyterApiDependency `
74
+ - ` kotlin.jupyter.add.scanner ` to ` false ` . Add it manually using ` org.jetbrains.kotlinx.jupyter.api.plugin.UtilKt.addKotlinJupyterScannerDependency `
75
+
117
76
Finally, refer your implementations of ` org.jetbrains.kotlinx.jupyter.api.libraries.LibraryDefinitionProducer ` and/or
118
77
` org.jetbrains.kotlinx.jupyter.api.libraries.LibraryDefinition ` in your buildscript.
119
78
@@ -162,14 +121,6 @@ definitions inside your JAR - you may mark them with special annotations
162
121
and attach specific annotation processor to process them. See how it
163
122
works.
164
123
165
- Add these two additional dependencies to your buildscript:
166
- ``` groovy
167
- dependencies {
168
- implementation("org.jetbrains.kotlinx.jupyter:kotlin-jupyter-api-annotations:<jupyterApiVersion>")
169
- kapt("org.jetbrains.kotlinx.jupyter:kotlin-jupyter-api-annotations:<jupyterApiVersion>")
170
- }
171
- ```
172
-
173
124
Now you don't need to specify options for ` processJupyterApiResources ` task.
174
125
Just mark your integration class with ` JupyterLibrary ` annotations:
175
126
0 commit comments