Skip to content

Commit

Permalink
Merge pull request #846 from Kotlin/gradle-bump
Browse files Browse the repository at this point in the history
Gradle bump to 8.10 and housekeeping
  • Loading branch information
Jolanrensen authored Sep 2, 2024
2 parents fdec9a1 + 5be47cb commit fa70ab2
Show file tree
Hide file tree
Showing 18 changed files with 108 additions and 95 deletions.
17 changes: 9 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import com.github.gmazzo.buildconfig.BuildConfigExtension
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlinx.dataframe.AnyFrame
Expand Down Expand Up @@ -133,8 +134,8 @@ kotlin.jvmToolchain(11)

allprojects {
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
}
}

Expand Down Expand Up @@ -222,7 +223,7 @@ subprojects {
}

kotlinPublications {
fairDokkaJars.set(false)
fairDokkaJars = false

sonatypeSettings(
project.findProperty("kds.sonatype.user") as String?,
Expand All @@ -238,7 +239,7 @@ kotlinPublications {

pom {
githubRepo("Kotlin", "dataframe")
inceptionYear.set("2021")
inceptionYear = "2021"
licenses {
apache2()
}
Expand All @@ -252,10 +253,10 @@ kotlinPublications {
}

publication {
publicationName.set("api")
artifactId.set(projectName)
description.set("Data processing in Kotlin")
packageName.set(artifactId)
publicationName = "api"
artifactId = projectName
description = "Data processing in Kotlin"
packageName = artifactId
}

localRepositories {
Expand Down
39 changes: 19 additions & 20 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ val compileSamplesKotlin = tasks.named<KotlinCompile>("compileSamplesKotlin") {
libraries.from(it.libraries)
}
source(sourceSets["test"].kotlin)
destinationDirectory.set(layout.buildDirectory.dir("classes/testWithOutputs/kotlin"))
destinationDirectory = layout.buildDirectory.dir("classes/testWithOutputs/kotlin")
}

tasks.withType<KspTask> {
Expand Down Expand Up @@ -147,14 +147,14 @@ val clearSamplesOutputs by tasks.creating {
}

val addSamplesToGit by tasks.creating(GitTask::class) {
directory.set(file("."))
command.set("add")
args.set(listOf("-A", "../docs/StardustDocs/snippets"))
directory = file(".")
command = "add"
args = listOf("-A", "../docs/StardustDocs/snippets")
}

val copySamplesOutputs = tasks.register<JavaExec>("copySamplesOutputs") {
group = "documentation"
mainClass.set("org.jetbrains.kotlinx.dataframe.explainer.SampleAggregatorKt")
mainClass = "org.jetbrains.kotlinx.dataframe.explainer.SampleAggregatorKt"

dependsOn(clearSamplesOutputs)
dependsOn(samplesTest)
Expand Down Expand Up @@ -305,8 +305,8 @@ korro {

groupSamples {

beforeSample.set("<tab title=\"NAME\">\n")
afterSample.set("\n</tab>")
beforeSample = "<tab title=\"NAME\">\n"
afterSample = "\n</tab>"

funSuffix("_properties") {
replaceText("NAME", "Properties")
Expand All @@ -317,8 +317,8 @@ korro {
funSuffix("_strings") {
replaceText("NAME", "Strings")
}
beforeGroup.set("<tabs>\n")
afterGroup.set("</tabs>")
beforeGroup = "<tabs>\n"
afterGroup = "</tabs>"
}
}

Expand Down Expand Up @@ -366,19 +366,18 @@ tasks.withType<JavaCompile> {
}

tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf("-Xinline-classes", "-Xopt-in=kotlin.RequiresOptIn")
compilerOptions {
optIn.addAll("kotlin.RequiresOptIn")
freeCompilerArgs.addAll("-Xinline-classes")
}
}

tasks.test {
maxHeapSize = "2048m"
extensions.configure(kotlinx.kover.api.KoverTaskExtension::class) {
excludes.set(
listOf(
"org.jetbrains.kotlinx.dataframe.jupyter.*",
"org.jetbrains.kotlinx.dataframe.jupyter.SampleNotebooksTests",
),
excludes = listOf(
"org.jetbrains.kotlinx.dataframe.jupyter.*",
"org.jetbrains.kotlinx.dataframe.jupyter.SampleNotebooksTests",
)
}
}
Expand All @@ -389,10 +388,10 @@ tasks.processJupyterApiResources {

kotlinPublications {
publication {
publicationName.set("core")
artifactId.set("dataframe-core")
description.set("Dataframe core API")
packageName.set(artifactId)
publicationName = "core"
artifactId = "dataframe-core"
description = "Dataframe core API"
packageName = artifactId
}
}

Expand Down
8 changes: 4 additions & 4 deletions dataframe-arrow/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ dependencies {

kotlinPublications {
publication {
publicationName.set("dataframeArrow")
artifactId.set(project.name)
description.set("Apache Arrow support for Kotlin Dataframe")
packageName.set(artifactId)
publicationName = "dataframeArrow"
artifactId = project.name
description = "Apache Arrow support for Kotlin Dataframe"
packageName = artifactId
}
}

Expand Down
8 changes: 4 additions & 4 deletions dataframe-excel/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ dependencies {

kotlinPublications {
publication {
publicationName.set("dataframeExcel")
artifactId.set(project.name)
description.set("Excel support for Kotlin Dataframe")
packageName.set(artifactId)
publicationName = "dataframeExcel"
artifactId = project.name
description = "Excel support for Kotlin Dataframe"
packageName = artifactId
}
}

Expand Down
8 changes: 4 additions & 4 deletions dataframe-jdbc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ dependencies {

kotlinPublications {
publication {
publicationName.set("dataframeJDBC")
artifactId.set(project.name)
description.set("JDBC support for Kotlin Dataframe")
packageName.set(artifactId)
publicationName = "dataframeJDBC"
artifactId = project.name
description = "JDBC support for Kotlin Dataframe"
packageName = artifactId
}
}

Expand Down
8 changes: 4 additions & 4 deletions dataframe-openapi/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ dependencies {

kotlinPublications {
publication {
publicationName.set("dataframeOpenApi")
artifactId.set(project.name)
description.set("OpenAPI support for Kotlin Dataframe")
packageName.set(artifactId)
publicationName = "dataframeOpenApi"
artifactId = project.name
description = "OpenAPI support for Kotlin Dataframe"
packageName = artifactId
}
}

Expand Down
3 changes: 2 additions & 1 deletion examples/idea-examples/json/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlinx.dataframe.api.JsonPath

Expand All @@ -22,7 +23,7 @@ dependencies {
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
compilerOptions.jvmTarget = JvmTarget.JVM_1_8
}

dataframes {
Expand Down
5 changes: 3 additions & 2 deletions examples/idea-examples/movies/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand All @@ -15,13 +16,13 @@ repositories {
mavenLocal() // in case of local dataframe development
}

application.mainClass.set("org.jetbrains.kotlinx.dataframe.examples.movies.MoviesWithDataClassKt")
application.mainClass = "org.jetbrains.kotlinx.dataframe.examples.movies.MoviesWithDataClassKt"

dependencies {
// implementation("org.jetbrains.kotlinx:dataframe:X.Y.Z")
implementation(project(":"))
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
compilerOptions.jvmTarget = JvmTarget.JVM_1_8
}
6 changes: 4 additions & 2 deletions examples/idea-examples/titanic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
application
kotlin("jvm")
Expand All @@ -13,7 +15,7 @@ repositories {
mavenLocal() // in case of local dataframe development
}

application.mainClass.set("org.jetbrains.kotlinx.dataframe.examples.titanic.ml.TitanicKt")
application.mainClass = "org.jetbrains.kotlinx.dataframe.examples.titanic.ml.TitanicKt"

dependencies {
// implementation("org.jetbrains.kotlinx:dataframe:X.Y.Z")
Expand All @@ -35,7 +37,7 @@ dataframes {
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "11"
compilerOptions.jvmTarget = JvmTarget.JVM_11
}

tasks.withType<JavaCompile> {
Expand Down
5 changes: 3 additions & 2 deletions examples/idea-examples/youtube/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand All @@ -15,7 +16,7 @@ repositories {
mavenLocal() // in case of local dataframe development
}

application.mainClass.set("org.jetbrains.kotlinx.dataframe.examples.youtube.YoutubeKt")
application.mainClass = "org.jetbrains.kotlinx.dataframe.examples.youtube.YoutubeKt"

dependencies {
// implementation("org.jetbrains.kotlinx:dataframe:X.Y.Z")
Expand All @@ -24,6 +25,6 @@ dependencies {
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
compilerOptions.jvmTarget = JvmTarget.JVM_1_8
}

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 3 additions & 1 deletion plugins/dataframe-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
`kotlin-dsl`
`java-gradle-plugin`
Expand Down Expand Up @@ -86,7 +88,7 @@ gradlePlugin {
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
compilerOptions.jvmTarget = JvmTarget.JVM_1_8
}

tasks.withType<JavaCompile>().all {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import org.gradle.api.internal.project.ProjectInternal
import org.gradle.api.provider.Provider
import org.gradle.build.event.BuildEventsListenerRegistry
import org.gradle.internal.service.DefaultServiceRegistry
import org.gradle.internal.service.scopes.ProjectScopeServices
import org.gradle.testfixtures.ProjectBuilder
import org.gradle.tooling.events.OperationCompletionListener
import java.lang.reflect.Field
Expand All @@ -26,8 +25,8 @@ internal fun makeProject(): ProjectInternal {
*/
internal fun addBuildEventsListenerRegistryMock(project: Project) {
try {
val projectScopeServices = (project as DefaultProject).services as ProjectScopeServices
val state: Field = ProjectScopeServices::class.java.superclass.getDeclaredField("state")
val projectScopeServices = (project as DefaultProject).services as DefaultServiceRegistry
val state: Field = DefaultServiceRegistry::class.java.getDeclaredField("state")
state.isAccessible = true
@Suppress("UNCHECKED_CAST")
val stateValue: AtomicReference<Any> = state.get(projectScopeServices) as AtomicReference<Any>
Expand Down
2 changes: 1 addition & 1 deletion plugins/expressions-converter/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ sourceSets {

tasks.create<JavaExec>("generateTests") {
classpath = sourceSets.test.get().runtimeClasspath
mainClass.set("org.jetbrains.kotlinx.dataframe.GenerateTestsKt")
mainClass = "org.jetbrains.kotlinx.dataframe.GenerateTestsKt"
}

fun Test.setLibraryProperty(propName: String, jarName: String) {
Expand Down
Loading

0 comments on commit fa70ab2

Please sign in to comment.