Skip to content

Commit 1ec8d90

Browse files
committed
Moved Kotlin plugin dependency into 'server' module
1 parent 426b401 commit 1ec8d90

File tree

8 files changed

+48
-48
lines changed

8 files changed

+48
-48
lines changed

build.gradle

Lines changed: 4 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,9 @@ buildscript {
88
}
99
}
1010

11-
plugins {
12-
id 'com.github.jk1.tcdeps' version '0.17' apply false
13-
}
14-
15-
def rootProjectDir = projectDir
16-
1711
allprojects {
1812
apply plugin: 'kotlin'
1913
apply plugin: 'maven'
20-
apply plugin: 'com.github.jk1.tcdeps'
2114

2215
sourceCompatibility = 1.8
2316
targetCompatibility = 1.8
@@ -28,53 +21,17 @@ allprojects {
2821
}
2922
}
3023

31-
repositories {
32-
mavenCentral()
33-
maven { url 'https://repo.gradle.org/gradle/libs-releases' }
34-
teamcityServer {
35-
url = teamCityUrl
36-
credentials {
37-
username = teamCityUsername
38-
password = teamCityPassword
39-
}
40-
}
41-
}
42-
43-
configurations {
44-
kotlinJVMLib
45-
}
46-
4724
dependencies {
48-
def kotlinTeamCity = "$kotlinBuildType:$kotlinBuild:kotlin-plugin-${kotlinPluginBuild}.zip!/Kotlin"
49-
50-
implementation "com.google.guava:guava:21.0"
51-
implementation "org.gradle:gradle-tooling-api:4.3"
52-
implementation "org.eclipse.lsp4j:org.eclipse.lsp4j:0.5.0"
53-
54-
implementation "org.jetbrains.kotlin:kotlin-compiler:$kotlinVersion"
55-
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
56-
kotlinJVMLib tc("$kotlinTeamCity/lib/kotlin-plugin.jar")
57-
kotlinJVMLib tc("$kotlinTeamCity/lib/j2k.jar")
58-
59-
implementation fileTree(dir: "$rootProjectDir/lib", include: ["*.jar"])
60-
implementation fileTree(dir: "$rootProjectDir/lib-kotlin", include: ["*.jar"])
61-
testImplementation "org.hamcrest:hamcrest-all:1.3"
62-
testImplementation "junit:junit:4.10"
63-
testImplementation "org.openjdk.jmh:jmh-core:1.20"
25+
testImplementation 'org.hamcrest:hamcrest-all:1.3'
26+
testImplementation 'junit:junit:4.10'
27+
testImplementation 'org.openjdk.jmh:jmh-core:1.20'
6428
testImplementation "org.jetbrains.kotlin:kotlin-script-runtime:$kotlinVersion"
65-
annotationProcessor "org.openjdk.jmh:jmh-generator-annprocess:1.20"
29+
annotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.20'
6630
}
6731

6832
configurations.all { config ->
6933
config.resolutionStrategy {
7034
preferProjectModules()
7135
}
7236
}
73-
74-
task copyKotlinJVMLib(type: Copy) {
75-
from configurations.kotlinJVMLib
76-
into "$rootProjectDir/lib-kotlin"
77-
}
78-
79-
compileKotlin.dependsOn copyKotlinJVMLib
8037
}

server/build.gradle

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id 'application'
3+
id 'com.github.jk1.tcdeps' version '0.17'
34
}
45

56
group = 'org.javacs'
@@ -11,14 +12,47 @@ description = 'Code completions, diagnostics and more for Kotlin'
1112
def debugPort = 8000
1213
def debugArgs = '-agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n,quiet=y'
1314

15+
repositories {
16+
maven { url 'https://repo.gradle.org/gradle/libs-releases' }
17+
mavenCentral()
18+
teamcityServer {
19+
url = teamCityUrl
20+
credentials {
21+
username = teamCityUsername
22+
password = teamCityPassword
23+
}
24+
}
25+
}
26+
27+
configurations {
28+
kotlinJVMLib
29+
}
30+
1431
dependencies {
32+
def kotlinTeamCity = "$kotlinBuildType:$kotlinBuild:kotlin-plugin-${kotlinPluginBuild}.zip!/Kotlin"
33+
1534
implementation project(':shared')
35+
implementation 'com.google.guava:guava:21.0'
36+
implementation 'org.eclipse.lsp4j:org.eclipse.lsp4j:0.5.0'
37+
implementation "org.jetbrains.kotlin:kotlin-compiler:$kotlinVersion"
38+
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
39+
40+
implementation fileTree(dir: "$projectDir/lib", include: ["*.jar"])
41+
implementation fileTree(dir: "$projectDir/lib-kotlin", include: ["*.jar"])
42+
43+
kotlinJVMLib tc("$kotlinTeamCity/lib/kotlin-plugin.jar")
44+
kotlinJVMLib tc("$kotlinTeamCity/lib/j2k.jar")
1645
}
1746

1847
applicationDistribution.into('bin') {
1948
fileMode = 0755
2049
}
2150

51+
task copyKotlinJVMLib(type: Copy) {
52+
from configurations.kotlinJVMLib
53+
into "$projectDir/lib-kotlin"
54+
}
55+
2256
task fixFilePermissions(type: Exec) {
2357
// When running on macOS or Linux the start script
2458
// needs executable permissions to run.
@@ -59,5 +93,6 @@ test {
5993
}
6094
}
6195

96+
compileKotlin.dependsOn copyKotlinJVMLib
6297
installDist.finalizedBy fixFilePermissions
6398
build.finalizedBy installDist
File renamed without changes.
File renamed without changes.

shared/build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
repositories {
2+
maven { url 'https://repo.gradle.org/gradle/libs-releases' }
3+
mavenCentral()
4+
}
5+
6+
dependencies {
7+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
8+
implementation 'org.gradle:gradle-tooling-api:4.3'
9+
}

shared/src/main/kotlin/org/javacs/kt/classpath/FindClassPath.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import org.javacs.kt.util.winCompatiblePathOf
66
import org.javacs.kt.util.tryResolving
77
import org.javacs.kt.util.firstNonNull
88
import org.javacs.kt.util.KotlinLSException
9-
import org.jetbrains.kotlin.utils.ifEmpty
109
import java.io.File
1110
import java.io.IOException
1211
import java.nio.file.Files

0 commit comments

Comments
 (0)