Skip to content

Kotlin 2.2 #1286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ plugins {
alias(dokka)
// alias(kover)
alias(ktlint)
alias(korro) apply false
alias(kodex) apply false

// TODO cannot define korro and kodex here due to leaking them kotlin-compiler-embeddable into the build classpath
// alias(korro) apply false
// alias(kodex) apply false

alias(simpleGit) apply false
alias(dependencyVersions)
alias(buildconfig) apply false
Expand Down Expand Up @@ -155,6 +158,7 @@ val modulesUsingJava11 = with(projects) {
dataframeGeo,
examples.ideaExamples.titanic,
tests,
plugins.dataframeGradlePlugin,
)
}.map { it.path }

Expand Down Expand Up @@ -204,6 +208,7 @@ allprojects {
configure<BuildConfigExtension> {
packageName = "org.jetbrains.kotlinx.dataframe"
className = "BuildConfig"
buildConfigField("KOTLIN_VERSION", libs.versions.kotlin.asProvider().get())
buildConfigField("VERSION", "${project.version}")
buildConfigField("DEBUG", findProperty("kotlin.dataframe.debug")?.toString()?.toBoolean() ?: false)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,5 @@ public class ReducedGroupBy<T, G>(
}

@PublishedApi
internal fun <T, G> GroupBy<T, G>.reduce(reducer: Selector<DataFrame<G>, DataRow<G>?>) = ReducedGroupBy(this, reducer)
internal fun <T, G> GroupBy<T, G>.reduce(reducer: Selector<DataFrame<G>, DataRow<G>?>): ReducedGroupBy<T, G> =
ReducedGroupBy(this, reducer)
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ public class ReducedPivot<T>(
}

@PublishedApi
internal fun <T> Pivot<T>.reduce(reducer: Selector<DataFrame<T>, DataRow<T>?>) = ReducedPivot(this, reducer)
internal fun <T> Pivot<T>.reduce(reducer: Selector<DataFrame<T>, DataRow<T>?>): ReducedPivot<T> =
ReducedPivot(this, reducer)

@PublishedApi
internal inline fun <T> Pivot<T>.delegate(crossinline body: PivotGroupBy<T>.() -> DataFrame<T>): DataRow<T> =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ public fun <T> DataFrame<T>.toHTML(
configuration: DisplayConfiguration = DisplayConfiguration.DEFAULT,
cellRenderer: CellRenderer = DefaultCellRenderer,
getFooter: (DataFrame<T>) -> String? = { "DataFrame [${it.size}]" },
) = toHtml(configuration, cellRenderer, getFooter)
): DataFrameHtmlData = toHtml(configuration, cellRenderer, getFooter)

@Deprecated(TO_STANDALONE_HTML, ReplaceWith(TO_STANDALONE_HTML_REPLACE), DeprecationLevel.ERROR)
public fun <T> DataFrame<T>.toStandaloneHTML(
Expand Down
17 changes: 9 additions & 8 deletions dataframe-arrow/api/dataframe-arrow.api
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,15 @@ public abstract interface class org/jetbrains/kotlinx/dataframe/io/ArrowWriter :
public abstract fun getMismatchSubscriber ()Lkotlin/jvm/functions/Function1;
public abstract fun getMode ()Lorg/jetbrains/kotlinx/dataframe/io/ArrowWriter$Mode;
public abstract fun getTargetSchema ()Lorg/apache/arrow/vector/types/pojo/Schema;
public abstract fun saveArrowFeatherToByteArray ()[B
public abstract fun saveArrowIPCToByteArray ()[B
public abstract fun writeArrowFeather (Ljava/io/File;)V
public abstract fun writeArrowFeather (Ljava/io/OutputStream;)V
public abstract fun writeArrowFeather (Ljava/nio/channels/WritableByteChannel;)V
public abstract fun writeArrowIPC (Ljava/io/File;Z)V
public abstract fun writeArrowIPC (Ljava/io/OutputStream;)V
public abstract fun writeArrowIPC (Ljava/nio/channels/WritableByteChannel;)V
public fun saveArrowFeatherToByteArray ()[B
public fun saveArrowIPCToByteArray ()[B
public fun writeArrowFeather (Ljava/io/File;)V
public fun writeArrowFeather (Ljava/io/OutputStream;)V
public fun writeArrowFeather (Ljava/nio/channels/WritableByteChannel;)V
public fun writeArrowIPC (Ljava/io/File;Z)V
public fun writeArrowIPC (Ljava/io/OutputStream;)V
public fun writeArrowIPC (Ljava/nio/channels/WritableByteChannel;)V
public static synthetic fun writeArrowIPC$default (Lorg/jetbrains/kotlinx/dataframe/io/ArrowWriter;Ljava/io/File;ZILjava/lang/Object;)V
}

public final class org/jetbrains/kotlinx/dataframe/io/ArrowWriter$Companion {
Expand Down
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version=1.0.0
jupyterApiTCRepo=
kotlin.jupyter.add.scanner=false
org.gradle.jvmargs=-Xmx4G -Duser.language=en -Duser.country=US -Dfile.encoding=UTF-8

# build.number.detection=false
# build.number=0.8.0

Expand All @@ -12,6 +13,9 @@ org.gradle.jvmargs=-Xmx4G -Duser.language=en -Duser.country=US -Dfile.encoding=U
# KSP plugin in the modules that use it.
kotlin.dataframe.add.ksp=false

# We don't support ksp2
ksp.useKSP2=false

# Enables debug mode for dataframe.
# This can make certain tests and checks run that should not be run in production.
# It can also be turned on from the command line with `-Pkotlin.dataframe.debug=true`
Expand Down
14 changes: 7 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[versions]
ksp = "2.0.20-1.0.24"
ksp = "2.2.0-2.0.2"
kotlinJupyter = "0.12.0-383"

ktlint = "12.3.0"

# make sure to sync both manually with :generator module
kotlin = "2.0.20" # needs jupyter compatibility with Kotlin 2.1 to update
kotlinpoet = "1.18.1"
kotlin = "2.2.0" # needs jupyter compatibility with Kotlin 2.1 to update
kotlinpoet = "2.2.0"

dokka = "1.9.20"
libsPublisher = "1.9.23-dev-45"
dokka = "2.0.0"
libsPublisher = "2.2.0-rc3-dev-57"

# "Bootstrap" version of the dataframe, used in the build itself to generate @DataSchema APIs,
# dogfood Gradle / KSP plugins in tests and idea-examples modules
Expand Down Expand Up @@ -48,14 +48,14 @@ jsoup = "1.18.3"
arrow = "18.1.0"
kodex = "0.4.4"
simpleGit = "2.2.1"
dependencyVersions = "0.51.0"
dependencyVersions = "0.52.0"
plugin-publish = "1.3.0"
shadow = "8.3.5"
android-gradle-api = "7.3.1" # need to revise our tests to update
ktor = "3.0.1" # needs jupyter compatibility with Kotlin 2.1 to update
kotlin-compile-testing = "1.6.0"
duckdb = "1.1.3"
buildconfig = "5.5.1"
buildconfig = "5.6.7"
benchmark = "0.4.12"

geotools = "32.1"
Expand Down
22 changes: 17 additions & 5 deletions plugins/dataframe-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
`kotlin-dsl`
`java-gradle-plugin`
`maven-publish`
alias(libs.plugins.buildconfig)
alias(libs.plugins.plugin.publish)
alias(libs.plugins.ktlint)
}
Expand All @@ -14,26 +14,34 @@ repositories {

group = "org.jetbrains.kotlinx.dataframe"

buildscript {
dependencies {
classpath(embeddedKotlin("gradle-plugin"))
}
}

dependencies {
api(libs.kotlin.reflect)
implementation(projects.dataframe)
// experimental
implementation(projects.dataframeOpenapiGenerator)

compileOnly(embeddedKotlin("gradle-plugin"))
implementation(libs.kotlin.gradle.plugin.api)
implementation(libs.kotlin.gradle.plugin)
implementation(libs.serialization.core)
implementation(libs.serialization.json)
implementation(libs.ksp.gradle)
implementation(libs.ksp.api)

testImplementation(libs.junit)
testImplementation(gradleTestKit())
testImplementation(embeddedKotlin("test"))
testImplementation(embeddedKotlin("test-junit"))
testImplementation(libs.kotestAssertions)
testImplementation(libs.android.gradle.api)
testImplementation(libs.android.gradle)
testImplementation(embeddedKotlin("gradle-plugin"))
testImplementation(libs.ktor.server.netty)
testImplementation(libs.h2db)
testImplementation(gradleApi())
}

tasks.withType<ProcessResources> {
Expand Down Expand Up @@ -100,7 +108,11 @@ val integrationTestConfiguration by configurations.creating {
extendsFrom(configurations.testImplementation.get())
}

val integrationTestTask = task<Test>("integrationTest") {
tasks.pluginUnderTestMetadata {
pluginClasspath.from(integrationTestConfiguration)
}

val integrationTestTask = tasks.register<Test>("integrationTest") {
dependsOn(":plugins:symbol-processor:publishToMavenLocal")
dependsOn(":dataframe-arrow:publishToMavenLocal")
dependsOn(":dataframe-excel:publishToMavenLocal")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.jetbrains.dataframe.gradle

import com.google.devtools.ksp.gradle.KspAATask
import com.google.devtools.ksp.gradle.KspTask
import com.google.devtools.ksp.gradle.KspTaskJvm
import org.gradle.api.Plugin
import org.gradle.api.Project
Expand All @@ -8,13 +10,12 @@ import org.gradle.api.logging.LogLevel
import org.gradle.api.tasks.TaskProvider
import org.gradle.internal.logging.services.DefaultLoggingManager
import org.gradle.kotlin.dsl.create
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
import org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.tasks.BaseKotlinCompile
import java.io.File
import java.net.URL
import java.nio.file.Path
Expand Down Expand Up @@ -43,10 +44,15 @@ class SchemaGeneratorPlugin : Plugin<Project> {
group = GROUP
dependsOn(*generationTasks.toTypedArray())
}
tasks.withType(KspTaskJvm::class.java).configureEach {
tasks.withType(KspTask::class.java).configureEach {
dependsOn(generateAll)
dependsOn(*generationTasks.toTypedArray())
}
tasks.withType(KspAATask::class.java).configureEach {
dependsOn(generateAll)
dependsOn(*generationTasks.toTypedArray())
}
tasks.withType<KotlinCompile> {
tasks.withType(BaseKotlinCompile::class.java).configureEach {
dependsOn(generateAll)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.jetbrains.dataframe.gradle

import org.jetbrains.kotlinx.dataframe.BuildConfig

object TestData {

val csvSample =
Expand All @@ -15,5 +17,5 @@ object TestData {

val jsonName = "test.json"

val kotlinVersion = "1.6.0"
val kotlinVersion = BuildConfig.KOTLIN_VERSION
}
Loading