@@ -56,41 +56,45 @@ $ ./gradlew preprocessWorkflows
5656
5757There are currently three known caveats with the approach we follow.
5858
59- * https://youtrack.jetbrains.com/issue/KTIJ-16532
60- +
59+ === https://youtrack.jetbrains.com/issue/KTIJ-16532
60+
6161If you navigate to a file in the dependencies, only a decompiled file is opened,
6262even though the source JAR would be available. Also the quick documentation is missing.
63- +
63+
6464This can easily by mitigated by attaching the library to the normal project
6565dependencies while having the need to navigate the source files or while editing them,
6666which makes them properly viewable and documentation displayable in the editor.
6767
68- * https://youtrack.jetbrains.com/issue/KTIJ-14580
69- +
68+ === https://youtrack.jetbrains.com/issue/KTIJ-14580
69+
7070We use `@file:Import` to reduce code duplication by having common code in a common file.
7171Unfortunately, this triggers a Kotlin IntelliJ plugin bug where the imported file cannot
7272be loaded properly and so the things supplied by it like dependencies or common functions
7373are not available. This makes most of the workflow `*.main.kts` files red as hell in the
7474IDE currently.
75- +
75+
7676To reduce risk for eye-cancer while reading the `*.main.kts` scripts or to be able to
7777sanely edit them, temporarily add the `@file:DependsOn` from the imported file to the
7878importing file and wait a second, then remove the line again once you are done.
7979
80- * https://youtrack.jetbrains.com/issue/KT-42101
81- +
80+ === https://youtrack.jetbrains.com/issue/KT-42101
81+
8282We use `@file:Import` to reduce code duplication by having common code in a common file.
8383Unfortunately, this triggers a Kotlin bug where the compilation cache becomes confused
8484if the imported file is changed without the importing file being changed too.
85- +
85+
8686If only the imported file is changed, it could happen that an old version is used,
8787or it could also happen that classes added by a `@file:DependsOn` in the imported file
8888are not available to the importing file. So if there was a change in the imported file,
8989you either need to also change the importing file, or to properly execute the script,
90- you need to delete the stale entry from the compilation cache which can be found at for example
91- `~/.cache/main.kts.compiled.cache/` on Linux and `%LOCALAPPDATA%\main.kts.compiled.cache\`
92- on Windows. Alternatively, you can also delete the whole cache directory.
93- +
90+ you need to delete the stale entry from the compilation cache which can be found here:
91+
92+ - On Windows the default location is at `%LOCALAPPDATA%\main.kts.compiled.cache\`.
93+ - On Linux the default location is at `$XDG_CACHE_HOME/main.kts.compiled.cache/` or `~/.cache/main.kts.compiled.cache/`.
94+ - On macOS the default location is at `~/Library/Caches/main.kts.compiled.cache/`.
95+
96+ Alternatively, you can also delete the whole cache directory.
97+
9498Another option is to disable the compilation cache for the execution by setting the
9599environment variable `KOTLIN_MAIN_KTS_COMPILED_SCRIPTS_CACHE_DIR` or the system property
96100`kotlin.main.kts.compiled.scripts.cache.dir` to an empty value, depending on the run
0 commit comments