| 
									
										
										
										
											2019-10-22 18:19:05 +00:00
										 |  |  | import org.jetbrains.kotlin.konan.properties.hasProperty | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  | import java.io.FileInputStream | 
					
						
							| 
									
										
										
										
											2021-07-01 11:25:09 +00:00
										 |  |  | import java.util.Properties | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | plugins { | 
					
						
							|  |  |  |   id("com.android.application") | 
					
						
							|  |  |  |   id("kotlin-android") | 
					
						
							| 
									
										
										
										
											2023-01-10 12:56:20 +00:00
										 |  |  |   id("androidx.navigation.safeargs.kotlin") | 
					
						
							|  |  |  |   id("kotlin-parcelize") | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-20 14:01:30 +00:00
										 |  |  |   id("org.jlleitschuh.gradle.ktlint") version "11.2.0" | 
					
						
							| 
									
										
										
										
											2021-06-26 11:36:32 +00:00
										 |  |  |   id("com.gladed.androidgitversion") version "0.4.14" | 
					
						
							| 
									
										
										
										
											2021-12-12 16:34:50 +00:00
										 |  |  |   id("com.github.triplet.play") version "3.7.0" | 
					
						
							| 
									
										
										
										
											2021-08-02 11:24:12 +00:00
										 |  |  |   id("de.mobilej.unmock") | 
					
						
							| 
									
										
										
										
											2021-08-06 07:34:09 +00:00
										 |  |  |   id("com.github.ben-manes.versions") | 
					
						
							| 
									
										
										
										
											2023-01-10 12:56:20 +00:00
										 |  |  |   id("org.jetbrains.kotlin.android") | 
					
						
							| 
									
										
										
										
											2021-07-30 08:57:49 +00:00
										 |  |  |   jacoco | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | val props = Properties().apply { | 
					
						
							| 
									
										
										
										
											2020-06-25 20:29:33 +00:00
										 |  |  |   try { | 
					
						
							|  |  |  |     load(FileInputStream(rootProject.file("local.properties"))) | 
					
						
							|  |  |  |   } catch (e: Exception) { | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-02 11:24:12 +00:00
										 |  |  | unMock { | 
					
						
							|  |  |  |   keep = listOf("android.net.Uri") | 
					
						
							| 
									
										
										
										
											2021-07-30 08:57:49 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-06 08:01:17 +00:00
										 |  |  | androidGitVersion { | 
					
						
							| 
									
										
										
										
											2021-09-17 06:50:19 +00:00
										 |  |  |   codeFormat = "MMNNPPBBB" // Keep in sync with version_code() in dist/create_release.sh | 
					
						
							| 
									
										
										
										
											2019-11-06 08:01:17 +00:00
										 |  |  |   format = "%tag%%-count%%-commit%%-branch%" | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  | android { | 
					
						
							|  |  |  |   compileOptions { | 
					
						
							|  |  |  |     sourceCompatibility = JavaVersion.VERSION_1_8 | 
					
						
							|  |  |  |     targetCompatibility = JavaVersion.VERSION_1_8 | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-06 08:31:09 +00:00
										 |  |  |   namespace = "audio.funkwhale.ffa" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-06 19:16:46 +00:00
										 |  |  |   testCoverage { | 
					
						
							| 
									
										
										
										
											2022-08-25 12:58:19 +00:00
										 |  |  |     version = "0.8.7" | 
					
						
							| 
									
										
										
										
											2021-08-06 19:16:46 +00:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  |   kotlinOptions { | 
					
						
							| 
									
										
										
										
											2020-06-25 20:29:33 +00:00
										 |  |  |     jvmTarget = JavaVersion.VERSION_1_8.toString() | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-16 08:03:52 +00:00
										 |  |  |   buildFeatures { | 
					
						
							|  |  |  |     viewBinding = true | 
					
						
							| 
									
										
										
										
											2023-01-10 12:56:20 +00:00
										 |  |  |     dataBinding = true | 
					
						
							| 
									
										
										
										
											2021-07-16 08:03:52 +00:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-07 12:51:24 +00:00
										 |  |  |   packagingOptions { | 
					
						
							|  |  |  |     resources.excludes.add("META-INF/LICENSE.md") | 
					
						
							|  |  |  |     resources.excludes.add("META-INF/LICENSE-notice.md") | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-06 07:34:09 +00:00
										 |  |  |   lint { | 
					
						
							| 
									
										
										
										
											2021-08-06 19:16:46 +00:00
										 |  |  |     disable += listOf("MissingTranslation", "ExtraTranslation") | 
					
						
							| 
									
										
										
										
											2021-07-20 07:01:52 +00:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-06 08:31:09 +00:00
										 |  |  |   compileSdk = 33 | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |   defaultConfig { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-06 07:34:09 +00:00
										 |  |  |     applicationId = "audio.funkwhale.ffa" | 
					
						
							| 
									
										
										
										
											2020-05-30 19:44:41 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-01 11:11:11 +00:00
										 |  |  |     versionCode = androidGitVersion.code() | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  |     versionName = androidGitVersion.name() | 
					
						
							| 
									
										
										
										
											2021-07-23 12:10:13 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-06 07:34:09 +00:00
										 |  |  |     minSdk = 24 | 
					
						
							| 
									
										
										
										
											2022-12-06 08:31:09 +00:00
										 |  |  |     targetSdk = 33 | 
					
						
							| 
									
										
										
										
											2021-08-06 07:34:09 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-23 12:10:13 +00:00
										 |  |  |     manifestPlaceholders["appAuthRedirectScheme"] = "urn" | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   signingConfigs { | 
					
						
							| 
									
										
										
										
											2021-07-13 08:30:33 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  |     create("release") { | 
					
						
							| 
									
										
										
										
											2021-07-13 08:30:33 +00:00
										 |  |  |       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() | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  |       } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-30 08:57:49 +00:00
										 |  |  |   testOptions { | 
					
						
							| 
									
										
										
										
											2021-08-04 08:41:42 +00:00
										 |  |  |     execution = "ANDROID_TEST_ORCHESTRATOR" | 
					
						
							|  |  |  |     animationsDisabled = true | 
					
						
							|  |  |  |     unitTests { | 
					
						
							|  |  |  |       isReturnDefaultValues = true | 
					
						
							|  |  |  |       isIncludeAndroidResources = true | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-07-30 08:57:49 +00:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  |   buildTypes { | 
					
						
							| 
									
										
										
										
											2020-05-28 23:10:12 +00:00
										 |  |  |     getByName("debug") { | 
					
						
							|  |  |  |       isDebuggable = true | 
					
						
							| 
									
										
										
										
											2020-07-10 15:23:02 +00:00
										 |  |  |       applicationIdSuffix = ".dev" | 
					
						
							| 
									
										
										
										
											2020-06-25 20:29:33 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-06 19:16:46 +00:00
										 |  |  |       isTestCoverageEnabled = true | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-13 08:30:33 +00:00
										 |  |  |       if (project.hasProperty("signing.store")) { | 
					
						
							|  |  |  |         signingConfig = signingConfigs.getByName("debug") | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-25 20:29:33 +00:00
										 |  |  |       resValue("string", "debug.hostname", props.getProperty("debug.hostname", "")) | 
					
						
							|  |  |  |       resValue("string", "debug.username", props.getProperty("debug.username", "")) | 
					
						
							|  |  |  |       resValue("string", "debug.password", props.getProperty("debug.password", "")) | 
					
						
							| 
									
										
										
										
											2020-05-28 23:10:12 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  |     getByName("release") { | 
					
						
							| 
									
										
										
										
											2020-07-10 15:23:02 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-13 08:30:33 +00:00
										 |  |  |       if (project.hasProperty("signing.store")) { | 
					
						
							| 
									
										
										
										
											2019-11-06 00:08:30 +00:00
										 |  |  |         signingConfig = signingConfigs.getByName("release") | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-07 19:04:24 +00:00
										 |  |  |       resValue("string", "debug.hostname", "") | 
					
						
							|  |  |  |       resValue("string", "debug.username", "") | 
					
						
							|  |  |  |       resValue("string", "debug.password", "") | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-25 20:29:33 +00:00
										 |  |  |       isMinifyEnabled = true | 
					
						
							|  |  |  |       isShrinkResources = true | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-25 20:29:33 +00:00
										 |  |  |       proguardFiles( | 
					
						
							|  |  |  |         getDefaultProguardFile("proguard-android-optimize.txt"), | 
					
						
							|  |  |  |         "proguard-rules.pro" | 
					
						
							|  |  |  |       ) | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ktlint { | 
					
						
							|  |  |  |   debug.set(false) | 
					
						
							|  |  |  |   verbose.set(false) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | play { | 
					
						
							| 
									
										
										
										
											2021-09-08 13:04:59 +00:00
										 |  |  |   enabled.set(props.hasProperty("play.credentials")) | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-08 13:04:59 +00:00
										 |  |  |   if (enabled.get()) { | 
					
						
							|  |  |  |     serviceAccountCredentials.set(file(props.getProperty("play.credentials"))) | 
					
						
							|  |  |  |     defaultToAppBundles.set(true) | 
					
						
							|  |  |  |     track.set("beta") | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | dependencies { | 
					
						
							| 
									
										
										
										
											2023-01-10 12:56:20 +00:00
										 |  |  |   val navVersion: String by rootProject.extra | 
					
						
							|  |  |  |   val lifecycleVersion: String by rootProject.extra | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-13 20:24:35 +00:00
										 |  |  |   implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar")))) | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-03 18:06:29 +00:00
										 |  |  |   implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.20") | 
					
						
							| 
									
										
										
										
											2022-07-13 23:03:40 +00:00
										 |  |  |   implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") | 
					
						
							| 
									
										
										
										
											2022-07-13 23:03:35 +00:00
										 |  |  |   implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4") | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-11 20:33:34 +00:00
										 |  |  |   implementation("androidx.appcompat:appcompat:1.6.0") | 
					
						
							| 
									
										
										
										
											2022-12-08 08:30:44 +00:00
										 |  |  |   implementation("androidx.core:core-ktx:1.9.0") | 
					
						
							| 
									
										
										
										
											2023-01-10 12:56:20 +00:00
										 |  |  |   implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion") | 
					
						
							|  |  |  |   implementation("androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion") | 
					
						
							| 
									
										
										
										
											2022-03-03 10:03:18 +00:00
										 |  |  |   implementation("androidx.coordinatorlayout:coordinatorlayout:1.2.0") | 
					
						
							| 
									
										
										
										
											2022-03-07 08:32:52 +00:00
										 |  |  |   implementation("androidx.preference:preference-ktx:1.2.0") | 
					
						
							| 
									
										
										
										
											2021-07-01 11:25:09 +00:00
										 |  |  |   implementation("androidx.recyclerview:recyclerview:1.2.1") | 
					
						
							| 
									
										
										
										
											2020-06-25 20:29:33 +00:00
										 |  |  |   implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0") | 
					
						
							| 
									
										
										
										
											2023-01-24 22:33:36 +00:00
										 |  |  |   implementation("com.google.android.material:material:1.8.0") | 
					
						
							| 
									
										
										
										
											2021-07-01 11:25:09 +00:00
										 |  |  |   implementation("com.android.support.constraint:constraint-layout:2.0.4") | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-27 07:21:03 +00:00
										 |  |  |   implementation("com.google.android.exoplayer:exoplayer-core:2.18.1") | 
					
						
							|  |  |  |   implementation("com.google.android.exoplayer:exoplayer-ui:2.18.1") | 
					
						
							|  |  |  |   implementation("com.google.android.exoplayer:extension-mediasession:2.18.1") | 
					
						
							| 
									
										
										
										
											2021-08-06 07:34:09 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-04 12:35:33 +00:00
										 |  |  |   implementation("io.insert-koin:koin-core:3.3.2") | 
					
						
							|  |  |  |   implementation("io.insert-koin:koin-android:3.3.2") | 
					
						
							|  |  |  |   testImplementation("io.insert-koin:koin-test:3.3.2") | 
					
						
							| 
									
										
										
										
											2021-08-09 04:50:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-27 07:21:03 +00:00
										 |  |  |   implementation("com.github.PaulWoitaschek.ExoPlayer-Extensions:extension-opus:789a4f83169cff5c7a91655bb828fde2cfde671a") { | 
					
						
							| 
									
										
										
										
											2020-09-07 07:58:57 +00:00
										 |  |  |     isTransitive = false | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2022-08-27 07:21:03 +00:00
										 |  |  |   implementation("com.github.PaulWoitaschek.ExoPlayer-Extensions:extension-flac:789a4f83169cff5c7a91655bb828fde2cfde671a") { | 
					
						
							| 
									
										
										
										
											2020-09-07 07:58:57 +00:00
										 |  |  |     isTransitive = false | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2020-06-13 20:24:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-31 00:30:34 +00:00
										 |  |  |   implementation("com.github.AliAsadi:PowerPreference:2.1.1") | 
					
						
							| 
									
										
										
										
											2022-08-25 12:58:19 +00:00
										 |  |  |   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") | 
					
						
							| 
									
										
										
										
											2023-01-06 16:31:02 +00:00
										 |  |  |   implementation("com.google.code.gson:gson:2.10.1") | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  |   implementation("com.squareup.picasso:picasso:2.71828") | 
					
						
							| 
									
										
										
										
											2021-07-01 11:25:09 +00:00
										 |  |  |   implementation("jp.wasabeef:picasso-transformations:2.4.0") | 
					
						
							| 
									
										
										
										
											2022-08-25 12:58:19 +00:00
										 |  |  |   implementation("net.openid:appauth:0.11.1") | 
					
						
							| 
									
										
										
										
											2021-08-06 07:34:09 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-10 12:56:20 +00:00
										 |  |  |   implementation("androidx.navigation:navigation-fragment-ktx:$navVersion") | 
					
						
							|  |  |  |   implementation("androidx.navigation:navigation-ui-ktx:$navVersion") | 
					
						
							|  |  |  |   implementation("androidx.navigation:navigation-dynamic-features-fragment:$navVersion") | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-30 08:57:49 +00:00
										 |  |  |   testImplementation("junit:junit:4.13.2") | 
					
						
							| 
									
										
										
										
											2022-11-29 13:30:42 +00:00
										 |  |  |   testImplementation("io.mockk:mockk:1.13.3") | 
					
						
							| 
									
										
										
										
											2022-11-08 20:30:47 +00:00
										 |  |  |   testImplementation("androidx.test:core:1.5.0") | 
					
						
							| 
									
										
										
										
											2022-08-25 13:03:02 +00:00
										 |  |  |   testImplementation("io.strikt:strikt-core:0.34.1") | 
					
						
							| 
									
										
										
										
											2023-01-02 21:30:47 +00:00
										 |  |  |   testImplementation("org.robolectric:robolectric:4.9.2") | 
					
						
							| 
									
										
										
										
											2021-08-06 07:34:09 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-07 12:51:24 +00:00
										 |  |  |   androidTestImplementation("io.mockk:mockk-android:1.13.3") | 
					
						
							| 
									
										
										
										
											2023-01-10 12:56:20 +00:00
										 |  |  |   androidTestImplementation("androidx.navigation:navigation-testing:$navVersion") | 
					
						
							| 
									
										
										
										
											2021-07-30 08:57:49 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | project.afterEvaluate { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-06 19:16:46 +00:00
										 |  |  |   tasks.withType<Test> { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     configure<JacocoTaskExtension> { | 
					
						
							|  |  |  |       isIncludeNoLocationClasses = true | 
					
						
							|  |  |  |       excludes = listOf("jdk.internal.*") | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   tasks.create("jacocoTestReport", type = JacocoReport::class) { | 
					
						
							|  |  |  |     dependsOn("testDebugUnitTest", "createDebugCoverageReport") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     group = "Verification" | 
					
						
							|  |  |  |     description = "Creates a Jacoco Coverage report" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-04 08:41:42 +00:00
										 |  |  |     reports { | 
					
						
							|  |  |  |       xml.required.set(true) | 
					
						
							|  |  |  |       csv.required.set(true) | 
					
						
							|  |  |  |       html.required.set(true) | 
					
						
							| 
									
										
										
										
											2021-07-30 08:57:49 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-08-06 19:16:46 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     val fileFilter = listOf( | 
					
						
							|  |  |  |       "**/R.class", | 
					
						
							|  |  |  |       "**/R$*.class", | 
					
						
							|  |  |  |       "**/BuildConfig.*", | 
					
						
							|  |  |  |       "**/Manifest*.*", | 
					
						
							|  |  |  |       "**/*Test*.*", | 
					
						
							|  |  |  |       "android/**/*.*", | 
					
						
							|  |  |  |       "**/*$[0-9].*" | 
					
						
							|  |  |  |     ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     val debugTree = fileTree("${project.buildDir}/tmp/kotlin-classes/debug") { | 
					
						
							|  |  |  |       setExcludes(fileFilter) | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     val mainSrc = "${project.projectDir}/src/main/java" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     sourceDirectories.setFrom(files(listOf(mainSrc))) | 
					
						
							|  |  |  |     classDirectories.setFrom(files(listOf(debugTree))) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-09 07:56:15 +00:00
										 |  |  |     executionData.setFrom( | 
					
						
							|  |  |  |       fileTree(project.buildDir) { | 
					
						
							|  |  |  |         setIncludes( | 
					
						
							|  |  |  |           listOf( | 
					
						
							|  |  |  |             "outputs/unit_test_code_coverage/debugUnitTest/*.exec", | 
					
						
							|  |  |  |             "outputs/code_coverage/debugAndroidTest/connected/**/*.ec" | 
					
						
							|  |  |  |           ) | 
					
						
							| 
									
										
										
										
											2021-08-06 19:16:46 +00:00
										 |  |  |         ) | 
					
						
							| 
									
										
										
										
											2021-09-09 07:56:15 +00:00
										 |  |  |       } | 
					
						
							|  |  |  |     ) | 
					
						
							| 
									
										
										
										
											2021-07-30 08:57:49 +00:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2019-10-21 21:26:06 +00:00
										 |  |  | } |