File tree Expand file tree Collapse file tree 3 files changed +26
-20
lines changed Expand file tree Collapse file tree 3 files changed +26
-20
lines changed Original file line number Diff line number Diff line change 1
1
import com.palantir.gradle.gitversion.VersionDetails
2
2
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3
3
import groovy.lang.Closure
4
+ import org.gradle.jvm.toolchain.internal.CurrentJvmToolchainSpec
4
5
5
6
plugins {
6
7
kotlin(" jvm" ) version " 1.5.30"
Original file line number Diff line number Diff line change 1
1
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2
- import java.nio.file.Files
3
- import java.nio.file.Paths
4
- import kotlin.collections.mapOf
5
2
6
3
plugins {
7
4
kotlin(" jvm" )
@@ -20,8 +17,24 @@ val semanticdbJar: Configuration by configurations.creating {
20
17
21
18
dependencies {
22
19
implementation(kotlin(" stdlib" ))
23
- semanticdbJar(project(mapOf (
24
- " path" to " :" + projects.semanticdbKotlinc.name,
25
- " configuration" to " semanticdbJar"
26
- )))
20
+ semanticdbJar(project(
21
+ path = " :${ projects.semanticdbKotlinc.name} " ,
22
+ configuration = " semanticdbJar"
23
+ ))
27
24
}
25
+
26
+ tasks.withType<KotlinCompile > {
27
+ kotlinOptions.jvmTarget = " 1.8"
28
+ dependsOn(" :${projects.semanticdbKotlinc.name} :shadowJar" )
29
+ val targetroot = File (project.buildDir, " semanticdb-targetroot" )
30
+ kotlinOptions {
31
+ jvmTarget = " 11"
32
+ freeCompilerArgs = freeCompilerArgs + listOf (
33
+ " -Xplugin=${semanticdbJar.first()} " ,
34
+ " -P" ,
35
+ " plugin:semanticdb-kotlinc:sourceroot=${projectDir.path} " ,
36
+ " -P" ,
37
+ " plugin:semanticdb-kotlinc:targetroot=${targetroot} "
38
+ )
39
+ }
40
+ }
Original file line number Diff line number Diff line change 1
1
import java.net.URI
2
2
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3
- import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
4
3
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
5
4
import org.gradle.api.publish.maven.MavenPublication
6
5
@@ -50,30 +49,23 @@ dependencies {
50
49
}
51
50
52
51
tasks.withType<KotlinCompile > {
53
- dependsOn(projects.semanticdbKotlin.dependencyProject.tasks. build.get().path )
52
+ dependsOn(" : ${ projects.semanticdbKotlin.name} : build" )
54
53
kotlinOptions {
55
54
freeCompilerArgs = freeCompilerArgs + listOf (" -Xinline-classes" )
56
55
}
57
56
}
58
57
59
58
val semanticdbJar: Configuration by configurations.creating {
60
- afterEvaluate {
61
- isCanBeConsumed = true
62
- isCanBeResolved = false
63
- outgoing.artifact(tasks.shadowJar.get().outputs.files.first())
64
- }
59
+ isCanBeConsumed = true
60
+ isCanBeResolved = false
65
61
}
66
62
67
63
artifacts {
68
- afterEvaluate {
69
- add(" semanticdbJar" , tasks.shadowJar.get().outputs.files.first()) {
70
- builtBy(tasks.shadowJar)
71
- }
72
- }
64
+ add(semanticdbJar.name, tasks.shadowJar)
73
65
}
74
66
75
67
tasks.jar {
76
- archiveClassifier.set(" - slim" )
68
+ archiveClassifier.set(" slim" )
77
69
manifest {
78
70
attributes[" Specification-Title" ] = project.name
79
71
attributes[" Specification-Version" ] = project.version
You can’t perform that action at this time.
0 commit comments