Skip to content
This repository was archived by the owner on Oct 26, 2022. It is now read-only.

Android JAR as local library dependency #189

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/main/scala/AndroidBase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,10 @@ object AndroidBase {
// Use typed resources by default
useTypedResources := true,

// Add the Android library as a provided dependency
unmanagedJars in Compile <+= (libraryJarPath) (p =>
Attributed.blank(p)) map (x => x),

// Gradle uses libs/ as the unmanaged JAR directory!
unmanagedBase <<= (baseDirectory) (_ / "libs"),

Expand Down Expand Up @@ -484,6 +488,7 @@ object AndroidBase {
// Provided internal dependencies (usually, class directories from a
// dependency project set as "provided")
providedInternalDependencies <<= (thisProjectRef, buildStructure) flatMap providedInternalDependenciesTask,
providedInternalDependencies <+= libraryJarPath map (x => x),

// The full input classpath
inputClasspath <<= (dependencyClasspath) map { dcp =>
Expand All @@ -507,8 +512,7 @@ object AndroidBase {
// Provided dependencies that are not to be included in the APK
val provided = (
providedInternalDependencies ++
update.select(Set("provided")) ++
Seq(libraryJarPath)
update.select(Set("provided"))
)

// Filter the full classpath
Expand Down Expand Up @@ -548,8 +552,7 @@ object AndroidBase {
dependencyClasspath <<= dependencyClasspath in Compile,
managedClasspath <<= managedClasspath in Compile,

// Add the dependencies to the classpath
unmanagedClasspath <+= (libraryJarPath) map (Attributed.blank(_)),
// Add the AAR library dependencies
unmanagedJars <++= (aarlibDependencies) map {
libs => libs.flatMap(_.sources).map(Attributed.blank(_)) },

Expand Down