Last active
September 4, 2017 04:27
-
-
Save bongole/05021bdd1f21578e1f6f to your computer and use it in GitHub Desktop.
gradle build file for JavaCPP
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
apply plugin: 'com.android.library' | |
android { | |
compileSdkVersion 21 | |
buildToolsVersion "21.1.2" | |
defaultConfig { | |
minSdkVersion 9 | |
targetSdkVersion 21 | |
versionCode 1 | |
versionName "1.0" | |
} | |
buildTypes { | |
release { | |
minifyEnabled false | |
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | |
} | |
} | |
} | |
android.libraryVariants.all{ variant -> | |
def projectDir = project.projectDir.absolutePath | |
def classesDir = variant.javaCompile.destinationDir | |
def jniDir = file("$classesDir/../../bundles/$variant.name/jni/").absolutePath | |
variant.javaCompile.doLast { | |
javaexec { | |
main = 'org.bytedeco.javacpp.tools.Builder' | |
classpath = files(configurations.javacpp.asPath) | |
args = [ | |
'-cp', "$classesDir", | |
'-properties', 'android-x86', | |
'-Dplatform.root=/usr/local/opt/android-ndk', | |
'-Dplatform.compiler=/usr/local/opt/android-ndk/toolchains/x86-4.6/prebuilt/darwin-x86_64/bin/i686-linux-android-g++', | |
"-Dplatform.includepath=sources/cxx-stl/gnu-libstdc++/4.6/include/:sources/cxx-stl/gnu-libstdc++/4.6/libs/x86/include/:$projectDir/jni/include", | |
"-d", "$jniDir/x86/" | |
] | |
} | |
} | |
} | |
configurations { | |
javacpp | |
} | |
dependencies { | |
javacpp 'org.bytedeco:javacpp:0.10' | |
compile configurations.javacpp.dependencies | |
//compile fileTree(dir: 'libs', include: ['*.jar']) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
is there a project which is using this gradle file?