Skip to content

Commit 37ed286

Browse files
committed
get project dependency jars
1 parent c68d5a4 commit 37ed286

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test-app/app/build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,20 @@ afterEvaluate { project ->
531531
}.artifacts.each {
532532
processJar(it.file, jars)
533533
}
534+
535+
def projectDependencies = config.getAllDependencies().withType(ProjectDependency)
536+
def dependentProjects = projectDependencies*.dependencyProject
537+
dependentProjects.findAll {
538+
// if there's a project dependency search for its result jar file in the build/intermediates/runtime_library_classes folder
539+
def jarDir = new File("${it.getBuildDir()}/intermediates/runtime_library_classes/${buildType.toLowerCase()}")
540+
if(jarDir.exists()) {
541+
jarDir.eachFileRecurse(FileType.FILES) { file ->
542+
if (file.path.endsWith(".jar")) {
543+
processJar(file, jars)
544+
}
545+
}
546+
}
547+
}
534548
}
535549
}
536550
}

0 commit comments

Comments
 (0)