Last active
August 29, 2015 14:13
-
-
Save WanghongLin/b6d4f73800415ae076a4 to your computer and use it in GitHub Desktop.
add android framework library in android studio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
flatDir { dirs '../FrameworkJars' } | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:1.0.0' | |
} | |
} | |
apply plugin: 'android' | |
// self-defined providedCompile | |
configurations { | |
providedCompile | |
} | |
dependencies { | |
compile fileTree(dir: 'libs', include: '*.jar') | |
providedCompile files('../FrameworkJars/classes.jar') | |
} | |
// for android project | |
android.applicationVariants.all { | |
variant -> variant.javaCompile.classpath += configurations.providedCompile | |
} | |
// for standard java project | |
// sourceSets.main.compileClasspath += configurations.providedCompile | |
// sourceSets.test.compileClasspath += configurations.providedCompile | |
// sourceSets.test.runtimeClasspath += configurations.providedCompile | |
// another solution for android project | |
android.libraryVariants.all { variant -> | |
variant.outputs.each { output -> | |
output.packageLibrary.exclude('libs/someLib.jar') | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment