Skip to content

Commit 43b7d2b

Browse files
committed
deprecated generateCode in favor of generateInterfaces. Reworked generateCode.kt from feedback
1 parent 42d5f06 commit 43b7d2b

File tree

8 files changed

+951
-342
lines changed

8 files changed

+951
-342
lines changed

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/generateCode.kt

Lines changed: 350 additions & 52 deletions
Large diffs are not rendered by default.

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/Marker.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ import org.jetbrains.kotlinx.dataframe.impl.schema.DataFrameSchemaImpl
44
import org.jetbrains.kotlinx.dataframe.schema.DataFrameSchema
55
import kotlin.reflect.KClass
66

7+
/**
8+
* Which type of visibility the marker (generated class-like code declaration)
9+
* will have:
10+
* - [INTERNAL][INTERNAL]: "internal"
11+
* - [IMPLICIT_PUBLIC][IMPLICIT_PUBLIC]: ""
12+
* - [EXPLICIT_PUBLIC][EXPLICIT_PUBLIC]: "public"
13+
*/
714
public enum class MarkerVisibility {
815
INTERNAL,
916
IMPLICIT_PUBLIC,

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/util/deprecationMessages.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,15 @@ internal const val TO_URL_REPLACE = "toUrl()"
113113
internal const val FILTER_BY = "This function is deprecated in favor of `filter { }`. $MESSAGE_1_0"
114114
internal const val FILTER_BY_REPLACE = "filter { column }"
115115

116+
internal const val GENERATE_CODE =
117+
"This function has been deprecated in favor of the more explicit `generateInterfaces()`. The `fields` parameter has also been removed. Use `CodeGenerator` explicitly, if you need it. $MESSAGE_1_0"
118+
119+
internal const val GENERATE_CODE_REPLACE1 = "this.generateInterfaces(extensionProperties = extensionProperties)"
120+
internal const val GENERATE_CODE_REPLACE2 =
121+
"this.generateInterfaces(markerName = markerName, extensionProperties = extensionProperties, visibility = visibility)"
122+
123+
internal const val GENERATE_INTERFACES = "This function is just here for binary compatibility. $MESSAGE_1_0"
124+
116125
// endregion
117126

118127
// region WARNING in 1.0, ERROR in 1.1

core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/codeGen/CodeGenerationTests.kt

Lines changed: 374 additions & 10 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)