Skip to content

Commit

Permalink
feat(docs): improve the plugin developer guide (#2017)
Browse files Browse the repository at this point in the history
* feat(docs): improve the plugin developer guide

* fix: wording

* fix: wording

---------

Co-authored-by: Will Russell <[email protected]>
  • Loading branch information
loicmathieu and wrussell1999 authored Dec 6, 2024
1 parent ddc8ded commit 2a8bd59
Show file tree
Hide file tree
Showing 4 changed files with 184 additions and 70 deletions.
10 changes: 5 additions & 5 deletions content/docs/plugin-developer-guide/00.setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ That template will create a project hosting a group of plugins — we usually cr
Note that the Kestra plugin library **version** must align with your Kestra instance. You may encounter validation issues during flow creation (e.g. `Invalid bean` response with status 422) when some plugins are on an older version of the Kestra plugin library. In that case, you may want to update the file `plugin-yourplugin/gradle.properties` and set the `version` property to the correct Kestra version e.g.:

```
version=0.17.0-SNAPSHOT
kestraVersion=[0.17,)
version=0.20.0-SNAPSHOT
kestraVersion=[0.20,)
```

It's not mandatory that your plugin version matches the Kestra version, Kestra's official plugins version will always match the minor version of Kestra but it's only a best practice.
It's not mandatory that your plugin version matches the Kestra version, Kestra's official plugins version will always match the minor version of Kestra, but it's only a best practice.

Then rebuild and publish the plugin.
::
Expand All @@ -34,13 +34,13 @@ Kestra plugins development requirements are:

Here are the steps:

1. Go on the [plugin-template](https://github.com/kestra-io/plugin-template) repository.
1. Go to the [plugin-template](https://github.com/kestra-io/plugin-template) repository.
2. Click on *Use this template*.
3. Choose the GitHub account you want to link and the repository name for the new plugin.
4. Clone the new repository: `git clone [email protected]:{{user}}/{{name}}.git`.
5. Open the cloned directory in IntelliJ IDEA.
6. Enable [annotations processors](https://www.jetbrains.com/help/idea/annotation-processors-support.html).
7. If you are using an IntelliJ IDEA < 2020.03, install the [lombok plugins](https://plugins.jetbrains.com/plugin/6317-lombok) (if not, it's included by default).
7. If you are using IntelliJ IDEA < 2020.03, install the [lombok plugins](https://plugins.jetbrains.com/plugin/6317-lombok) (if not, it's included by default).


Once you completed the steps above, you should see a similar directory structure:
Expand Down
6 changes: 3 additions & 3 deletions content/docs/plugin-developer-guide/01.gradle.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ The first thing you need to configure is the plugin name and the class package.
3. Change the package name on `build.gradle`: replace `group "io.kestra.plugin.templates"` to the package name.


Now you can start [developing your task](./02.task.md) or look at other optional gradle configuration.
Now you can start [developing your task](./02.task.md) or look at other optional Gradle configuration.

### Other configurations

#### Include some dependencies on plugins

You can add as many dependencies to your plugins, they will be isolated in the Kestra runtime. Thanks to this isolation, we ensure that two different versions of the same library will not clash and have runtime errors about missing methods.

The `build.gradle` handle most of Kestra use case by default using `compileOnly group: "io.kestra", name: "core", version: kestraVersion` for Kestra libs.
The `build.gradle` includes the Kestra core library which should cover much of the task needs via `compileOnly group: "io.kestra", name: "core", version: kestraVersion`.

But if your plugin need some dependencies, you can add as many as you want that will be isolated, you just need to add `api` dependencies:
But if your plugin need some dependencies, you can add as many as you want that will be isolated, you need to add `api` dependencies:

```groovy
api group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
Expand Down
Loading

0 comments on commit 2a8bd59

Please sign in to comment.