Kore/app/build.gradle
Francesco Bonazzi b14524963f Stream local files with NanoHTTPD server (#681)
Added local file browser. NanoHTTPD is used to create a local HTTP server to allow to stream files stored on in Android device to Kodi. Added support for multiple local files streaming.
2019-12-03 18:17:19 +00:00

156 lines
5.5 KiB
Groovy

apply plugin: 'com.android.application'
def getVersionName = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags', '--always'
standardOutput = stdout
}
return stdout.toString().trim()
}
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "org.xbmc.kore"
minSdkVersion 15
targetSdkVersion 28
versionCode 25
versionName = getVersionName()
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
def supportedLocales = ["en", "ast", "ru", "it", "ca", "cs", "zh-CN", "ja", "pt", "pt-BR",
"pl", "sl", "sk", "lt", "eu", "iw", "fr", "es", "hr", "hu", "nl",
"bg", "de", "ko", "uk"]
buildConfigField "String[]", "SUPPORTED_LOCALES", "new String[]{\""+
supportedLocales.join("\",\"")+"\"}"
}
File keystoreFile = file('keystore.properties')
signingConfigs {
release {
if (keystoreFile.exists()) {
def Properties keyProps = new Properties()
keyProps.load(new FileInputStream(keystoreFile))
storeFile file(keyProps["store"])
keyAlias keyProps["alias"]
storePassword keyProps["storePass"]
keyPassword keyProps["pass"]
}
}
}
testOptions {
execution 'ANDROID_TEST_ORCHESTRATOR'
unitTests {
includeAndroidResources = true
}
}
buildTypes {
release {
if (keystoreFile.exists()) {
signingConfig signingConfigs.release
}
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
// Too much trouble keeping all translations in sync
disable 'MissingTranslation'
//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
// warning 'IconLauncherFormat'
}
// allprojects {
// gradle.projectsEvaluated {
// tasks.withType(JavaCompile) {
// options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
// }
// }
// }
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
ext {
supportLibVersion = '28.0.0'
}
dependencies {
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}"
implementation "com.android.support:recyclerview-v7:${supportLibVersion}"
implementation "com.android.support.constraint:constraint-layout:1.1.3"
implementation 'com.fasterxml.jackson.core:jackson-databind:2.5.2'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
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'
implementation 'com.simplecityapps:recyclerview-fastscroll:1.0.20'
implementation 'org.nanohttpd:nanohttpd:2.3.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestUtil 'com.android.support.test:orchestrator:1.0.2'
androidTestImplementation 'org.hamcrest:hamcrest-library:1.3'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-contrib:3.0.2'
androidTestImplementation "com.android.support:support-v13:${supportLibVersion}"
androidTestImplementation 'junit:junit:4.12'
testImplementation 'org.robolectric:robolectric:4.3'
testImplementation "androidx.test:core:1.2.0"
testImplementation "androidx.test.ext:junit:1.1.1"
debugImplementation 'junit:junit:4.12'
implementation fileTree(dir: 'libs', include: ['*.jar'])
}
def adb = android.getAdbExecutable().toString()
afterEvaluate {
task grantAnimationPermissionDev(type: Exec, dependsOn: installDebug) {
doFirst {
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(' ')
}
}
tasks.each { task ->
if (task.name.startsWith('connectedDebugAndroidTest')) {
task.dependsOn grantAnimationPermissionDev
}
}
}
/**
* Makes sure assets are copied before running the unit tests
*/
tasks.whenTaskAdded { task ->
if (task.name.contains("testDebugUnitTest")) {
task.dependsOn assembleDebug
}
}