|
1 | | -# Contributing to the Kotlin Notebook IntelliJ Platform Integration |
2 | | - |
3 | | -The current local development process involves a few manual steps: |
4 | | - |
5 | | -1. Create a `Local.json` file with the following content: |
6 | | - ```json |
7 | | - { |
8 | | - "description": "IntelliJ Platform that can be used in embedded mode of Kotlin Notebook", |
9 | | - "properties": [ |
10 | | - { "name": "v", "value": "0.0.2-%VERSION%-SNAPSHOT" }, |
11 | | - { "name": "v-renovate-hint", "value": "update: package=org.jetbrains.kotlinx:kotlin-jupyter-intellij-platform" } |
12 | | - ], |
13 | | - "link": "https://plugins.jetbrains.com/docs/intellij/welcome.html", |
14 | | - "repositories": [ |
15 | | - "https://packages.jetbrains.team/maven/p/kds/kotlin-ds-maven" |
16 | | - ], |
17 | | - "dependencies": [ |
18 | | - "org.jetbrains.kotlinx:kotlin-jupyter-intellij-platform:$v" |
19 | | - ] |
20 | | - } |
21 | | - ``` |
22 | | -2. Edit `gradle.properties` and increase the `devAddition` property from `1` to `2`. |
23 | | -3. Update the `Local.json` file to replace `%VERSION%` with the same version number used in the previous step, for example changing `2` to get "0.0.2-2-SNAPSHOT". |
24 | | -4. Run the `publishToMavenLocal` task to publish the integration locally. |
25 | | -5. Load the local integration artifact using `%use /path/to/Local.json` instead of `%use intellij-platform`. |
26 | | -6. Reload the Kotlin Notebook Kernel. |
27 | | - |
28 | | -To publish a newer version of the local artifact, repeat steps 2-6. |
29 | | -Note that updating the version number is necessary to invalidate the dependency cache. |
| 1 | +# Contributing to kotlin-notebook-integrations |
| 2 | + |
| 3 | +This is a single, common contributing guide for all integrations in this repository |
| 4 | +(database, http-util, intellij-platform, etc.). |
| 5 | + |
| 6 | +## Local development flow (for any integration) |
| 7 | + |
| 8 | +1. Create a local JSON descriptor file (example name: `Local.json`). |
| 9 | + Put into it only what you plan to use (see the dependencies note below). |
| 10 | + A minimal template looks like this: |
| 11 | + |
| 12 | + ```json |
| 13 | + { |
| 14 | + "description": "Local snapshot of a Kotlin Notebook integration", |
| 15 | + "properties": [ |
| 16 | + { "name": "v", "value": "0.1.0-%VERSION%-SNAPSHOT" } |
| 17 | + ], |
| 18 | + "repositories": [ |
| 19 | + "*mavenLocal" |
| 20 | + ], |
| 21 | + "dependencies": [ |
| 22 | + "org.jetbrains.kotlinx:ARTIFACT_ID:$v" |
| 23 | + ] |
| 24 | + } |
| 25 | + ``` |
| 26 | + |
| 27 | + Replace `ARTIFACT_ID` with the integration you work on, for example: |
| 28 | + - `kotlin-jupyter-database` |
| 29 | + - `kotlin-jupyter-serialization` |
| 30 | + - `kotlin-jupyter-ktor-client` |
| 31 | + - `kotlin-jupyter-intellij-platform` |
| 32 | + |
| 33 | +2. In the repository root, open `gradle.properties` and increase `devAddition` by 1 (e.g., `1 → 2`). |
| 34 | + |
| 35 | +3. In your JSON file, replace `%VERSION%` with the same number from the previous step, so the property `v` |
| 36 | + becomes something like `0.1.0-2-SNAPSHOT`. |
| 37 | + |
| 38 | +4. Publish the module you are working on to your local Maven repository: |
| 39 | + - Database API: `./gradlew :integrations:database:database-api:publishToMavenLocal` |
| 40 | + - HTTP util – Serialization: `./gradlew :integrations:http-util:serialization:publishToMavenLocal` |
| 41 | + - HTTP util – Ktor Client: `./gradlew :integrations:http-util:ktor-client:publishToMavenLocal` |
| 42 | + - IntelliJ Platform: `./gradlew :integrations:intellij-platform:publishToMavenLocal` |
| 43 | + |
| 44 | + Alternatively, just run `./gradlew publishToMavenLocal` from the repository root to publish all modules. |
| 45 | + |
| 46 | +5. In a Kotlin Notebook, load your local snapshot using the absolute path to your JSON file |
| 47 | + (instead of a `%use <integration>` alias): |
| 48 | + |
| 49 | + ``` |
| 50 | + %use /absolute/path/to/Local.json |
| 51 | + ``` |
| 52 | + |
| 53 | +6. Reload the Kotlin Notebook Kernel if needed. |
| 54 | + |
| 55 | +To publish a newer snapshot, repeat steps 2–6. Bumping the version is required to invalidate the dependency cache. |
| 56 | + |
| 57 | +## Important: the "dependencies" field in JSON |
| 58 | + |
| 59 | +In the `dependencies` array, list exactly the artifacts you want to load in the notebook — no more, no less. |
| 60 | +There is no implicit or “magical” expansion. |
| 61 | + |
| 62 | +Examples: |
| 63 | + |
| 64 | +```json |
| 65 | +{ |
| 66 | + "dependencies": [ |
| 67 | + "org.jetbrains.kotlinx:kotlin-jupyter-database:$v" |
| 68 | + ] |
| 69 | +} |
| 70 | +``` |
| 71 | + |
| 72 | +```json |
| 73 | +{ |
| 74 | + "dependencies": [ |
| 75 | + "org.jetbrains.kotlinx:kotlin-jupyter-serialization:$v", |
| 76 | + "org.jetbrains.kotlinx:kotlin-jupyter-ktor-client:$v" |
| 77 | + ] |
| 78 | +} |
| 79 | +``` |
0 commit comments