kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale-android
				
				
				
			
		
			
				
	
	
		
			161 wiersze
		
	
	
		
			4.8 KiB
		
	
	
	
		
			Kotlin
		
	
	
			
		
		
	
	
			161 wiersze
		
	
	
		
			4.8 KiB
		
	
	
	
		
			Kotlin
		
	
	
| import org.jetbrains.kotlin.konan.properties.hasProperty
 | |
| import java.io.FileInputStream
 | |
| import java.util.Properties
 | |
| 
 | |
| plugins {
 | |
|   id("com.android.application")
 | |
|   id("kotlin-android")
 | |
| 
 | |
|   id("org.jlleitschuh.gradle.ktlint") version "8.1.0"
 | |
|   id("com.gladed.androidgitversion") version "0.4.14"
 | |
|   id("com.github.triplet.play") version "2.4.2"
 | |
| }
 | |
| 
 | |
| val props = Properties().apply {
 | |
|   try {
 | |
|     load(FileInputStream(rootProject.file("local.properties")))
 | |
|   } catch (e: Exception) {
 | |
|   }
 | |
| }
 | |
| 
 | |
| androidGitVersion {
 | |
|   codeFormat = "MMNNPPBBB"
 | |
|   format = "%tag%%-count%%-commit%%-branch%"
 | |
| }
 | |
| 
 | |
| android {
 | |
|   compileOptions {
 | |
|     sourceCompatibility = JavaVersion.VERSION_1_8
 | |
|     targetCompatibility = JavaVersion.VERSION_1_8
 | |
|   }
 | |
| 
 | |
|   kotlinOptions {
 | |
|     jvmTarget = JavaVersion.VERSION_1_8.toString()
 | |
|   }
 | |
| 
 | |
|   buildFeatures {
 | |
|     viewBinding = true
 | |
|   }
 | |
| 
 | |
|   buildToolsVersion = "29.0.3"
 | |
|   compileSdkVersion(29)
 | |
| 
 | |
|   defaultConfig {
 | |
|     applicationId = "audio.funkwhale.ffa"
 | |
| 
 | |
|     minSdkVersion(23)
 | |
|     targetSdkVersion(29)
 | |
| 
 | |
|     ndkVersion = "21.3.6528147"
 | |
| 
 | |
|     versionCode = androidGitVersion.code()
 | |
|     versionName = androidGitVersion.name()
 | |
|   }
 | |
| 
 | |
|   signingConfigs {
 | |
| 
 | |
|     create("release") {
 | |
|       if (project.hasProperty("signing.store")) {
 | |
|         storeFile = file(project.findProperty("signing.store")!!)
 | |
|         storePassword = project.findProperty("signing.store_passphrase")!!.toString()
 | |
|         keyAlias = "ffa"
 | |
|         keyPassword = project.findProperty("signing.key_passphrase")!!.toString()
 | |
|       }
 | |
|     }
 | |
|     getByName("debug") {
 | |
|       if (project.hasProperty("signing.store")) {
 | |
|         storeFile = file(project.findProperty("signing.store")!!)
 | |
|         storePassword = project.findProperty("signing.store_passphrase")!!.toString()
 | |
|         keyAlias = "ffa"
 | |
|         keyPassword = project.findProperty("signing.key_passphrase")!!.toString()
 | |
|       }
 | |
|     }
 | |
|   }
 | |
| 
 | |
|   buildTypes {
 | |
|     getByName("debug") {
 | |
|       isDebuggable = true
 | |
|       applicationIdSuffix = ".dev"
 | |
| 
 | |
|       if (project.hasProperty("signing.store")) {
 | |
|         signingConfig = signingConfigs.getByName("debug")
 | |
|       }
 | |
| 
 | |
|       resValue("string", "debug.hostname", props.getProperty("debug.hostname", ""))
 | |
|       resValue("string", "debug.username", props.getProperty("debug.username", ""))
 | |
|       resValue("string", "debug.password", props.getProperty("debug.password", ""))
 | |
|     }
 | |
| 
 | |
|     getByName("release") {
 | |
| 
 | |
|       if (project.hasProperty("signing.store")) {
 | |
|         signingConfig = signingConfigs.getByName("release")
 | |
|       }
 | |
| 
 | |
|       resValue("string", "debug.hostname", "")
 | |
|       resValue("string", "debug.username", "")
 | |
|       resValue("string", "debug.password", "")
 | |
| 
 | |
|       isMinifyEnabled = true
 | |
|       isShrinkResources = true
 | |
| 
 | |
|       proguardFiles(
 | |
|         getDefaultProguardFile("proguard-android-optimize.txt"),
 | |
|         "proguard-rules.pro"
 | |
|       )
 | |
|     }
 | |
|   }
 | |
| }
 | |
| 
 | |
| ktlint {
 | |
|   debug.set(false)
 | |
|   verbose.set(false)
 | |
| }
 | |
| 
 | |
| play {
 | |
|   isEnabled = props.hasProperty("play.credentials")
 | |
| 
 | |
|   if (isEnabled) {
 | |
|     serviceAccountCredentials = file(props.getProperty("play.credentials"))
 | |
|     defaultToAppBundles = true
 | |
|     track = "beta"
 | |
|   }
 | |
| }
 | |
| 
 | |
| dependencies {
 | |
|   implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar"))))
 | |
| 
 | |
|   implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.21")
 | |
|   implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1")
 | |
|   implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.1")
 | |
| 
 | |
|   implementation("androidx.appcompat:appcompat:1.3.0")
 | |
|   implementation("androidx.core:core-ktx:1.6.0")
 | |
|   implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.4.0-alpha02")
 | |
|   implementation("androidx.coordinatorlayout:coordinatorlayout:1.1.0")
 | |
|   implementation("androidx.preference:preference-ktx:1.1.1")
 | |
|   implementation("androidx.recyclerview:recyclerview:1.2.1")
 | |
|   implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
 | |
|   implementation("com.google.android.material:material:1.4.0")
 | |
|   implementation("com.android.support.constraint:constraint-layout:2.0.4")
 | |
| 
 | |
|   implementation("com.google.android.exoplayer:exoplayer-core:2.11.8")
 | |
|   implementation("com.google.android.exoplayer:exoplayer-ui:2.11.8")
 | |
|   implementation("com.google.android.exoplayer:extension-mediasession:2.11.8")
 | |
|   implementation("com.github.PaulWoitaschek.ExoPlayer-Extensions:extension-opus:2.11.4") {
 | |
|     isTransitive = false
 | |
|   }
 | |
|   implementation("com.github.PaulWoitaschek.ExoPlayer-Extensions:extension-flac:2.11.4") {
 | |
|     isTransitive = false
 | |
|   }
 | |
| 
 | |
|   implementation("com.aliassadi:power-preference-lib:2.0.0")
 | |
|   implementation("com.github.kittinunf.fuel:fuel:2.3.1")
 | |
|   implementation("com.github.kittinunf.fuel:fuel-coroutines:2.3.1")
 | |
|   implementation("com.github.kittinunf.fuel:fuel-android:2.3.1")
 | |
|   implementation("com.github.kittinunf.fuel:fuel-gson:2.3.1")
 | |
|   implementation("com.google.code.gson:gson:2.8.7")
 | |
|   implementation("com.squareup.picasso:picasso:2.71828")
 | |
|   implementation("jp.wasabeef:picasso-transformations:2.4.0")
 | |
| }
 |