File tree Expand file tree Collapse file tree 9 files changed +60
-8
lines changed Expand file tree Collapse file tree 9 files changed +60
-8
lines changed Original file line number Diff line number Diff line change @@ -66,12 +66,6 @@ val createClasspathManifest = tasks.register("createClasspathManifest") {
66
66
val kotlinVersion: String by project
67
67
val androidGradlePluginVersion: String = " 7.2.2"
68
68
69
- configurations.implementation {
70
- exclude(group = " org.jetbrains.kotlin" , module = " kotlin-stdlib" )
71
- exclude(group = " org.jetbrains.kotlin" , module = " kotlin-stdlib-jdk7" )
72
- exclude(group = " org.jetbrains.kotlin" , module = " kotlin-stdlib-jdk8" )
73
- }
74
-
75
69
dependencies {
76
70
implementation(gradleApi())
77
71
implementation(" org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.6.2" )
@@ -116,7 +110,8 @@ java {
116
110
tasks {
117
111
compileTestKotlin {
118
112
kotlinOptions {
119
- languageVersion = " 1.6"
113
+ languageVersion = " 1.9"
114
+ freeCompilerArgs + = " -Xsuppress-version-warnings"
120
115
}
121
116
}
122
117
test {
Original file line number Diff line number Diff line change 1
1
version =0.13.2-SNAPSHOT
2
2
group =org.jetbrains.kotlinx
3
3
4
- kotlinVersion =1.8.10
4
+ kotlinVersion =1.8.20
5
5
pluginPublishVersion =0.10.1
6
6
7
7
kotlin.stdlib.default.dependency =false
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ fun ClassNode.isEffectivelyPublic(classVisibility: ClassVisibility?) =
32
32
&& ! isLocal()
33
33
&& ! isWhenMappings()
34
34
&& ! isSyntheticAnnotationClass()
35
+ && ! isEnumEntriesMappings()
35
36
&& (classVisibility?.isPublic(isPublishedApi()) ? : true )
36
37
37
38
@@ -40,6 +41,7 @@ fun ClassNode.isLocal() = outerMethod != null
40
41
fun ClassNode.isInner () = innerClassNode != null
41
42
fun ClassNode.isWhenMappings () = isSynthetic(access) && name.endsWith(" \$ WhenMappings" )
42
43
fun ClassNode.isSyntheticAnnotationClass () = isSynthetic(access) && name.contains(" \$ annotationImpl\$ " )
44
+ fun ClassNode.isEnumEntriesMappings () = isSynthetic(access) && name.endsWith(" \$ EntriesMappings" )
43
45
44
46
val ClassNode .effectiveAccess: Int get() = innerClassNode?.access ? : access
45
47
val ClassNode .outerClassName: String? get() = innerClassNode?.outerName
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2016-2023 JetBrains s.r.o.
3
+ * Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file.
4
+ */
5
+
6
+ package cases.enums
7
+
8
+ enum class EnumClass { A , B , C }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2016-2023 JetBrains s.r.o.
3
+ * Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file.
4
+ */
5
+
6
+ package cases .enums ;
7
+
8
+ public enum JavaEnum {
9
+ JA , JB , JC
10
+ }
Original file line number Diff line number Diff line change
1
+ package cases.enums
2
+
3
+ @OptIn(ExperimentalStdlibApi ::class )
4
+ fun test () {
5
+ EnumClass .entries.forEach {
6
+ println (it)
7
+ }
8
+
9
+ JavaEnum .entries.forEach {
10
+ println (it)
11
+ }
12
+ }
13
+
Original file line number Diff line number Diff line change
1
+ public final class cases/enums/EntriesKt {
2
+ public static final fun test ()V
3
+ }
4
+
5
+ public final class cases/enums/EnumClass : java/lang/Enum {
6
+ public static final field A Lcases/enums/EnumClass;
7
+ public static final field B Lcases/enums/EnumClass;
8
+ public static final field C Lcases/enums/EnumClass;
9
+ public static fun getEntries ()Lkotlin/enums/EnumEntries;
10
+ public static fun valueOf (Ljava/lang/String;)Lcases/enums/EnumClass;
11
+ public static fun values ()[Lcases/enums/EnumClass;
12
+ }
13
+
14
+ public final class cases/enums/JavaEnum : java/lang/Enum {
15
+ public static final field JA Lcases/enums/JavaEnum;
16
+ public static final field JB Lcases/enums/JavaEnum;
17
+ public static final field JC Lcases/enums/JavaEnum;
18
+ public static fun valueOf (Ljava/lang/String;)Lcases/enums/JavaEnum;
19
+ public static fun values ()[Lcases/enums/JavaEnum;
20
+ }
21
+
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ public final class cases/whenMappings/SampleEnum : java/lang/Enum {
7
7
public static final field A Lcases/whenMappings/SampleEnum;
8
8
public static final field B Lcases/whenMappings/SampleEnum;
9
9
public static final field C Lcases/whenMappings/SampleEnum;
10
+ public static fun getEntries ()Lkotlin/enums/EnumEntries;
10
11
public static fun valueOf (Ljava/lang/String;)Lcases/whenMappings/SampleEnum;
11
12
public static fun values ()[Lcases/whenMappings/SampleEnum;
12
13
}
Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ class CasesPublicAPITest {
55
55
56
56
@Test fun whenMappings () { snapshotAPIAndCompare(testName.methodName) }
57
57
58
+ @Test fun enums () { snapshotAPIAndCompare(testName.methodName) }
59
+
58
60
private fun snapshotAPIAndCompare (testClassRelativePath : String , nonPublicMarkers : Set <String > = emptySet()) {
59
61
val testClassPaths = baseClassPaths.map { it.resolve(testClassRelativePath) }
60
62
val testClasses = testClassPaths.flatMap { it.listFiles().orEmpty().asIterable() }
You can’t perform that action at this time.
0 commit comments