Skip to content

Commit

Permalink
Add R.class files to the classpath
Browse files Browse the repository at this point in the history
  • Loading branch information
DonnieWest committed Jun 30, 2018
1 parent 9a1ab31 commit 4b65e27
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/main/resources/classpathFinder.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ task classpath {
}
}

def rjava = proj.getBuildDir().absolutePath + File.separator + "intermediates" + File.separator + "classes" + File.separator + "debug"
def rFiles = new File(rjava)
if (rFiles.exists()) {
classpathFiles += rFiles
}
def classes = fileTree(dir: proj.getBuildDir().absolutePath + File.separator + "intermediates", include: "**/R.class").files
for (Rclass in classes) {
classpathFiles += Rclass
}

if (proj.hasProperty("android")) {
classpathFiles += proj.android.getBootClasspath()
Expand Down Expand Up @@ -72,10 +71,13 @@ task classpath {

HashSet<String> computedPaths = new HashSet<String>()
for (dependency in classpathFiles) {
if (dependency.name.endsWith("jar")) {
if (dependency.name.endsWith("jar") || dependency.name.endsWith("class") ) {
println dependency
} else if (dependency != null) {
println getBuildCacheForDependency(dependency)
def cached = getBuildCacheForDependency(dependency)
if (cached != null) {
println cached
}
}
}
}
Expand Down

0 comments on commit 4b65e27

Please sign in to comment.