From ee32c91a39261963af74bd30fa524eeb00fc416a Mon Sep 17 00:00:00 2001 From: ernest_chaing Date: Tue, 11 Jul 2017 15:44:26 +0800 Subject: [PATCH] misc/androidstudio: check on javaCompile to avoid exception --- .../src/main/groovy/org/golang/mobile/GobindPlugin.groovy | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/misc/androidstudio/src/main/groovy/org/golang/mobile/GobindPlugin.groovy b/misc/androidstudio/src/main/groovy/org/golang/mobile/GobindPlugin.groovy index bd6e3e038..6fb7d987a 100644 --- a/misc/androidstudio/src/main/groovy/org/golang/mobile/GobindPlugin.groovy +++ b/misc/androidstudio/src/main/groovy/org/golang/mobile/GobindPlugin.groovy @@ -216,9 +216,11 @@ class GomobileTask extends BindTask implements OutputFileTask { } def cmd = ["bind", "-i"] // Add the generated R and databinding classes to the classpath. - def classpath = project.files(javaCompile.classpath, javaCompile.destinationDir) - cmd << "-classpath" - cmd << classpath.join(File.pathSeparator) + if (javaCompile) { + def classpath = project.files(javaCompile.classpath, javaCompile.destinationDir) + cmd << "-classpath" + cmd << classpath.join(File.pathSeparator) + } cmd << "-o" cmd << outputFile.getAbsolutePath() cmd << "-target"