Skip to content

Commit 621b483

Browse files
authored
Merge pull request #20114 from igfoo/igfoo/kotlin-2.2.20
Kotlin: Add Kotlin 2.2.20 support
2 parents 97cf15a + 604af65 commit 621b483

File tree

12 files changed

+61
-4
lines changed

12 files changed

+61
-4
lines changed

MODULE.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ use_repo(
230230
"kotlin-compiler-2.1.0-Beta1",
231231
"kotlin-compiler-2.1.20-Beta1",
232232
"kotlin-compiler-2.2.0-Beta1",
233+
"kotlin-compiler-2.2.20-Beta1",
233234
"kotlin-compiler-embeddable-1.6.0",
234235
"kotlin-compiler-embeddable-1.6.20",
235236
"kotlin-compiler-embeddable-1.7.0",
@@ -242,6 +243,7 @@ use_repo(
242243
"kotlin-compiler-embeddable-2.1.0-Beta1",
243244
"kotlin-compiler-embeddable-2.1.20-Beta1",
244245
"kotlin-compiler-embeddable-2.2.0-Beta1",
246+
"kotlin-compiler-embeddable-2.2.20-Beta1",
245247
"kotlin-stdlib-1.6.0",
246248
"kotlin-stdlib-1.6.20",
247249
"kotlin-stdlib-1.7.0",
@@ -254,6 +256,7 @@ use_repo(
254256
"kotlin-stdlib-2.1.0-Beta1",
255257
"kotlin-stdlib-2.1.20-Beta1",
256258
"kotlin-stdlib-2.2.0-Beta1",
259+
"kotlin-stdlib-2.2.20-Beta1",
257260
)
258261

259262
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")

docs/codeql/reusables/supported-versions-compilers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
Java,"Java 7 to 24 [6]_","javac (OpenJDK and Oracle JDK),
2222

2323
Eclipse compiler for Java (ECJ) [7]_",``.java``
24-
Kotlin,"Kotlin 1.6.0 to 2.2.0\ *x*","kotlinc",``.kt``
24+
Kotlin,"Kotlin 1.6.0 to 2.2.2\ *x*","kotlinc",``.kt``
2525
JavaScript,ECMAScript 2022 or lower,Not applicable,"``.js``, ``.jsx``, ``.mjs``, ``.es``, ``.es6``, ``.htm``, ``.html``, ``.xhtm``, ``.xhtml``, ``.vue``, ``.hbs``, ``.ejs``, ``.njk``, ``.json``, ``.yaml``, ``.yml``, ``.raml``, ``.xml`` [8]_"
2626
Python [9]_,"2.7, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13",Not applicable,``.py``
2727
Ruby [10]_,"up to 3.3",Not applicable,"``.rb``, ``.erb``, ``.gemspec``, ``Gemfile``"

java/kotlin-extractor/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ kt_javac_options(
8383
"kotlin.RequiresOptIn",
8484
"org.jetbrains.kotlin.ir.symbols.%s" %
8585
("IrSymbolInternals" if version_less(v, "2.0.0") else "UnsafeDuringIrConstructionAPI"),
86-
],
86+
] + ([] if version_less(v, "2.2.20") else ["org.jetbrains.kotlin.DeprecatedForRemovalCompilerApi"]),
8787
x_suppress_version_warnings = True,
8888
),
8989
# * extractor.name is different for each version, so we need to put it in different output dirs
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:1a244757dd8d015ca84f60acf37b9d2a1db094e5f340137f7a193eb697a2e2ab
3+
size 58137156
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:c537c05d90415d0c105b66910374f74cdfe513c29b4aefb0bd492bb82e0310c2
3+
size 56700664
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:248ffeafe6b539c0409c4781d506d15fc4b058a2ba4ebdbd65c051fe32bde9e0
3+
size 1760046

java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import org.jetbrains.kotlin.load.java.JvmAbi
3737
import org.jetbrains.kotlin.load.java.sources.JavaSourceElement
3838
import org.jetbrains.kotlin.load.java.structure.*
3939
import org.jetbrains.kotlin.load.java.typeEnhancement.hasEnhancedNullability
40-
import org.jetbrains.kotlin.load.kotlin.getJvmModuleNameForDeserializedDescriptor
4140
import org.jetbrains.kotlin.name.FqName
4241
import org.jetbrains.kotlin.name.NameUtils
4342
import org.jetbrains.kotlin.name.SpecialNames
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.github.codeql.utils.versions
2+
3+
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
4+
import org.jetbrains.kotlin.load.kotlin.getJvmModuleNameForDeserializedDescriptor
5+
6+
fun getJvmModuleNameForDeserializedDescriptor(descriptor: CallableMemberDescriptor): String? {
7+
return org.jetbrains.kotlin.load.kotlin.getJvmModuleNameForDeserializedDescriptor(descriptor)
8+
}
9+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.github.codeql.utils.versions
2+
3+
import org.jetbrains.kotlin.descriptors.*
4+
import org.jetbrains.kotlin.load.kotlin.JvmPackagePartSource
5+
import org.jetbrains.kotlin.metadata.deserialization.*
6+
import org.jetbrains.kotlin.metadata.jvm.deserialization.*
7+
import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf
8+
import org.jetbrains.kotlin.resolve.DescriptorUtils.*
9+
import org.jetbrains.kotlin.serialization.deserialization.descriptors.*
10+
11+
fun getJvmModuleNameForDeserializedDescriptor(descriptor: CallableMemberDescriptor): String? {
12+
val parent = getParentOfType(descriptor, ClassOrPackageFragmentDescriptor::class.java, false)
13+
14+
when {
15+
parent is DeserializedClassDescriptor -> {
16+
val classProto = parent.classProto
17+
val nameResolver = parent.c.nameResolver
18+
return classProto.getExtensionOrNull(JvmProtoBuf.classModuleName)
19+
?.let(nameResolver::getString)
20+
?: JvmProtoBufUtil.DEFAULT_MODULE_NAME
21+
}
22+
descriptor is DeserializedMemberDescriptor -> {
23+
val source = descriptor.containerSource
24+
if (source is JvmPackagePartSource) {
25+
return source.moduleName
26+
}
27+
}
28+
}
29+
30+
return null
31+
}
32+

java/kotlin-extractor/versions.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ VERSIONS = [
1212
"2.1.0-Beta1",
1313
"2.1.20-Beta1",
1414
"2.2.0-Beta1",
15+
"2.2.20-Beta1",
1516
]
1617

1718
def _version_to_tuple(v):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy