From 04f08ae4a2647275df9b879205bb8619eaf72a59 Mon Sep 17 00:00:00 2001 From: galenlin Date: Fri, 29 Dec 2017 22:07:28 +0800 Subject: [PATCH] Avoid strip the bundle BR.class on Windows, fix #544 --- .../src/main/groovy/net/wequick/gradle/AppPlugin.groovy | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Android/DevSample/buildSrc/src/main/groovy/net/wequick/gradle/AppPlugin.groovy b/Android/DevSample/buildSrc/src/main/groovy/net/wequick/gradle/AppPlugin.groovy index b1e6eada..0f127d97 100644 --- a/Android/DevSample/buildSrc/src/main/groovy/net/wequick/gradle/AppPlugin.groovy +++ b/Android/DevSample/buildSrc/src/main/groovy/net/wequick/gradle/AppPlugin.groovy @@ -1537,11 +1537,10 @@ class AppPlugin extends BundlePlugin { } // Delete classes in library which contains 'BR.class' def bindingReferenceDirs = [] - int prefixLen = javac.destinationDir.path.length() + 1 + def retainedPackagePath = new File(javac.destinationDir, small.packagePath) javac.destinationDir.eachFileRecurse(FileType.FILES, { if (it.name == 'BR.class') { - String relativePath = it.path.substring(prefixLen) - if (!relativePath.startsWith(small.packagePath)) { + if (it.parentFile != retainedPackagePath) { bindingReferenceDirs.add(it.parentFile) } }