forked from fwcd/kotlin-language-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
104 lines (85 loc) · 2.37 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
plugins {
id "com.github.jk1.tcdeps" version "0.17"
}
apply plugin: 'kotlin'
apply plugin: 'application'
apply plugin: 'maven'
group = 'org.javacs'
version = '0.1.1'
mainClassName = "org.javacs.kt.MainKt"
description = "Code completions, diagnostics and more for Kotlin"
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
}
kotlin {
experimental {
coroutines 'enable'
}
}
repositories {
mavenCentral()
maven { url 'https://repo.gradle.org/gradle/libs-releases' }
teamcityServer {
url = 'http://teamcity.jetbrains.com'
credentials {
username = 'guest'
password = 'guest'
}
}
}
configurations {
kotlinJVMLib
}
dependencies {
def kotlinTeamCity = "$kotlinBuildType:$kotlinBuild:kotlin-plugin-${kotlinPluginBuild}.zip!/Kotlin"
implementation "com.google.guava:guava:21.0"
implementation "org.gradle:gradle-tooling-api:4.3"
implementation "org.eclipse.lsp4j:org.eclipse.lsp4j:0.4.1"
implementation "org.jetbrains.kotlin:kotlin-compiler:$kotlinVersion"
kotlinJVMLib tc("$kotlinTeamCity/lib/kotlin-plugin.jar")
implementation fileTree(dir: "lib", include: ["*.jar"])
implementation fileTree(dir: "lib-kotlin", include: ["*.jar"])
testImplementation "org.hamcrest:hamcrest-all:1.3"
testImplementation "junit:junit:4.10"
testImplementation "org.openjdk.jmh:jmh-core:1.20"
annotationProcessor "org.openjdk.jmh:jmh-generator-annprocess:1.20"
}
configurations.all { config ->
config.resolutionStrategy {
preferProjectModules()
}
}
test {
testLogging {
events "failed"
exceptionFormat "short"
}
}
task copyKotlinLib(type: Copy) {
from configurations.kotlinJVMLib
into "$projectDir/lib-kotlin"
}
task fixFilePermissions(type: Exec) {
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
commandLine 'echo "Performed build on Windows (thus not requiring additional file permissions)"'
} else {
// When running on macOS or Linux the start script
// needs executable permissions to run.
commandLine 'chmod', '+x', 'build/install/kotlin-language-server/bin/kotlin-language-server'
}
}
compileKotlin.dependsOn copyKotlinLib
installDist.finalizedBy fixFilePermissions
build.finalizedBy installDist