mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
Kotlin: reuse generated dbscheme in embeddable, and tweak comments
This commit is contained in:
@@ -6,7 +6,6 @@ bazel build //java/kotlin-extractor:codeql-extractor-kotlin-<variant>-<version>
|
||||
```
|
||||
where `<variant>` is either `standalone` or `embeddable`, and `<version>` is one of the supported versions.
|
||||
|
||||
|
||||
```
|
||||
bazel build //java/kotlin-extractor
|
||||
```
|
||||
@@ -49,14 +48,6 @@ py_binary(
|
||||
srcs = ["generate_dbscheme.py"],
|
||||
)
|
||||
|
||||
genrule(
|
||||
name = "generated-dbscheme",
|
||||
srcs = ["@codeql//java:dbscheme"],
|
||||
outs = ["KotlinExtractorDbScheme.kt"],
|
||||
cmd = "$(execpath :generate_dbscheme) $< $@",
|
||||
tools = [":generate_dbscheme"],
|
||||
)
|
||||
|
||||
_resources = [
|
||||
(
|
||||
r,
|
||||
@@ -102,7 +93,7 @@ _resources = [
|
||||
kt_jvm_library(
|
||||
name = "%s-%s" % (_extractor_name_prefix, v),
|
||||
srcs =
|
||||
[":generated-dbscheme"] +
|
||||
["@codeql//java/kotlin-extractor:generated-dbscheme"] +
|
||||
glob(
|
||||
[
|
||||
"src/**/*.kt",
|
||||
@@ -141,12 +132,15 @@ _resources = [
|
||||
for v in VERSIONS
|
||||
]
|
||||
|
||||
# default aliases, based on the kotlinc version installed on the host
|
||||
# * default version can be overridden with env variable CODEQL_KOTLIN_SINGLE_VERSION
|
||||
# * setting CODEQL_KOTLIN_SINGLE_VERSION_EMBEDDABLE=true overrides the default variant
|
||||
# * when a new kotlinc version is installed, you'll need to either `bazel clean` or
|
||||
# `bazel fetch --force @codeql_kotlin_defaults//:all` to refresh the default
|
||||
(
|
||||
genrule(
|
||||
name = "generated-dbscheme",
|
||||
srcs = ["@codeql//java:dbscheme"],
|
||||
outs = ["KotlinExtractorDbScheme.kt"],
|
||||
cmd = "$(execpath :generate_dbscheme) $< $@",
|
||||
tools = [":generate_dbscheme"],
|
||||
visibility = ["@codeql_kotlin_embeddable//:__pkg__"],
|
||||
),
|
||||
alias(
|
||||
name = "%s-standalone" % _common_extractor_name_prefix,
|
||||
actual = "%s-standalone-%s" % (
|
||||
|
||||
@@ -61,10 +61,6 @@ def _embeddable_source_impl(repository_ctx):
|
||||
"import org.jetbrains.kotlin.com.intellij",
|
||||
)
|
||||
repository_ctx.file(str(src).replace(str(src_dir), "src"), contents)
|
||||
repository_ctx.symlink(
|
||||
Label("//java/kotlin-extractor:generate_dbscheme.py"),
|
||||
"generate_dbscheme.py",
|
||||
)
|
||||
repository_ctx.symlink(
|
||||
Label("//java/kotlin-extractor:BUILD.bazel"),
|
||||
"BUILD.bazel",
|
||||
|
||||
Reference in New Issue
Block a user