From 59240339930800fa9f9b75847d0cbb2014b2e11d Mon Sep 17 00:00:00 2001 From: Martin Azpillaga Aldalur Date: Fri, 27 Oct 2023 13:48:48 +0200 Subject: [PATCH] fix publications and tests in example projects --- examples/entity | 2 +- examples/rpg | 2 +- library/build.gradle.kts | 5 +++-- .../{test => testing}/DiagnosticSizeCheckerClient.kt | 2 +- .../languageserver/{test => testing}/TestKolasuServer.kt | 2 +- .../{test => testing}/rpg/RPGSymbolResolverAdapter.kt | 2 +- .../{test => testing}/rpg/TestRPGKolasuServer.kt | 4 ++-- plugin/build.gradle.kts | 8 +------- .../com/strumenta/languageserver/LanguageServerPlugin.kt | 6 +++++- 9 files changed, 16 insertions(+), 17 deletions(-) rename library/src/test/kotlin/com/strumenta/languageserver/{test => testing}/DiagnosticSizeCheckerClient.kt (96%) rename library/src/test/kotlin/com/strumenta/languageserver/{test => testing}/TestKolasuServer.kt (98%) rename library/src/test/kotlin/com/strumenta/languageserver/{test => testing}/rpg/RPGSymbolResolverAdapter.kt (92%) rename library/src/test/kotlin/com/strumenta/languageserver/{test => testing}/rpg/TestRPGKolasuServer.kt (96%) diff --git a/examples/entity b/examples/entity index e5d6eb8..a6b9e32 160000 --- a/examples/entity +++ b/examples/entity @@ -1 +1 @@ -Subproject commit e5d6eb89c6c1ea3de814886fc12ed91744ba9ec6 +Subproject commit a6b9e32ea25c42f4e4a375e9163bb6895cc73b86 diff --git a/examples/rpg b/examples/rpg index 589f8f8..eb74799 160000 --- a/examples/rpg +++ b/examples/rpg @@ -1 +1 @@ -Subproject commit 589f8f869f7a4c2261bacf5078f216cafccc8645 +Subproject commit eb747995caecb7e0f0f994a3c181131e9a70a1a0 diff --git a/library/build.gradle.kts b/library/build.gradle.kts index 9b837e6..35bb372 100644 --- a/library/build.gradle.kts +++ b/library/build.gradle.kts @@ -36,8 +36,9 @@ tasks.test { tasks.register("createTestJar") { archiveBaseName = "library-test" - from(Paths.get("src", "test", "kotlin")) - exclude("com/strumenta/languageserver/test/rpg*") + from(Paths.get("build", "classes", "kotlin", "test")) + exclude("com/strumenta/languageserver/testing/rpg*") + dependsOn(tasks.getByName("compileTestKotlin")) } publishing { diff --git a/library/src/test/kotlin/com/strumenta/languageserver/test/DiagnosticSizeCheckerClient.kt b/library/src/test/kotlin/com/strumenta/languageserver/testing/DiagnosticSizeCheckerClient.kt similarity index 96% rename from library/src/test/kotlin/com/strumenta/languageserver/test/DiagnosticSizeCheckerClient.kt rename to library/src/test/kotlin/com/strumenta/languageserver/testing/DiagnosticSizeCheckerClient.kt index 159f329..14804b2 100644 --- a/library/src/test/kotlin/com/strumenta/languageserver/test/DiagnosticSizeCheckerClient.kt +++ b/library/src/test/kotlin/com/strumenta/languageserver/testing/DiagnosticSizeCheckerClient.kt @@ -1,4 +1,4 @@ -package com.strumenta.languageserver.test +package com.strumenta.languageserver.testing import org.eclipse.lsp4j.MessageActionItem import org.eclipse.lsp4j.MessageParams diff --git a/library/src/test/kotlin/com/strumenta/languageserver/test/TestKolasuServer.kt b/library/src/test/kotlin/com/strumenta/languageserver/testing/TestKolasuServer.kt similarity index 98% rename from library/src/test/kotlin/com/strumenta/languageserver/test/TestKolasuServer.kt rename to library/src/test/kotlin/com/strumenta/languageserver/testing/TestKolasuServer.kt index 548ba04..be660a1 100644 --- a/library/src/test/kotlin/com/strumenta/languageserver/test/TestKolasuServer.kt +++ b/library/src/test/kotlin/com/strumenta/languageserver/testing/TestKolasuServer.kt @@ -1,4 +1,4 @@ -package com.strumenta.languageserver.test +package com.strumenta.languageserver.testing import com.google.gson.JsonObject import com.strumenta.kolasu.model.Node diff --git a/library/src/test/kotlin/com/strumenta/languageserver/test/rpg/RPGSymbolResolverAdapter.kt b/library/src/test/kotlin/com/strumenta/languageserver/testing/rpg/RPGSymbolResolverAdapter.kt similarity index 92% rename from library/src/test/kotlin/com/strumenta/languageserver/test/rpg/RPGSymbolResolverAdapter.kt rename to library/src/test/kotlin/com/strumenta/languageserver/testing/rpg/RPGSymbolResolverAdapter.kt index 8e86ff6..b1d3c99 100644 --- a/library/src/test/kotlin/com/strumenta/languageserver/test/rpg/RPGSymbolResolverAdapter.kt +++ b/library/src/test/kotlin/com/strumenta/languageserver/testing/rpg/RPGSymbolResolverAdapter.kt @@ -1,4 +1,4 @@ -package com.strumenta.languageserver.test.rpg +package com.strumenta.languageserver.testing.rpg import com.strumenta.kolasu.model.Node import com.strumenta.languageserver.SymbolResolver diff --git a/library/src/test/kotlin/com/strumenta/languageserver/test/rpg/TestRPGKolasuServer.kt b/library/src/test/kotlin/com/strumenta/languageserver/testing/rpg/TestRPGKolasuServer.kt similarity index 96% rename from library/src/test/kotlin/com/strumenta/languageserver/test/rpg/TestRPGKolasuServer.kt rename to library/src/test/kotlin/com/strumenta/languageserver/testing/rpg/TestRPGKolasuServer.kt index 9f0acc4..c39925a 100644 --- a/library/src/test/kotlin/com/strumenta/languageserver/test/rpg/TestRPGKolasuServer.kt +++ b/library/src/test/kotlin/com/strumenta/languageserver/testing/rpg/TestRPGKolasuServer.kt @@ -1,8 +1,8 @@ -package com.strumenta.languageserver.test.rpg +package com.strumenta.languageserver.testing.rpg import com.strumenta.kolasu.parsing.ASTParser import com.strumenta.languageserver.SymbolResolver -import com.strumenta.languageserver.test.TestKolasuServer +import com.strumenta.languageserver.testing.TestKolasuServer import com.strumenta.rpgparser.RPGKolasuParser import com.strumenta.rpgparser.model.CompilationUnit import org.eclipse.lsp4j.Position diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index b6742a8..c03f697 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -19,7 +19,7 @@ gradlePlugin { plugins { create("language-server-plugin") { group = "com.strumenta" - id = "language-server-plugin" + id = "com.strumenta.language-server-plugin" version = "0.0.0" implementationClass = "com.strumenta.languageserver.LanguageServerPlugin" } @@ -36,10 +36,4 @@ publishing { } } } - publications { - create("language-server-plugin") { - artifactId = "language-server-plugin" - from(components["java"]) - } - } } diff --git a/plugin/src/main/kotlin/com/strumenta/languageserver/LanguageServerPlugin.kt b/plugin/src/main/kotlin/com/strumenta/languageserver/LanguageServerPlugin.kt index 647dd7c..5560404 100644 --- a/plugin/src/main/kotlin/com/strumenta/languageserver/LanguageServerPlugin.kt +++ b/plugin/src/main/kotlin/com/strumenta/languageserver/LanguageServerPlugin.kt @@ -61,8 +61,9 @@ class LanguageServerPlugin : Plugin { project.dependencies.add("implementation", "org.apache.lucene:lucene-core:9.8.0") project.dependencies.add("implementation", "org.apache.lucene:lucene-codecs:9.8.0") project.dependencies.add("implementation", "org.apache.lucene:lucene-queryparser:9.8.0") - project.dependencies.add("testImplementation", "org.jetbrains.kotlin:kotlin-test-junit:1.8.22") + project.dependencies.add("testImplementation", "com.strumenta:language-server-test:0.0.0") + project.dependencies.add("testImplementation", "org.junit.jupiter:junit-jupiter:5.+") val projectPath = project.projectDir.toString() val language = project.rootProject.name @@ -93,6 +94,9 @@ class LanguageServerPlugin : Plugin { shadowJar.archiveFileName.set("$language.jar") shadowJar.excludes.add("org/apache/lucene/**/*") + val testTask = project.tasks.getByName("test") as org.gradle.api.tasks.testing.Test + testTask.useJUnitPlatform() + addCreateVscodeExtensionTask(project) addLaunchVscodeEditorTask(project) }