-
Notifications
You must be signed in to change notification settings - Fork 250
Expand file tree
/
Copy pathprojectClassPathFinder.gradle
More file actions
89 lines (72 loc) · 3.56 KB
/
Copy pathprojectClassPathFinder.gradle
File metadata and controls
89 lines (72 loc) · 3.56 KB
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
allprojects { project ->
task kotlinLSPProjectDeps { task ->
doLast {
System.out.println ""
System.out.println "gradle-version $gradleVersion"
System.out.println "kotlin-lsp-project ${project.name}"
if (project.hasProperty('android')) {
project.android.getBootClasspath().each {
System.out.println "kotlin-lsp-gradle $it"
}
def variants = []
if (project.android.hasProperty('applicationVariants')) {
variants += project.android.applicationVariants
}
if (project.android.hasProperty('libraryVariants')) {
variants += project.android.libraryVariants
}
variants.each { variant ->
def variantBase = variant.baseName.replaceAll("-", File.separator)
def buildClasses = project.getBuildDir().absolutePath +
File.separator + "intermediates" +
File.separator + variantBase +
File.separator + "classes"
System.out.println "kotlin-lsp-gradle $buildClasses"
def userClasses = project.getBuildDir().absolutePath +
File.separator + "intermediates" +
File.separator + "javac" +
File.separator + variantBase +
File.separator + "compile" + variantBase.capitalize() + "JavaWithJavac" + File.separator + "classes"
System.out.println "kotlin-lsp-gradle $userClasses"
def userVariantClasses = project.getBuildDir().absolutePath +
File.separator + "intermediates" +
File.separator + "javac" +
File.separator + variantBase +
File.separator + "classes"
System.out.println "kotlin-lsp-gradle $userVariantClasses"
variant.getCompileClasspath().each {
System.out.println "kotlin-lsp-gradle $it"
}
}
} else if (project.hasProperty('sourceSets')) {
// Print the list of all dependencies jar files.
def useCompileClasspath = project.hasProperty("useCompileClasspath")
sourceSets.forEach {
def classPathSource = useCompileClasspath ? it.compileClasspath : it.runtimeClasspath
classPathSource.forEach {
System.out.println "kotlin-lsp-gradle $it"
}
}
}
// handle kotlin multiplatform style dependencies if any
def kotlinExtension = project.extensions.findByName("kotlin")
if(kotlinExtension && kotlinExtension.hasProperty("targets")) {
def kotlinSourceSets = kotlinExtension.sourceSets
// Print the list of all dependencies jar files.
kotlinExtension.targets.names.each {
def classpath = configurations["${it}CompileClasspath"]
classpath.files.each {
System.out.println "kotlin-lsp-gradle $it"
}
}
}
}
}
task kotlinLSPAllGradleDeps {
doLast {
fileTree("$gradle.gradleHomeDir/lib")
.findAll { it.toString().endsWith '.jar' }
.forEach { System.out.println "kotlin-lsp-gradle $it" }
}
}
}