|
1 | | -# notice that this is used in the `@codeql_koblin_embeddable` external repo, which means we need to |
| 1 | +""" |
| 2 | +# Usage overview |
| 3 | +Building the extractor can be done via |
| 4 | +``` |
| 5 | +bazel build //java/kotlin-extractor:codeql-extractor-kotlin-<variant>-<version> |
| 6 | +``` |
| 7 | +where `<variant>` is either `standalone` or `embeddable`, and `<version>` is one of the supported versions. |
| 8 | +
|
| 9 | +For the moment both variants where tested by replacing them into `target/intree/codeql-java` and running one relevant integration test. |
| 10 | +
|
| 11 | +``` |
| 12 | +bazel build //java/kotlin-extractor |
| 13 | +``` |
| 14 | +will build a default variant: |
| 15 | +* standalone, unless `CODEQL_KOTLIN_SINGLE_VERSION_EMBEDDABLE` is set to true, in which case it will go for embeddable |
| 16 | +* the version will be taken as the last supported version less than the version of the currently installed `kotlinc` |
| 17 | + * if `CODEQL_KOTLIN_SINGLE_VERSION` is set, that will be used instead |
| 18 | + * if `kotlinc` is not installed, `1.9.20-Beta` will be used |
| 19 | +
|
| 20 | +If `kotlinc` is updated, bazel won't be aware of it and will therefore keep the same default version. Possible workarounds for that: |
| 21 | +* `bazel clean` |
| 22 | +* `bazel fetch --force @codeql_kotlin_defaults\\:all` |
| 23 | +* `CODEQL_KOTLIN_SINGLE_VERSION= bazel build //java/kotlin-extractor` |
| 24 | +""" |
| 25 | + |
| 26 | +# notice that this file is used in the `@codeql_koblin_embeddable` external repo, which means we need to |
2 | 27 | # reference explicitly @codeql |
3 | 28 | load( |
4 | 29 | "@codeql//java/kotlin-extractor:versions.bzl", |
5 | 30 | "VERSIONS", |
6 | 31 | "get_compatilibity_sources", |
| 32 | + "get_language_version", |
7 | 33 | "version_less", |
8 | 34 | ) |
9 | 35 | load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library") |
@@ -46,7 +72,7 @@ _resources = [ |
46 | 72 | name = "kotlinc-options-%s" % v, |
47 | 73 | include_stdlibs = "none", |
48 | 74 | jvm_target = "1.8", |
49 | | - language_version = v[:3], |
| 75 | + language_version = get_language_version(v), |
50 | 76 | warn = "error", |
51 | 77 | x_optin = [ |
52 | 78 | "kotlin.RequiresOptIn", |
|
0 commit comments