mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Don't explode the aar if it's already there.
This commit is contained in:
parent
f6cd3e2259
commit
4b122ac231
1 changed files with 11 additions and 11 deletions
|
@ -122,12 +122,16 @@ public class AndroidPlugin @Inject constructor(val javaCompiler: JavaCompiler,
|
|||
it.jarFile.get().name.endsWith(".aar")
|
||||
}.forEach {
|
||||
val mavenId = MavenId.create(it.id)
|
||||
val outputDir = AndroidFiles.intermediates(project)
|
||||
val destDir = Paths.get(outputDir, "exploded-aar", mavenId.groupId,
|
||||
mavenId.artifactId, mavenId.version)
|
||||
.toFile()
|
||||
log(2, "Exploding ${it.jarFile.get()} to $destDir")
|
||||
JarUtils.extractJarFile(it.jarFile.get(), destDir)
|
||||
val destDir = File(AndroidFiles.exploded(project, mavenId))
|
||||
if (!File(AndroidFiles.explodedManifest(project, mavenId)).exists()) {
|
||||
log(2, "Exploding ${it.jarFile.get()} to $destDir")
|
||||
JarUtils.extractJarFile(it.jarFile.get(), destDir)
|
||||
|
||||
// Copy all the resources from this aar into the same intermediate directory
|
||||
KFiles.copyRecursively(destDir.resolve("res"), resDir)
|
||||
} else {
|
||||
log(2, "$destDir already exists, not extracting again")
|
||||
}
|
||||
val classesJar = AndroidFiles.classesJar(project, mavenId)
|
||||
|
||||
// Add the classses.jar of this .aar to the classpath entries (which are returned via IClasspathContributor)
|
||||
|
@ -135,16 +139,12 @@ public class AndroidPlugin @Inject constructor(val javaCompiler: JavaCompiler,
|
|||
// Also add all the jar files found in the libs/ directory
|
||||
File(destDir, "libs").let { libsDir ->
|
||||
if (libsDir.exists()) {
|
||||
libsDir.listFiles().filter { it.name.endsWith(".jar")}.forEach {
|
||||
libsDir.listFiles().filter { it.name.endsWith(".jar") }.forEach {
|
||||
classpathEntries.put(project.name, FileDependency(it.absolutePath))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Copy all the resources from this aar into the same intermediate directory
|
||||
log(2, "Copying the resources to $resDir")
|
||||
result.add(destDir)
|
||||
KFiles.copyRecursively(destDir.resolve("res"), resDir)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue