-
Notifications
You must be signed in to change notification settings - Fork 25
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
Use Kotlin DSL for gradle scripts #81
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
97a7405
Use Kotlin DSL for gradle scripts
themkat 9f7e432
Made the shared module import work with latest kotlin-language-server…
themkat 8805ff9
Add java version specifier to build pipeline
themkat 6654fd4
Experiment with disabling daemon for test invoking gradle
themkat b543a39
Remove copy-paste from kotlin language server
themkat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
plugins { | ||
kotlin("jvm") | ||
id("maven-publish") | ||
id("application") | ||
id("com.jaredsburrows.license") | ||
} | ||
|
||
val debugPort = 8000 | ||
val debugArgs = "-agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n,quiet=y" | ||
|
||
val adapterMainClassName = "org.javacs.ktda.KDAMainKt" | ||
|
||
application { | ||
mainClass.set(adapterMainClassName) | ||
description = "Debug Adapter for Kotlin" | ||
applicationDistribution.into("bin") { | ||
fileMode = 755 | ||
} | ||
} | ||
|
||
dependencies { | ||
// The JSON-RPC and Debug Adapter Protocol implementations | ||
implementation("org.eclipse.lsp4j:org.eclipse.lsp4j.debug:0.15.0") | ||
implementation("org.jetbrains.kotlin:kotlin-stdlib") | ||
implementation("org.jetbrains.kotlin:kotlin-reflect") | ||
implementation("kotlin-language-server:shared") | ||
|
||
// modules temporarily needed because of shared module import above | ||
implementation("org.jetbrains.exposed:exposed-core:0.37.3") | ||
implementation("org.jetbrains.exposed:exposed-dao:0.37.3") | ||
|
||
|
||
testImplementation("junit:junit:4.12") | ||
testImplementation("org.hamcrest:hamcrest-all:1.3") | ||
} | ||
|
||
tasks.startScripts { | ||
applicationName = "kotlin-debug-adapter" | ||
} | ||
|
||
tasks.register<Exec>("fixFilePermissions") { | ||
// When running on macOS or Linux the start script | ||
// needs executable permissions to run. | ||
|
||
onlyIf { !System.getProperty("os.name").lowercase().contains("windows") } | ||
commandLine("chmod", "+x", "${tasks.installDist.get().destinationDir}/bin/kotlin-debug-adapter") | ||
} | ||
|
||
tasks.register<JavaExec>("debugRun") { | ||
mainClass.set(adapterMainClassName) | ||
classpath(sourceSets.main.get().runtimeClasspath) | ||
standardInput = System.`in` | ||
|
||
jvmArgs(debugArgs) | ||
doLast { | ||
println("Using debug port $debugPort") | ||
} | ||
} | ||
|
||
tasks.register<CreateStartScripts>("debugStartScripts") { | ||
applicationName = "kotlin-debug-adapter" | ||
mainClass.set(adapterMainClassName) | ||
outputDir = tasks.installDist.get().destinationDir.toPath().resolve("bin").toFile() | ||
classpath = tasks.startScripts.get().classpath | ||
defaultJvmOpts = listOf(debugArgs) | ||
} | ||
|
||
tasks.register<Sync>("installDebugDist") { | ||
dependsOn("installDist") | ||
finalizedBy("debugStartScripts") | ||
} | ||
|
||
tasks.withType<Test>() { | ||
testLogging { | ||
events("failed") | ||
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.SHORT | ||
} | ||
} | ||
|
||
tasks.installDist { | ||
finalizedBy("fixFilePermissions") | ||
} | ||
|
||
tasks.build { | ||
finalizedBy("installDist") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' version "$kotlinVersion" | ||
kotlin("jvm") | ||
`maven-publish` | ||
} | ||
|
||
allprojects { | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
rootProject.name = "kotlin-debug-adapter" | ||
|
||
include("adapter") | ||
|
||
pluginManagement { | ||
repositories { | ||
gradlePluginPortal() | ||
} | ||
|
||
plugins { | ||
val kotlinVersion: String by settings | ||
kotlin("jvm") version "$kotlinVersion" apply false | ||
id("com.jaredsburrows.license") version "0.8.42" apply false | ||
} | ||
} | ||
|
||
sourceControl { | ||
gitRepository(java.net.URI.create("https://github.com/fwcd/kotlin-language-server.git")) { | ||
producesModule("kotlin-language-server:shared") | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The classpath database machinery would probably be interesting for the debug adapter too, perhaps we can integrate that permanently here too?