Skip to content

Instantly share code, notes, and snippets.

@Jacoby6000
Last active August 29, 2015 14:28
Show Gist options
  • Save Jacoby6000/d2dc1c329acd19f532e9 to your computer and use it in GitHub Desktop.
Save Jacoby6000/d2dc1c329acd19f532e9 to your computer and use it in GitHub Desktop.
def collectSubAar(ps: Seq[ProjectRef]): Seq[AarLibrary] = ps flatMap { p =>
val locals = Project.runTask(libraryProjects in(p, Android), st).collect {
case (_, Value(value)) => value
}
val aarlibs = locals.fold(Seq.empty[AarLibrary])(_ collect {
case a: AarLibrary => a
})
val sub = Project.getProject(p, struct)
if(sub.isEmpty) aarlibs
else aarlibs ++ sub.fold(Seq.empty[AarLibrary])(s => collectSubAar(s.dependencies.map(_.project)))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment