2
0
mirror of synced 2025-02-24 15:28:28 +00:00

misc/androidstudio: check on javaCompile to avoid exception

In commit https://git.io/vQ1gV, the classpath was delayed evaluated to
the task executions. But at Library mode, there will be exception
because the javaCompile involved is not intialized. Add check to fix it.

Change-Id: I23ab2374a704de9fd7bf74ccfaed255045032b3d
Reviewed-on: https://go-review.googlesource.com/48050
Reviewed-by: Elias Naur <elias.naur@gmail.com>
This commit is contained in:
Ernest Chiang 2017-07-11 16:11:53 +08:00 committed by Elias Naur
parent e1125eeafd
commit 901bda64d6

View File

@ -216,9 +216,11 @@ class GomobileTask extends BindTask implements OutputFileTask {
} }
def cmd = ["bind", "-i"] def cmd = ["bind", "-i"]
// Add the generated R and databinding classes to the classpath. // Add the generated R and databinding classes to the classpath.
if (javaCompile) {
def classpath = project.files(javaCompile.classpath, javaCompile.destinationDir) def classpath = project.files(javaCompile.classpath, javaCompile.destinationDir)
cmd << "-classpath" cmd << "-classpath"
cmd << classpath.join(File.pathSeparator) cmd << classpath.join(File.pathSeparator)
}
cmd << "-o" cmd << "-o"
cmd << outputFile.getAbsolutePath() cmd << outputFile.getAbsolutePath()
cmd << "-target" cmd << "-target"