You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
133 lines
4.2 KiB
133 lines
4.2 KiB
apply plugin: 'com.android.application'
|
|
|
|
android {
|
|
compileSdkVersion 23
|
|
buildToolsVersion "23.0.0"
|
|
|
|
lintOptions {
|
|
// set to true to turn off analysis progress reporting by lint
|
|
quiet true
|
|
// if true, stop the gradle build if errors are found
|
|
abortOnError false
|
|
// if true, only report errors
|
|
ignoreWarnings true
|
|
}
|
|
|
|
packagingOptions {
|
|
exclude 'LICENSE.txt'
|
|
exclude 'META-INF/LICENSE.txt'
|
|
// exclude 'app/src/main/jni/breadwallet-core' //for API 19 to work
|
|
}
|
|
|
|
|
|
defaultConfig {
|
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
|
applicationId "com.breadwallet"
|
|
minSdkVersion 21
|
|
targetSdkVersion 23
|
|
versionCode 1
|
|
versionName "1.0"
|
|
ndk {
|
|
moduleName "core"
|
|
cFlags "-std=c99"
|
|
ldLibs "log"
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_7
|
|
targetCompatibility JavaVersion.VERSION_1_7
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
// proguardFiles getDefaultProguardFiles('proguard-android.txt'), 'proguard-rules.pro'
|
|
}
|
|
debug {
|
|
debuggable true
|
|
jniDebuggable true
|
|
}
|
|
|
|
release {
|
|
debuggable false
|
|
jniDebuggable false
|
|
}
|
|
|
|
foss {
|
|
debuggable false
|
|
jniDebuggable false
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
jni.srcDirs = []
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
task buildNative(type: Exec, description: 'Compile JNI source via NDK') {
|
|
android.applicationVariants.all { variant ->
|
|
Properties properties = new Properties()
|
|
properties.load(project.rootProject.file('local.properties').newDataInputStream())
|
|
def ndkDir = properties.getProperty('ndk.dir')
|
|
println(projectDir)
|
|
commandLine "$ndkDir/ndk-build",
|
|
'NDK_PROJECT_PATH=null',
|
|
'V=1',
|
|
'ndk-build NDK_DEBUG=1',
|
|
'NDK_LOG=1',
|
|
"NDK_APPLICATION_MK=$projectDir/src/main/jni/Application.mk",
|
|
"NDK_OUT=$buildDir/intermediates/ndk/${variant.dirName}/obj",
|
|
"NDK_LIBS_OUT=$buildDir/intermediates/ndk/${variant.dirName}/lib"
|
|
copy {
|
|
from "$buildDir/intermediates/ndk/${variant.dirName}/lib"
|
|
into "src/main/jniLibs"
|
|
}
|
|
}
|
|
}
|
|
|
|
task cleanNative(type: Exec, description: 'Clean JNI object files') {
|
|
android.applicationVariants.all { variant ->
|
|
Properties properties = new Properties()
|
|
properties.load(project.rootProject.file('local.properties').newDataInputStream())
|
|
def ndkDir = properties.getProperty('ndk.dir')
|
|
commandLine "$ndkDir/ndk-build",
|
|
'NDK_PROJECT_PATH=null',
|
|
"NDK_APPLICATION_MK=$projectDir/src/main/jni/Application.mk",
|
|
"NDK_OUT=$buildDir/intermediates/ndk/${variant.dirName}/obj",
|
|
"NDK_LIBS_OUT=$buildDir/intermediates/ndk/${variant.dirName}/lib",
|
|
'clean'
|
|
}
|
|
}
|
|
|
|
clean.dependsOn 'cleanNative'
|
|
|
|
tasks.withType(JavaCompile) {
|
|
compileTask -> compileTask.dependsOn buildNative
|
|
}
|
|
|
|
|
|
dependencies {
|
|
compile fileTree(dir: 'libs', include: ['*.jar'])
|
|
compile files('libs/acra-4.6.1.jar')
|
|
// testCompile 'junit:junit:+'
|
|
compile 'com.android.support:appcompat-v7:23.0.1'
|
|
compile 'com.android.support:support-v13:23.0.1'
|
|
compile 'com.google.zxing:core:3.2.0' //QRCode scanner
|
|
compile 'com.facebook.rebound:rebound:0.3.8' //spring animation
|
|
compile 'org.json:json:20141113' //JSonParser google
|
|
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
|
|
compile 'org.apache.httpcomponents:httpclient:4.5.1'
|
|
|
|
androidTestCompile 'com.android.support.test:runner:+'
|
|
// Set this dependency to use JUnit 4 rules
|
|
androidTestCompile 'com.android.support.test:rules:0.3'
|
|
// Set this dependency to build and run Espresso tests
|
|
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.+'
|
|
// Set this dependency to build and run UI Automator tests
|
|
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.+'
|
|
compile 'com.android.support.test.espresso:espresso-core:2.2.1'
|
|
}
|
|
|