Skip to content

Commit

Permalink
add language server library repo as maven repository in plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Azpillaga Aldalur committed Oct 26, 2023
1 parent 5896544 commit dca81e7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 3 additions & 3 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ publishing {
maven {
url = uri("https://maven.pkg.github.com/Strumenta/kolasu-languageserver-library")
credentials {
username = project.findProperty("starlasu.github.user").toString()
password = project.findProperty("starlasu.github.token").toString()
username = (if (extra.has("starlasu.github.user")) extra["starlasu.github.user"] else System.getenv("STRUMENTA_PACKAGES_USER")) as String?
password = (if (extra.has("starlasu.github.token")) extra["starlasu.github.token"] else System.getenv("STRUMENTA_PACKAGES_TOKEN")) as String?
}
}
}
publications {
create<MavenPublication>("mavenJava") {
create<MavenPublication>("language-server-plugin") {
artifactId = "language-server-plugin"
from(components["java"])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.configurationcache.extensions.capitalized
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformJvmPlugin
import org.jetbrains.kotlin.gradle.plugin.statistics.ReportStatisticsToElasticSearch.url
import org.jetbrains.kotlin.konan.file.File
import java.nio.file.Files
import java.nio.file.Path
Expand Down Expand Up @@ -43,8 +44,13 @@ class LanguageServerPlugin : Plugin<Project?> {
project.pluginManager.apply(ShadowPlugin::class.java)
project.pluginManager.apply(KotlinPlatformJvmPlugin::class.java)

project.repositories.add(project.repositories.mavenCentral())
project.repositories.add(project.repositories.mavenLocal())
project.repositories.add(project.repositories.mavenCentral())
project.repositories.maven {}.apply {
url = java.net.URI("https://maven.pkg.github.com/Strumenta/kolasu-languageserver-library")
credentials.username = (if (project.findProperty("starlasu.github.user") != null) project.findProperty("starlasu.github.user") else System.getenv("STRUMENTA_PACKAGES_USER")) as String?
credentials.password = (if (project.findProperty("starlasu.github.token") != null) project.findProperty("starlasu.github.token") else System.getenv("STRUMENTA_PACKAGES_TOKEN")) as String?
}

if (project.rootProject.subprojects.any { it.name == "ast" }) {
project.dependencies.add("implementation", project.dependencies.project(mapOf("path" to ":ast")))
Expand All @@ -56,10 +62,10 @@ class LanguageServerPlugin : Plugin<Project?> {
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")

val projectPath = project.projectDir.toString()
val language = project.rootProject.name
val resources = listOf(projectPath, "src", "main", "resources")

project.extensions.add("languageServer", LanguageServerExtension::class.java)
extension = project.extensions.getByType(LanguageServerExtension::class.java)
Expand Down

0 comments on commit dca81e7

Please sign in to comment.