Skip to content

Commit d4be6b8

Browse files
committed
added docs about annotation driven configuration
1 parent 9f09f0b commit d4be6b8

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,27 @@ Yes, `kscript` supports an `//INLCUDE` directive. Absolute and relative paths, a
255255
```
256256
For an actual example see [here](test/resources/includes/include_variations.kts).
257257

258+
259+
## Why isn't kscript using annotations instead of comment directives to configure scripts?
260+
261+
Indeed using annotations would be cleaner. And kscript provides annotations to be used instead of comment directives. Example
262+
263+
```kotlin
264+
// annotation-driven script configuration
265+
@file:DependsOn("de.mpicbg.scicomp:kutils:0.4")
266+
267+
// comment directive
268+
//DEPS de.mpicbg.scicomp:kutils:0.4
269+
```
270+
See [here](https://github.com/holgerbrandl/kscript_annotations) for a complete listing of supported annotations.
271+
272+
To enable the use of these annotations in Intellij, the user must add the following artifact (hosted on jcenter) to the project dependencies:
273+
```
274+
com.github.holgerbrandl:kscript-annotations:1.0
275+
```
276+
277+
`kscript` will automatically detect an annotation-driven script, and if so will add this artifact to the dependencies internally.
278+
258279
Support
259280
-------
260281

0 commit comments

Comments
 (0)