Skip to content

Commit 7ce5f76

Browse files
committed
Simplify retrieval of the android jar file
1 parent bdee733 commit 7ce5f76

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

src/main/resources/classpathFinder.gradle

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,9 @@ allprojects { project ->
66
System.out.println "kotlin-lsp-project ${project.name}"
77

88
if (project.hasProperty('android')) {
9-
def rootDir = project.rootDir
10-
11-
def level = "21"
12-
if (project.android.defaultConfig.targetSdkVersion != null) {
13-
level = project.android.defaultConfig.targetSdkVersion.getApiLevel()
14-
System.out.println "kotlin-lsp-target android-$level"
9+
project.android.getBootClasspath().each {
10+
System.out.println "kotlin-lsp-gradle $it"
1511
}
16-
17-
def localProperties = new File(rootDir, "local.properties")
18-
19-
if (localProperties.exists()) {
20-
Properties properties = new Properties()
21-
localProperties.withInputStream { instr -> properties.load(instr) }
22-
def sdkDir = properties.getProperty('sdk.dir')
23-
def androidJarPath = sdkDir + "/platforms/android-$level/android.jar"
24-
System.out.println "kotlin-lsp-gradle $androidJarPath"
25-
}
26-
2712
if (project.android.hasProperty('applicationVariants')) {
2813
project.android.applicationVariants.all { variant ->
2914
variant.getCompileClasspath().each {

0 commit comments

Comments
 (0)