Skip to content

Java 8 support #189

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

Merged
merged 11 commits into from
Dec 29, 2022
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

jobs:
build-all-versions:
timeout-minutes: 30
strategy:
matrix:
scala: [ "2.12.17", "2.13.10" ]
Expand Down
9 changes: 5 additions & 4 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
object Versions {
const val project = "1.2.3-SNAPSHOT"
const val groupID = "org.jetbrains.kotlinx.spark"
const val kotlin = "1.7.20"
const val jvmTarget = "11"
const val kotlin = "1.8.0"
const val jvmTarget = "8"
const val jupyterJvmTarget = "11"

inline val spark get() = System.getProperty("spark") as String
inline val scala get() = System.getProperty("scala") as String
inline val sparkMinor get() = spark.substringBeforeLast('.')
inline val scalaCompat get() = scala.substringBeforeLast('.')

const val jupyter = "0.11.0-134"
const val kotest = "5.3.2"
const val jupyter = "0.11.0-210"
const val kotest = "5.5.4"
const val kotestTestContainers = "1.3.3"
const val dokka = "1.7.10"
const val jcp = "7.0.5"
Expand Down
6 changes: 6 additions & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,19 @@ java {
languageVersion.set(
JavaLanguageVersion.of(Versions.jvmTarget)
)
} else if (Versions.jvmTarget == "1.8" || Versions.jvmTarget == "8") {
languageVersion.set(
JavaLanguageVersion.of(8)
)
}
}
}

tasks.withType<ScalaCompile> {
if (Versions.scalaCompat.toDouble() > 2.12) { // scala 2.12 will always target java 8
targetCompatibility = Versions.jvmTarget
} else if (Versions.jvmTarget == "1.8" || Versions.jvmTarget == "8") {
targetCompatibility = "1.8"
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kotlin.daemon.jvmargs=-Xmx10G
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=1G -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
kotlin.daemon.jvmargs=-Xmx8g
org.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=1g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
mavenCentralUsername=dummy
mavenCentralPassword=dummy

Expand Down
3 changes: 2 additions & 1 deletion jupyter/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ repositories {

tasks.withType<Test>().configureEach {
useJUnitPlatform()
maxHeapSize = "2g"
}

tasks.processJupyterApiResources {
Expand Down Expand Up @@ -143,7 +144,7 @@ tasks.compileTestKotlin {
kotlin {
jvmToolchain {
languageVersion.set(
JavaLanguageVersion.of(Versions.jvmTarget)
JavaLanguageVersion.of(Versions.jupyterJvmTarget)
)
}
}
Expand Down
1 change: 1 addition & 0 deletions kotlin-spark-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ repositories {

tasks.withType<Test>().configureEach {
useJUnitPlatform()
maxHeapSize = "8g"
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,11 @@ class UDFTest : ShouldSpec({
override fun outputEncoder() = encoder<Double>()
}

shouldThrow<IllegalStateException> {
// cannot get name of an unnamed object
udaf(e)
}
// shouldThrow<IllegalStateException> {
// // cannot get name of an unnamed object
// println(e::class.simpleName) // apparently this is now "e$1"
// udaf(e)
// }
// should use instead
udafUnnamed(e)
// or
Expand Down Expand Up @@ -623,7 +624,7 @@ class UDFTest : ShouldSpec({
myAverage(col(Employee::salary))
).showDS()

"(${Employee::salary.name})" shouldBe result.columns().single()
result.columns().single() shouldBe "myaverage\$1(${Employee::salary.name})"
result should beOfType<Dataset<Double>>()
result.collectAsList().single() shouldBe 3750.0
}
Expand Down
1 change: 1 addition & 0 deletions scala-tuples-in-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ repositories {

tasks.withType<Test>().configureEach {
useJUnitPlatform()
maxHeapSize = "4g"
}

dependencies {
Expand Down