Verified Commit 2c9124cb authored by Konstantin Kopper's avatar Konstantin Kopper
Browse files

Kotlin 1.5.31 and some dependency upgrades

parent 28b4fabb
Pipeline #28972 passed with stages
in 5 minutes and 54 seconds
......@@ -5,18 +5,18 @@ if (!JavaVersion.current().isJava8Compatible)
error("Only JDK 8 or newer is supported!")
plugins {
kotlin("jvm") version "1.4.32"
kotlin("plugin.serialization") version "1.4.32"
id("org.jetbrains.dokka") version "1.4.30"
kotlin("jvm") version "1.5.31"
kotlin("plugin.serialization") version "1.5.31"
id("org.jetbrains.dokka") version "1.5.30"
}
repositories {
jcenter()
mavenCentral()
}
val ktorVersion = "1.5.2"
val junitVersion = "5.7.1"
val aspectjVersion = "1.9.6"
val ktorVersion = "1.6.3"
val junitVersion = "5.8.0"
val aspectjVersion = "1.9.7"
dependencies {
// The pseuco-java-compiler
......@@ -26,11 +26,11 @@ dependencies {
implementation(kotlin("stdlib-jdk8"))
// Coroutines
implementation("org.jetbrains.kotlinx", "kotlinx-coroutines-core", "1.4.3")
implementation("org.jetbrains.kotlinx", "kotlinx-coroutines-core", "1.5.2")
// Kotlin serialization
for (pkg in listOf("core", "json"))
implementation("org.jetbrains.kotlinx", "kotlinx-serialization-$pkg", "1.1.0")
implementation("org.jetbrains.kotlinx", "kotlinx-serialization-$pkg", "1.2.2")
// OpenJFX
if (JavaVersion.current().isJava11Compatible) {
......@@ -43,7 +43,7 @@ dependencies {
implementation("org.fxmisc.richtext", "richtextfx", "0.10.6")
// Apache Commons
implementation("commons-io", "commons-io", "2.8.0")
implementation("commons-io", "commons-io", "2.11.0")
implementation("org.apache.commons", "commons-lang3", "3.12.0")
// Ktor Apache client and server framework
......@@ -54,19 +54,19 @@ dependencies {
implementation("io.ktor", "ktor-freemarker", ktorVersion)
// http4k WebSocket client library
implementation("org.http4k", "http4k-client-websocket", "4.5.0.1")
implementation("org.http4k", "http4k-client-websocket", "4.13.0.0")
// AspectJ runtime
runtimeOnly("org.aspectj", "aspectjrt", aspectjVersion)
// NOP (no-operation) logger implementation
runtimeOnly("org.slf4j", "slf4j-nop", "1.7.30")
runtimeOnly("org.slf4j", "slf4j-nop", "1.7.32")
testImplementation("org.junit.jupiter", "junit-jupiter-api", junitVersion)
testImplementation("org.junit.jupiter", "junit-jupiter-params", junitVersion)
testRuntimeOnly("org.junit.jupiter", "junit-jupiter-engine", junitVersion)
testImplementation("org.mockito", "mockito-junit-jupiter", "3.8.0")
testImplementation("org.mockito", "mockito-junit-jupiter", "3.12.4")
}
version = "2.0.4"
......@@ -208,12 +208,15 @@ dependencies {
open class AspectJTask : DefaultTask() {
@InputFiles
@PathSensitive(PathSensitivity.RELATIVE)
lateinit var inPath: FileCollection
@InputFiles
@PathSensitive(PathSensitivity.RELATIVE)
lateinit var sources: FileCollection
@InputFiles
@PathSensitive(PathSensitivity.RELATIVE)
lateinit var classpath: FileCollection
@Internal
......@@ -253,13 +256,13 @@ val compilerAspects by tasks.creating(AspectJTask::class) {
inPath = pseucoJavaCompilerProject.files("build/originalClasses")
sources = project.files("src/main/kotlin/pseuco/javaCompiler/")
destination = pseucoJavaCompilerProject.tasks.compileJava.get().destinationDir
destination = pseucoJavaCompilerProject.tasks.compileJava.get().destinationDirectory.get().asFile
dependsOn(pseucoJavaCompilerProject.tasks.compileJava)
}
pseucoJavaCompilerProject.tasks {
compileJava { destinationDir = pseucoJavaCompilerProject.file("build/originalClasses") }
compileJava { destinationDirectory.set(pseucoJavaCompilerProject.file("build/originalClasses")) }
classes { dependsOn(compilerAspects) }
}
......
......@@ -230,6 +230,7 @@ internal object PseuCoDRD {
if (engine.id.plainString == "DRD")
foundDRD = true
@Suppress("NestedLambdaShadowedImplicitParameter")
if (engine.modellingFormalisms.let { it != null && ModellingFormalism.new("x-pseuco") in it })
supportsPseuCo = true
......
......@@ -142,6 +142,7 @@ internal class Main : Application() {
primaryStage.apply {
title = "pseuCo IDE"
scene = Scene(controller).also { controller.setShortcuts(it) }
@Suppress("RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
icons += Image(this@Main.javaClass.getResource("/fxGui/images/icon.png").toExternalForm())
}.show()
}
......@@ -159,6 +160,7 @@ internal class Main : Application() {
/**
* The stylesheet containing the general settings.
*/
@Suppress("RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
internal val GENERAL_STYLESHEET = Main::class.java.getResource("/fxGui/css/general.css").toExternalForm()
/**
......
......@@ -27,6 +27,7 @@ internal object Hints {
* @author Konstantin Kopper
* @since 2.0.0
*/
@Suppress("RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
private val hints =
Json.decodeFromString<Map<String, List<Replacement>>>(jsonHints.bufferedReader().use { it.readText() })
......@@ -37,7 +38,7 @@ internal object Hints {
* @author Konstantin Kopper
* @since 2.0.0
*/
private val keywords = PseuCoArea.PSEUCO_TOKEN.map { it to listOf(Replacement(it, it)) }.toMap()
private val keywords = PseuCoArea.PSEUCO_TOKEN.associateWith { listOf(Replacement(it, it)) }
/**
* Union of [keywords] and [hints].
......
......@@ -35,6 +35,7 @@ import javafx.stage.Window
* @param owner The window holding this pane. Needed to establish relation with [channelsStage].
* @constructor Creates a new debugger view bound to the given [task].
*/
@Suppress("RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
internal class DebuggerPane(internal val task: FXDebugger, owner: Window) : AnchorPane() {
/**
......
......@@ -830,6 +830,7 @@ internal class MainPane(private val stage: Window) : AnchorPane() {
Stage().apply {
title = "pseuCo IDE - File sharing"
scene = Scene(URLAlert(uri))
@Suppress("RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
icons += Image(this@MainPane::class.java.getResource("/fxGui/images/icon.png").toExternalForm())
initOwner(stage)
}.showAndWait()
......@@ -931,6 +932,7 @@ internal class MainPane(private val stage: Window) : AnchorPane() {
*/
@FXML
fun showHelp() {
@Suppress("RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
val icon = Image(javaClass.getResource("/fxGui/images/icon.png").toExternalForm())
Stage().apply {
......
......@@ -94,7 +94,7 @@ internal class PlaceholderHandler(private val codeArea: PseuCoArea) {
val index2 = countPlaceholdersUntil(end - 1)
assert(index1 <= index2)
(index1 until index2).forEach { tabs.removeAt(index1) }
(index1 until index2).forEach { _ -> tabs.removeAt(index1) }
return index2 - index1
}
......
......@@ -436,6 +436,7 @@ internal class PseuCoArea : CodeArea() {
* @author Konstantin Kopper
* @since 2.0.0
*/
@Suppress("RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
internal val PSEUCO_TOKEN =
Json.decodeFromString<List<String>>(
this::class.java.getResourceAsStream("/pseucoKeywords.json").bufferedReader().use { it.readText() })
......
......@@ -83,7 +83,7 @@ sealed class ParameterType {
override fun serialize(encoder: Encoder, value: ParameterType) =
when (value) {
is Bool, Int, Real, String -> encoder.encodeString(value::class.simpleName!!.toLowerCase())
is Bool, Int, Real, String -> encoder.encodeString(value::class.simpleName!!.lowercase())
is Enum -> encoder.encodeSerializableValue(Enum.serializer(), value)
is Option -> encoder.encodeSerializableValue(Option.serializer(), value)
}
......
......@@ -90,6 +90,7 @@ object CompanionWebApp {
post("/settings") {
call.receiveParameters().also { params ->
params["sharingMechanism"]?.also {
@Suppress("NestedLambdaShadowedImplicitParameter")
(it == "ws").also {
Config.useWebSocket = it
if (it) PseuCoFileSharer.useServer(PseuCoWebSocket) else PseuCoFileSharer.useAPI()
......
......@@ -17,9 +17,9 @@ import org.junit.jupiter.params.provider.ArgumentsProvider
import org.junit.jupiter.params.provider.ArgumentsSource
import org.junit.jupiter.params.provider.ValueSource
import org.mockito.Mock
import org.mockito.Mockito.`when`
import org.mockito.Mockito.anyInt
import org.mockito.Mockito.mock
import org.mockito.Mockito.`when`
import java.util.stream.Stream
/**
......
......@@ -23,11 +23,13 @@ import kotlin.reflect.jvm.isAccessible
@DisabledIfEnvironmentVariable(named = "CI", matches = "true")
class CompilerTests {
private val json = Json { isLenient = true }
@Suppress("RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
private val tests = File(this::class.java.getResource("/pseuco-tests/tests").toURI())
.listFiles { f -> f.extension == "json" }
.map { f ->
Json { isLenient = true }.decodeFromString<CompilerTestConfig>(f.readText()).let {
json.decodeFromString<CompilerTestConfig>(f.readText()).let {
CompilerTest(File(f.absolutePath.replace(Regex("json$"), "pseuco")),
"${it.description} (${f.nameWithoutExtension})", it.correctnessProperties)
}
......@@ -56,7 +58,7 @@ class CompilerTests {
assertEquals(cp.output.size, output.size)
assertIterableEquals(cp.output, output)
}
else -> fail { "Unsupported correctness property: '${cp::class.simpleName!!.toLowerCase()}'" }
else -> fail { "Unsupported correctness property: '${cp::class.simpleName!!.lowercase()}'" }
}
}
}
......
Subproject commit cc13d07d6313cf3224bf6f86dee4605c43f50dd1
Subproject commit 8dca0b5c41a09ae07f36376619c18001863a5fb2
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment