Skip to content

Commit a05dae7

Browse files
committed
chore: setup ktlint,detect,jacoco
1 parent 2827da2 commit a05dae7

File tree

5 files changed

+25
-20
lines changed

5 files changed

+25
-20
lines changed

build.gradle.kts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ buildscript {
1717
plugins {
1818
buildSrcVersions
1919
quality
20-
jacoco
2120
}
2221

2322
allprojects {
@@ -26,14 +25,17 @@ allprojects {
2625
jcenter()
2726
}
2827

28+
plugins.apply(GradlePluginId.detekt)
29+
plugins.apply(GradlePluginId.ktlint)
30+
2931
tasks.withType<KotlinCompile>().configureEach {
3032
kotlinOptions.freeCompilerArgs +=
3133
"-Xuse-experimental=" +
32-
"kotlin.Experimental," +
33-
"kotlinx.coroutines.ExperimentalCoroutinesApi," +
34-
"kotlinx.coroutines.InternalCoroutinesApi," +
35-
"kotlinx.coroutines.ObsoleteCoroutinesApi," +
36-
"kotlinx.coroutines.FlowPreview"
34+
"kotlin.Experimental," +
35+
"kotlinx.coroutines.ExperimentalCoroutinesApi," +
36+
"kotlinx.coroutines.InternalCoroutinesApi," +
37+
"kotlinx.coroutines.ObsoleteCoroutinesApi," +
38+
"kotlinx.coroutines.FlowPreview"
3739
}
3840
}
3941

buildSrc/src/main/kotlin/commonscripts/android-library.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ plugins {
55
`android-library` apply false
66
`kotlin-android` apply false
77
`kotlin-parcelize` apply false
8+
id("com.vanniktech.android.junit.jacoco")
89
}
910

1011
android {

buildSrc/src/main/kotlin/commonscripts/kotlin-library.gradle.kts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package commonscripts
22

3-
plugins { kotlin apply false }
3+
plugins {
4+
kotlin apply false
5+
id("com.vanniktech.android.junit.jacoco") apply false
6+
}
47

58
dependencies {
69
implementation(Libs.kotlin_stdlib)

buildSrc/src/main/kotlin/extensions/PluginExtensions.kt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ import org.gradle.plugin.use.PluginDependenciesSpec
1010
import org.gradle.plugin.use.PluginDependencySpec
1111

1212
object GradlePluginId {
13-
internal const val androidApplication = "com.android.application"
14-
internal const val androidLibrary = "com.android.library"
15-
internal const val kotlinAndroid = "kotlin-android"
16-
internal const val kotlinParcelize = "kotlin-parcelize"
17-
internal const val kotlinKapt = "kotlin-kapt"
18-
internal const val kotlin = "kotlin"
19-
internal const val daggerHilt = "dagger.hilt.android.plugin"
20-
internal const val jacoco = "com.vanniktech.android.junit.jacoco"
13+
const val androidApplication = "com.android.application"
14+
const val androidLibrary = "com.android.library"
15+
const val kotlinAndroid = "kotlin-android"
16+
const val kotlinParcelize = "kotlin-parcelize"
17+
const val kotlinKapt = "kotlin-kapt"
18+
const val kotlin = "kotlin"
19+
const val daggerHilt = "dagger.hilt.android.plugin"
20+
const val jacoco = "com.vanniktech.android.junit.jacoco"
21+
const val ktlint = "org.jlleitschuh.gradle.ktlint"
22+
const val detekt = "io.gitlab.arturbosch.detekt"
2123
}
2224

2325
val PluginDependenciesSpec.androidApplication: PluginDependencySpec
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
package com.kryptkode.core.cache.mapper
22

3-
interface EntityMapper<E, D> {
4-
5-
fun mapFromEntity(entity: E): D
6-
7-
fun mapToEntity(entity: D): E
3+
interface EntityMapper<E, D> { fun mapFromEntity(entity: E): D
4+
fun mapToEntity(entity: D): E
85
}

0 commit comments

Comments
 (0)