@@ -9,123 +9,72 @@ buildscript {
9
9
}
10
10
11
11
plugins {
12
- id " com.github.jk1.tcdeps" version " 0.17"
12
+ id ' com.github.jk1.tcdeps' version ' 0.17' apply false
13
13
}
14
14
15
- apply plugin : ' kotlin'
16
- apply plugin : ' application'
17
- apply plugin : ' maven'
15
+ def rootProjectDir = projectDir
18
16
19
- group = ' org.javacs'
20
- version = ' 0.1.1'
17
+ allprojects {
18
+ apply plugin : ' kotlin'
19
+ apply plugin : ' maven'
20
+ apply plugin : ' com.github.jk1.tcdeps'
21
21
22
- mainClassName = " org.javacs.kt.MainKt "
23
- description = " Code completions, diagnostics and more for Kotlin "
22
+ sourceCompatibility = 1.8
23
+ targetCompatibility = 1.8
24
24
25
- sourceCompatibility = 1.8
26
- targetCompatibility = 1.8
27
-
28
- def debugPort = 8000
29
- def debugArgs = " -agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n,quiet=y"
30
-
31
- tasks. withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile ). all {
32
- kotlinOptions {
33
- jvmTarget = " 1.8"
25
+ tasks. withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile ). all {
26
+ kotlinOptions {
27
+ jvmTarget = " 1.8"
28
+ }
34
29
}
35
- }
36
30
37
- repositories {
38
- mavenCentral()
39
- maven { url ' https://repo.gradle.org/gradle/libs-releases' }
40
- teamcityServer {
41
- url = teamCityUrl
42
- credentials {
43
- username = teamCityUsername
44
- password = teamCityPassword
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
+ }
45
40
}
46
41
}
47
- }
48
-
49
- configurations {
50
- kotlinJVMLib
51
- }
52
-
53
- dependencies {
54
- def kotlinTeamCity = " $kotlinBuildType :$kotlinBuild :kotlin-plugin-${ kotlinPluginBuild} .zip!/Kotlin"
55
-
56
- implementation " com.google.guava:guava:21.0"
57
- implementation " org.gradle:gradle-tooling-api:4.3"
58
- implementation " org.eclipse.lsp4j:org.eclipse.lsp4j:0.5.0"
59
-
60
- implementation " org.jetbrains.kotlin:kotlin-compiler:$kotlinVersion "
61
- implementation " org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion "
62
- kotlinJVMLib tc(" $kotlinTeamCity /lib/kotlin-plugin.jar" )
63
- kotlinJVMLib tc(" $kotlinTeamCity /lib/j2k.jar" )
64
42
65
- implementation fileTree(dir : " lib" , include : [" *.jar" ])
66
- implementation fileTree(dir : " lib-kotlin" , include : [" *.jar" ])
67
- testImplementation " org.hamcrest:hamcrest-all:1.3"
68
- testImplementation " junit:junit:4.10"
69
- testImplementation " org.openjdk.jmh:jmh-core:1.20"
70
- testImplementation " org.jetbrains.kotlin:kotlin-script-runtime:$kotlinVersion "
71
- annotationProcessor " org.openjdk.jmh:jmh-generator-annprocess:1.20"
72
- }
73
-
74
- configurations. all { config ->
75
- config. resolutionStrategy {
76
- preferProjectModules()
43
+ configurations {
44
+ kotlinJVMLib
77
45
}
78
- }
79
46
80
- test {
81
- testLogging {
82
- events " failed"
83
- exceptionFormat " short"
47
+ 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"
64
+ testImplementation " org.jetbrains.kotlin:kotlin-script-runtime:$kotlinVersion "
65
+ annotationProcessor " org.openjdk.jmh:jmh-generator-annprocess:1.20"
84
66
}
85
- }
86
-
87
- run {
88
- standardInput = System . in
89
- }
90
-
91
- task copyKotlinJVMLib (type : Copy ) {
92
- from configurations. kotlinJVMLib
93
- into " $projectDir /lib-kotlin"
94
- }
95
-
96
- task fixFilePermissions (type : Exec ) {
97
- // When running on macOS or Linux the start script
98
- // needs executable permissions to run.
99
- onlyIf { ! System . getProperty(" os.name" ). toLowerCase(). contains(" windows" ) }
100
- commandLine ' chmod' , ' +x' , ' build/install/kotlin-language-server/bin/kotlin-language-server'
101
- }
102
67
103
- task debugRun (type : JavaExec ) {
104
- main = mainClassName
105
- classpath sourceSets. main. runtimeClasspath
106
- standardInput = System . in
107
-
108
- println " Configured debugPort to $debugPort "
109
- jvmArgs debugArgs
110
- }
111
-
112
- task debugStartScripts (type : CreateStartScripts ) {
113
- applicationName = startScripts. applicationName
114
- mainClassName = startScripts. mainClassName
115
- outputDir = installDist. destinationDir. toPath(). resolve(' bin' ). toFile()
116
- classpath = startScripts. classpath
117
- defaultJvmOpts = [debugArgs]
118
- }
68
+ configurations. all { config ->
69
+ config. resolutionStrategy {
70
+ preferProjectModules()
71
+ }
72
+ }
119
73
120
- task installDebugDist (type : Sync ) {
121
- dependsOn installDist
122
- finalizedBy debugStartScripts
123
- }
74
+ task copyKotlinJVMLib (type : Copy ) {
75
+ from configurations . kotlinJVMLib
76
+ into " $r ootProjectDir /lib-kotlin "
77
+ }
124
78
125
- applicationDistribution. into(' bin' ) {
126
- fileMode = 0755
79
+ compileKotlin. dependsOn copyKotlinJVMLib
127
80
}
128
-
129
- compileKotlin. dependsOn copyKotlinJVMLib
130
- installDist. finalizedBy fixFilePermissions
131
- build. finalizedBy installDist
0 commit comments