Skip to content

Commit

Permalink
extract testing library to its own module
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Azpillaga Aldalur committed Feb 22, 2024
1 parent 1182fe7 commit c9435d5
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 10 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,9 @@ jobs:
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
- name: Install Gradle
run: |
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install gradle 8.3
- name: Build
env:
STRUMENTA_PACKAGES_USER: ${{ secrets.STRUMENTA_PACKAGES_USER }}
STRUMENTA_PACKAGES_TOKEN: ${{ secrets.STRUMENTA_PACKAGES_TOKEN }}
run: |
cd library && gradle build --console=plain --stacktrace
cd ../plugin && gradle build --console=plain --stacktrace
./gradlew build --console=plain --stacktrace
2 changes: 1 addition & 1 deletion plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ gradlePlugin {
website = "https://strumenta.com"
vcsUrl = "https://github.com/Strumenta/kolasu-languageserver-library"
plugins {
create("com.strumenta.kolasu.language-server-plugin") {
create("com.strumenta.kolasu.languageserver.plugin") {
id = "com.strumenta.kolasu.languageserver.plugin"
version = project.version
displayName = "Kolasu language server plugin"
Expand Down
2 changes: 2 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
include("library")
include("testing")
include("plugin")

rootProject.name="kolasu-languageserver"
project(":library").name = "kolasu-languageserver-library"
project(":testing").name = "kolasu-languageserver-testing"
project(":plugin").name = "kolasu-languageserver-plugin"
80 changes: 80 additions & 0 deletions testing/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import java.net.URI

plugins {
id("org.jetbrains.kotlin.jvm") version "1.8.22"
id("org.jlleitschuh.gradle.ktlint") version "11.6.0"
id("maven-publish")
id("signing")
}

repositories {
mavenCentral()
}

dependencies {
implementation(project(":kolasu-languageserver-library"))
implementation("com.strumenta.kolasu:kolasu-core:1.5.31")
implementation("org.eclipse.lsp4j:org.eclipse.lsp4j:0.21.1")
implementation("org.junit.jupiter:junit-jupiter-api:5.7.1")
}

java {
withSourcesJar()
withJavadocJar()
}

val isReleaseVersion = !(project.version as String).endsWith("SNAPSHOT")

publishing {
repositories {
maven {
val releaseRepo = URI("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotRepo = URI("https://oss.sonatype.org/content/repositories/snapshots/")
url = if (isReleaseVersion) releaseRepo else snapshotRepo
credentials {
username = project.properties["ossrhUsername"] as String
password = project.properties["ossrhPassword"] as String
}
}
}
publications {
create<MavenPublication>("language-server-testing") {
groupId = "com.strumenta.kolasu.languageserver"
artifactId = "testing"
version = rootProject.version as String

artifact(tasks.getByName("jar"))
artifact(tasks.getByName("sourcesJar"))
artifact(tasks.getByName("javadocJar"))

pom {
name = "Kolasu language server testing"
description = "Test Kolasu language servers"
inceptionYear = "2023"
url = "https://github.com/Strumenta/kolasu-languageserver-library"
licenses {
license {
name = "Apache License, Version 2.0"
url = "https://opensource.org/license/apache-2-0/"
}
}
developers {
developer {
id = "martin-azpillaga"
name = "Martin Azpillaga Aldalur"
email = "[email protected]"
}
}
scm {
url = "https://github.com/Strumenta/kolasu-languageserver-library.git"
connection = "scm:git:git:github.com/Strumenta/kolasu-languageserver-library.git"
developerConnection = "scm:git:ssh:github.com/Strumenta/kolasu-languageserver-library.git"
}
}
}
}
}

signing {
sign(publishing.publications.getByName("language-server-testing"))
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.strumenta.kolasu.languageserver.testing
package testing

import org.eclipse.lsp4j.MessageActionItem
import org.eclipse.lsp4j.MessageParams
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.strumenta.kolasu.languageserver.testing
package testing

import com.google.gson.JsonObject
import com.strumenta.kolasu.languageserver.CodeGenerator
Expand Down

0 comments on commit c9435d5

Please sign in to comment.