1
1
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2
+ import java.io.ByteArrayOutputStream
2
3
3
4
description = " Kotlin Symbol Processing implementation using Kotlin Analysis API"
4
5
@@ -23,6 +24,7 @@ plugins {
23
24
}
24
25
25
26
val depSourceJars by configurations.creating
27
+ val depJarsForCheck by configurations.creating
26
28
27
29
dependencies {
28
30
listOf (
@@ -91,6 +93,10 @@ dependencies {
91
93
implementation(project(" :common-util" ))
92
94
93
95
testImplementation(kotlin(" stdlib" , aaKotlinBaseVersion))
96
+
97
+ depJarsForCheck(" org.jetbrains.kotlin" , " kotlin-stdlib" , aaKotlinBaseVersion)
98
+ depJarsForCheck(project(" :api" ))
99
+ depJarsForCheck(project(" :common-deps" ))
94
100
}
95
101
96
102
sourceSets.main {
@@ -123,6 +129,27 @@ tasks.withType<ShadowJar>() {
123
129
archiveClassifier.set(" " )
124
130
minimize()
125
131
mergeServiceFiles()
132
+
133
+ doLast {
134
+ // Checks for missing dependencies
135
+ val jarJar = archiveFile.get().asFile
136
+ val depJars = depJarsForCheck.resolve().map(File ::getPath)
137
+ val stdout = ByteArrayOutputStream ()
138
+ try {
139
+ exec {
140
+ executable = " jdeps"
141
+ args = listOf (
142
+ " --multi-release" , " base" ,
143
+ " --missing-deps" ,
144
+ " -cp" , depJars.joinToString(" :" ), jarJar.path
145
+ )
146
+ standardOutput = stdout
147
+ }
148
+ } catch (e: org.gradle.process.internal.ExecException ) {
149
+ logger.warn(e.message)
150
+ }
151
+ logger.warn(stdout.toString())
152
+ }
126
153
}
127
154
128
155
tasks {
0 commit comments