2014-05-12 16:54:26 +00:00
|
|
|
buildscript {
|
2014-08-18 09:30:03 +00:00
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
2014-08-25 23:51:07 +00:00
|
|
|
jcenter()
|
2014-09-16 08:43:24 +00:00
|
|
|
|
2014-08-18 09:30:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2015-08-26 20:41:10 +00:00
|
|
|
classpath 'com.android.tools.build:gradle:1.3.1'
|
2015-06-28 15:43:43 +00:00
|
|
|
classpath 'com.github.ben-manes:gradle-versions-plugin:0.11.3'
|
2014-08-18 09:30:03 +00:00
|
|
|
}
|
2014-05-12 16:54:26 +00:00
|
|
|
}
|
|
|
|
|
2014-07-27 20:00:07 +00:00
|
|
|
apply plugin: 'com.android.application'
|
2014-08-25 23:51:07 +00:00
|
|
|
apply plugin: 'com.github.ben-manes.versions'
|
2014-05-12 16:54:26 +00:00
|
|
|
|
2014-05-13 08:40:54 +00:00
|
|
|
repositories {
|
2014-08-18 09:30:03 +00:00
|
|
|
mavenCentral()
|
2015-11-10 22:24:02 +00:00
|
|
|
jcenter()
|
2014-05-13 08:40:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2015-11-09 01:16:47 +00:00
|
|
|
compile 'eu.chainfire:libsuperuser:1.0.0.201510071325'
|
|
|
|
compile 'com.android.support:appcompat-v7:23.1.0'
|
|
|
|
compile 'com.android.support:design:23.1.0'
|
|
|
|
compile 'com.android.support:appcompat-v7:23.1.0'
|
2015-06-15 14:18:45 +00:00
|
|
|
androidTestCompile 'com.squareup.okhttp:mockwebserver:2.4.0'
|
2014-05-13 08:40:54 +00:00
|
|
|
}
|
|
|
|
|
2014-08-20 21:58:28 +00:00
|
|
|
preBuild {
|
2014-08-18 09:30:03 +00:00
|
|
|
dependsOn 'buildNative'
|
2014-08-20 21:58:28 +00:00
|
|
|
}
|
|
|
|
|
2015-03-21 00:32:49 +00:00
|
|
|
project.archivesBaseName = 'syncthing'
|
|
|
|
|
2014-05-12 16:54:26 +00:00
|
|
|
android {
|
2015-09-16 22:58:43 +00:00
|
|
|
compileSdkVersion 23
|
|
|
|
buildToolsVersion "23.0.0"
|
|
|
|
|
|
|
|
useLibrary 'org.apache.http.legacy'
|
2014-08-18 09:30:03 +00:00
|
|
|
|
|
|
|
defaultConfig {
|
2015-06-28 15:43:43 +00:00
|
|
|
applicationId "com.nutomic.syncthingandroid"
|
2015-08-21 22:19:09 +00:00
|
|
|
minSdkVersion 11
|
2015-11-12 22:00:09 +00:00
|
|
|
targetSdkVersion 23
|
2015-11-12 22:14:53 +00:00
|
|
|
versionCode 77
|
|
|
|
versionName "0.7.2"
|
2014-08-22 12:38:11 +00:00
|
|
|
testApplicationId 'com.nutomic.syncthingandroid.test'
|
|
|
|
testInstrumentationRunner 'android.test.InstrumentationTestRunner'
|
|
|
|
testHandleProfiling true
|
|
|
|
testFunctionalTest true
|
2014-08-18 09:30:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
jniLibs.srcDir file("libs/")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-20 23:56:59 +00:00
|
|
|
signingConfigs {
|
|
|
|
release {
|
2015-03-21 00:32:49 +00:00
|
|
|
if (System.getenv("key_alias")) {
|
|
|
|
storeFile = file(System.getenv("key_store"))
|
|
|
|
storePassword = System.getenv("key_store_password")
|
|
|
|
keyAlias = System.getenv("key_alias")
|
|
|
|
keyPassword = System.getenv("key_alias_password")
|
|
|
|
}
|
|
|
|
}
|
2015-03-20 23:56:59 +00:00
|
|
|
}
|
|
|
|
|
2014-08-18 09:30:03 +00:00
|
|
|
buildTypes {
|
|
|
|
debug {
|
|
|
|
applicationIdSuffix ".debug"
|
|
|
|
debuggable true
|
2015-04-09 19:49:12 +00:00
|
|
|
testCoverageEnabled true
|
2014-08-18 09:30:03 +00:00
|
|
|
}
|
2015-03-20 23:56:59 +00:00
|
|
|
release {
|
2015-03-25 19:13:29 +00:00
|
|
|
minifyEnabled true
|
2015-05-13 14:58:48 +00:00
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-android.txt'
|
2015-03-21 00:32:49 +00:00
|
|
|
if (System.getenv("key_alias")) {
|
|
|
|
signingConfig signingConfigs.release
|
|
|
|
}
|
2015-03-20 23:56:59 +00:00
|
|
|
}
|
2014-08-18 09:30:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
productFlavors {
|
|
|
|
x86 {
|
|
|
|
versionCode Integer.parseInt("4" + defaultConfig.versionCode)
|
|
|
|
ndk {
|
|
|
|
abiFilter "x86"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
armeabi {
|
2015-01-14 10:51:07 +00:00
|
|
|
versionCode Integer.parseInt("3" + defaultConfig.versionCode)
|
2014-08-18 09:30:03 +00:00
|
|
|
ndk {
|
|
|
|
abiFilter "armeabi"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fat {
|
|
|
|
versionCode Integer.parseInt("0" + defaultConfig.versionCode)
|
|
|
|
}
|
|
|
|
}
|
2014-05-12 16:54:26 +00:00
|
|
|
}
|
2014-05-17 20:57:04 +00:00
|
|
|
|
2014-06-27 15:24:23 +00:00
|
|
|
task buildNative(type: Exec) {
|
2014-08-18 09:30:03 +00:00
|
|
|
outputs.upToDateWhen { false }
|
|
|
|
executable = './build-syncthing.sh'
|
2014-05-17 20:57:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
task copyNative(type: Copy) {
|
2014-08-18 09:30:03 +00:00
|
|
|
def lib_dir = "libs/"
|
|
|
|
new File(lib_dir).mkdirs()
|
|
|
|
def st_dir = "bin/";
|
2015-01-15 17:52:59 +00:00
|
|
|
from st_dir + 'syncthing-x86', st_dir + 'syncthing-armeabi';
|
2014-08-18 09:30:03 +00:00
|
|
|
into lib_dir
|
|
|
|
rename('syncthing-x86', 'x86/libsyncthing.so')
|
|
|
|
rename('syncthing-armeabi', 'armeabi/libsyncthing.so')
|
2014-05-17 20:57:04 +00:00
|
|
|
}
|
|
|
|
buildNative.finalizedBy copyNative
|
|
|
|
|
2014-08-20 21:58:28 +00:00
|
|
|
task cleanBin(type: Delete) {
|
2014-08-18 09:30:03 +00:00
|
|
|
delete 'bin/'
|
2014-08-20 21:58:28 +00:00
|
|
|
}
|
|
|
|
copyNative.finalizedBy cleanBin
|
|
|
|
|
2014-05-17 20:57:04 +00:00
|
|
|
task cleanNative(type: Delete) {
|
2014-08-18 09:30:03 +00:00
|
|
|
delete 'bin/'
|
|
|
|
delete 'build/'
|
|
|
|
delete 'libs/'
|
|
|
|
delete 'ext/syncthing/bin/'
|
|
|
|
delete 'ext/syncthing/pkg/'
|
2014-05-18 13:18:42 +00:00
|
|
|
}
|
2014-08-20 21:58:28 +00:00
|
|
|
clean.dependsOn cleanNative
|
|
|
|
|