2015-01-14 12:12:47 +01:00
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
|
2015-12-12 20:18:13 +01:00
|
|
|
def getVersionName = { ->
|
|
|
|
def stdout = new ByteArrayOutputStream()
|
|
|
|
exec {
|
2017-06-26 11:45:15 +02:00
|
|
|
commandLine 'git', 'describe', '--tags', '--always'
|
2015-12-12 20:18:13 +01:00
|
|
|
standardOutput = stdout
|
|
|
|
}
|
|
|
|
return stdout.toString().trim()
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-01-14 12:12:47 +01:00
|
|
|
android {
|
2017-11-11 16:26:18 +01:00
|
|
|
compileSdkVersion 26
|
2018-05-03 12:04:04 +02:00
|
|
|
buildToolsVersion "27.0.3"
|
2015-01-14 12:12:47 +01:00
|
|
|
|
|
|
|
defaultConfig {
|
2015-03-09 22:35:18 +01:00
|
|
|
applicationId "org.xbmc.kore"
|
2015-01-14 12:12:47 +01:00
|
|
|
minSdkVersion 15
|
2017-11-11 16:26:18 +01:00
|
|
|
targetSdkVersion 26
|
2019-02-11 12:20:06 +01:00
|
|
|
versionCode 25
|
2015-12-12 20:18:13 +01:00
|
|
|
versionName = getVersionName()
|
2018-05-03 12:04:04 +02:00
|
|
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
2015-01-14 12:12:47 +01:00
|
|
|
}
|
|
|
|
|
2015-03-04 20:01:58 +01:00
|
|
|
File keystoreFile = file('keystore.properties')
|
|
|
|
|
2015-01-14 12:12:47 +01:00
|
|
|
signingConfigs {
|
|
|
|
release {
|
2015-03-04 20:01:58 +01:00
|
|
|
if (keystoreFile.exists()) {
|
|
|
|
def Properties keyProps = new Properties()
|
|
|
|
keyProps.load(new FileInputStream(keystoreFile))
|
2015-01-14 12:12:47 +01:00
|
|
|
|
2015-03-04 20:01:58 +01:00
|
|
|
storeFile file(keyProps["store"])
|
|
|
|
keyAlias keyProps["alias"]
|
|
|
|
storePassword keyProps["storePass"]
|
|
|
|
keyPassword keyProps["pass"]
|
|
|
|
}
|
2015-01-14 12:12:47 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-03 12:04:04 +02:00
|
|
|
// sourceSets {
|
|
|
|
// test {
|
|
|
|
// java.srcDirs += 'src/testUtils/java'
|
|
|
|
// assets.srcDirs += 'src/testUtils/assets'
|
|
|
|
// }
|
|
|
|
// androidTest {
|
|
|
|
// java.srcDirs += 'src/testUtils/java'
|
|
|
|
// assets.srcDirs += 'src/testUtils/assets'
|
|
|
|
// }
|
|
|
|
// }
|
2016-06-17 20:09:23 +02:00
|
|
|
|
2018-05-03 12:04:04 +02:00
|
|
|
testOptions {
|
|
|
|
execution 'ANDROID_TEST_ORCHESTRATOR'
|
2016-03-15 14:42:53 +01:00
|
|
|
}
|
|
|
|
|
2015-01-14 12:12:47 +01:00
|
|
|
buildTypes {
|
|
|
|
release {
|
2015-03-04 20:01:58 +01:00
|
|
|
if (keystoreFile.exists()) {
|
|
|
|
signingConfig signingConfigs.release
|
|
|
|
}
|
2015-01-14 12:12:47 +01:00
|
|
|
minifyEnabled true
|
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-01 16:00:12 +01:00
|
|
|
lintOptions {
|
|
|
|
// Too much trouble keeping all translations in sync
|
|
|
|
disable 'MissingTranslation'
|
2015-04-18 12:42:11 +02:00
|
|
|
|
2017-12-22 19:20:41 +01:00
|
|
|
//The xml launcher icon introduced in API 26 causes lint to generate
|
|
|
|
//an error that the icon is not a PNG format
|
|
|
|
//This reduces the error to a warning
|
2018-05-03 12:04:04 +02:00
|
|
|
// warning 'IconLauncherFormat'
|
2015-02-01 16:00:12 +01:00
|
|
|
}
|
|
|
|
|
2015-03-09 23:05:58 +01:00
|
|
|
// allprojects {
|
|
|
|
// gradle.projectsEvaluated {
|
|
|
|
// tasks.withType(JavaCompile) {
|
|
|
|
// options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
2015-01-14 12:12:47 +01:00
|
|
|
packagingOptions {
|
|
|
|
exclude 'META-INF/DEPENDENCIES'
|
|
|
|
exclude 'META-INF/NOTICE'
|
|
|
|
exclude 'META-INF/LICENSE'
|
|
|
|
exclude 'META-INF/LICENSE.txt'
|
|
|
|
exclude 'META-INF/NOTICE.txt'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-06 12:45:40 +01:00
|
|
|
ext {
|
2017-11-11 16:26:18 +01:00
|
|
|
supportLibVersion = '26.1.0'
|
2017-01-06 12:45:40 +01:00
|
|
|
}
|
|
|
|
|
2015-01-14 12:12:47 +01:00
|
|
|
dependencies {
|
2018-05-03 12:04:04 +02:00
|
|
|
implementation "com.android.support:support-v4:${supportLibVersion}"
|
|
|
|
implementation "com.android.support:appcompat-v7:${supportLibVersion}"
|
|
|
|
implementation "com.android.support:cardview-v7:${supportLibVersion}"
|
|
|
|
implementation "com.android.support:preference-v14:${supportLibVersion}"
|
|
|
|
implementation "com.android.support:support-v13:${supportLibVersion}"
|
|
|
|
implementation "com.android.support:design:${supportLibVersion}"
|
2018-07-24 22:04:33 +02:00
|
|
|
implementation "com.android.support:recyclerview-v7:${supportLibVersion}"
|
2019-02-26 21:08:46 +01:00
|
|
|
implementation "com.android.support.constraint:constraint-layout:1.1.3"
|
2018-05-03 12:04:04 +02:00
|
|
|
|
|
|
|
implementation 'com.fasterxml.jackson.core:jackson-databind:2.5.2'
|
|
|
|
implementation 'com.jakewharton:butterknife:8.8.1'
|
2018-04-05 19:22:20 +02:00
|
|
|
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
|
2018-05-03 12:04:04 +02:00
|
|
|
implementation 'com.squareup.okhttp:okhttp:2.3.0'
|
|
|
|
implementation 'com.squareup.picasso:picasso:2.5.2'
|
|
|
|
implementation 'de.greenrobot:eventbus:2.4.0'
|
|
|
|
implementation 'org.jmdns:jmdns:3.5.1'
|
|
|
|
implementation 'at.blogc:expandabletextview:1.0.3'
|
|
|
|
implementation 'com.sothree.slidinguppanel:library:3.3.1'
|
2019-01-10 19:40:58 +01:00
|
|
|
implementation 'com.simplecityapps:recyclerview-fastscroll:1.0.20'
|
2018-05-03 12:04:04 +02:00
|
|
|
|
|
|
|
androidTestImplementation 'com.android.support.test:runner:1.0.1'
|
|
|
|
androidTestImplementation 'com.android.support.test:rules:1.0.1'
|
|
|
|
androidTestUtil 'com.android.support.test:orchestrator:1.0.1'
|
|
|
|
androidTestImplementation 'org.hamcrest:hamcrest-library:1.3'
|
|
|
|
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
|
2018-07-24 22:04:33 +02:00
|
|
|
androidTestImplementation 'com.android.support.test.espresso:espresso-contrib:3.0.1'
|
2018-05-03 12:04:04 +02:00
|
|
|
androidTestImplementation "com.android.support:support-v13:${supportLibVersion}"
|
|
|
|
androidTestImplementation 'junit:junit:4.12'
|
|
|
|
|
|
|
|
testImplementation 'org.robolectric:robolectric:3.1.1'
|
|
|
|
debugImplementation 'junit:junit:4.12'
|
|
|
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
2015-01-14 12:12:47 +01:00
|
|
|
}
|
2016-03-15 14:42:53 +01:00
|
|
|
|
2018-05-03 12:04:04 +02:00
|
|
|
def adb = android.getAdbExecutable().toString()
|
2016-03-15 14:42:53 +01:00
|
|
|
afterEvaluate {
|
2018-05-03 12:04:04 +02:00
|
|
|
task grantAnimationPermissionDev(type: Exec, dependsOn: installDebug) {
|
2016-06-20 14:26:03 +02:00
|
|
|
doFirst {
|
2018-05-03 12:04:04 +02:00
|
|
|
println("Executing: $adb shell pm grant $android.defaultConfig.applicationId android.permission.SET_ANIMATION_SCALE")
|
|
|
|
commandLine "$adb shell pm grant $android.defaultConfig.applicationId android.permission.SET_ANIMATION_SCALE".split(' ')
|
2016-06-20 14:26:03 +02:00
|
|
|
}
|
2016-03-15 14:42:53 +01:00
|
|
|
}
|
|
|
|
tasks.each { task ->
|
2018-05-03 12:04:04 +02:00
|
|
|
if (task.name.startsWith('connectedDebugAndroidTest')) {
|
2016-03-15 14:42:53 +01:00
|
|
|
task.dependsOn grantAnimationPermissionDev
|
|
|
|
}
|
|
|
|
}
|
2017-08-08 19:44:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-05-03 12:04:04 +02:00
|
|
|
* Makes sure assets are copied before running the unit tests
|
2017-08-08 19:44:24 +02:00
|
|
|
*/
|
|
|
|
tasks.whenTaskAdded { task ->
|
2018-05-03 12:04:04 +02:00
|
|
|
if (task.name.contains("testDebugUnitTest")) {
|
|
|
|
task.dependsOn assembleDebug
|
2017-08-08 19:44:24 +02:00
|
|
|
}
|
2016-03-15 14:42:53 +01:00
|
|
|
}
|