Skip to content

Commit 7c1c0ac

Browse files
authored
Merge pull request #3 from KryptKode/chore/setup-commons
Chore/setup commons
2 parents da04249 + 6eecf51 commit 7c1c0ac

File tree

99 files changed

+2663
-254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+2663
-254
lines changed

.detekt/config.yml

Lines changed: 132 additions & 183 deletions
Large diffs are not rendered by default.

.github/workflows/android.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
${{ runner.os }}-gradle-
3131
3232
- name: Run Detekt
33-
run: ./gradlew detektAll
33+
run: ./gradlew detekt
3434
ktlint:
3535
runs-on: ubuntu-latest
3636

app/build.gradle.kts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
kotlinParcelize
55
kotlinKapt
66
daggerHilt
7+
jacoco
78
}
89

910
android {
@@ -19,7 +20,6 @@ android {
1920
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2021
}
2122

22-
2323
buildTypes {
2424
buildTypes {
2525
getByName(BuildTypes.RELEASE) {
@@ -51,8 +51,7 @@ dependencies {
5151
implementation(Libs.navigation_fragment_ktx)
5252
implementation(Libs.navigation_ui_ktx)
5353

54-
debugImplementation ("com.squareup.leakcanary:leakcanary-android:2.6")
55-
54+
debugImplementation("com.squareup.leakcanary:leakcanary-android:2.6")
5655

5756
implementation(Libs.hilt_android)
5857
kapt(Libs.hilt_android_compiler)
@@ -62,4 +61,4 @@ dependencies {
6261
testImplementation(Libs.junit_junit)
6362
androidTestImplementation(Libs.androidx_test_ext_junit)
6463
androidTestImplementation(Libs.espresso_core)
65-
}
64+
}

app/src/androidTest/java/com/kryptkode/swahpee/ExampleInstrumentedTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ class ExampleInstrumentedTest {
1919
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
2020
assertEquals("com.kryptkode.swahpee", appContext.packageName)
2121
}
22-
}
22+
}

app/src/test/java/com/kryptkode/swahpee/ExampleUnitTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ class ExampleUnitTest {
1313
fun addition_isCorrect() {
1414
assertEquals(4, 2 + 2)
1515
}
16-
}
16+
}

build.gradle.kts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
@file:Suppress("UNUSED_VARIABLE")
3+
24
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
35

46
buildscript {
@@ -14,10 +16,10 @@ buildscript {
1416
}
1517
}
1618

19+
plugins.apply(ScriptsPlugins.gitHooks)
20+
1721
plugins {
1822
buildSrcVersions
19-
quality
20-
jacoco
2123
}
2224

2325
allprojects {
@@ -26,14 +28,16 @@ allprojects {
2628
jcenter()
2729
}
2830

31+
plugins.apply(ScriptsPlugins.quality)
32+
2933
tasks.withType<KotlinCompile>().configureEach {
3034
kotlinOptions.freeCompilerArgs +=
3135
"-Xuse-experimental=" +
32-
"kotlin.Experimental," +
33-
"kotlinx.coroutines.ExperimentalCoroutinesApi," +
34-
"kotlinx.coroutines.InternalCoroutinesApi," +
35-
"kotlinx.coroutines.ObsoleteCoroutinesApi," +
36-
"kotlinx.coroutines.FlowPreview"
36+
"kotlin.Experimental," +
37+
"kotlinx.coroutines.ExperimentalCoroutinesApi," +
38+
"kotlinx.coroutines.InternalCoroutinesApi," +
39+
"kotlinx.coroutines.ObsoleteCoroutinesApi," +
40+
"kotlinx.coroutines.FlowPreview"
3741
}
3842
}
3943

buildSrc/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ plugins {
33
`kotlin-dsl-precompiled-script-plugins`
44
}
55

6+
kotlinDslPluginOptions {
7+
experimentalWarning.set(false)
8+
}
9+
610
repositories {
711
jcenter()
812
maven("https://plugins.gradle.org/m2/")
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* Configuration of build modules
3+
*/
4+
object BuildModules {
5+
const val app = ":app"
6+
const val core = ":core"
7+
8+
object Features {
9+
const val home = ":features:home"
10+
}
11+
12+
object Commons {
13+
const val testShared = ":common:testShared"
14+
const val androidShared = ":common:androidShared"
15+
}
16+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
object BuildTasksGroups {
2+
const val ANDROID = "android"
3+
const val BUILD = "build"
4+
const val BUILD_SETUP = "build setup"
5+
const val CLEANUP = "cleanup"
6+
const val DOCUMENTATION = "documentation"
7+
const val FORMATTING = "formatting"
8+
const val GIT_HOOKS = "git hooks"
9+
const val HELP = "help"
10+
const val INSTALL = "install"
11+
const val OTHER = "other"
12+
const val REPORTING = "reporting"
13+
const val VERIFICATION = "verification"
14+
const val QUALITY = "quality"
15+
}

buildSrc/src/main/kotlin/ScriptsPlugins.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ object ScriptsPlugins {
22
const val androidLibrary = "commonscripts.android-library"
33
const val kotlinLibrary = "commonscripts.kotlin-library"
44
const val quality = "commonscripts.quality"
5+
const val gitHooks = "commonscripts.git-hooks"
56
}

0 commit comments

Comments
 (0)