Created
December 6, 2012 18:39
-
-
Save khernyo/4226923 to your computer and use it in GitHub Desktop.
Gradle Android configuration with .so hack
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
// This hack works with com.android.tools.build:gradle:0.2, won't work in later version without modification | |
apply plugin: 'android' | |
targetCompatibility = 1.6 | |
sourceCompatibility = 1.6 | |
android { | |
target = 'android-14' | |
sourceSets { | |
main { | |
manifest.srcFile 'AndroidManifest.xml' | |
java.srcDir 'src' | |
res.srcDir 'res' | |
assets.srcDir 'assets' | |
resources.srcDir 'src' | |
} | |
test { | |
java.srcDir 'tests/src' | |
} | |
} | |
} | |
dependencies { | |
compile project(':main') | |
compile fileTree(dir: '../main/libs', include: '*.jar') | |
compile fileTree(dir: '../thirdparty/actionbar-sherlock/library/libs', include: '*.jar') | |
} | |
task copyNativeLibs(type: Copy) { | |
from(new File(project(':main').buildDir, 'native-libs')) { include '**/*.so' } | |
into new File(buildDir, 'native-libs') | |
} | |
tasks.withType(Compile) { compileTask -> compileTask.dependsOn copyNativeLibs } | |
clean.dependsOn 'cleanCopyNativeLibs' | |
tasks.withType(com.android.build.gradle.PackageApplicationTask) { pkgTask -> | |
pkgTask.jniDir new File(buildDir, 'native-libs') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@brimanning it works great ||Thanks a ton