Skip to content

Commit

Permalink
detekt setup
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudoankit committed Nov 27, 2023
1 parent 156c911 commit f88cee8
Show file tree
Hide file tree
Showing 7 changed files with 722 additions and 3 deletions.
4 changes: 3 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ buildscript {
classpath(Dependencies.Gradle.AndroidTools)
classpath(Dependencies.Gradle.KotlinGradle)
classpath(kotlin("serialization", version = Versions.Kotlin))
classpath("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7.1")
classpath(Dependencies.Gradle.SonarQube)
classpath(Dependencies.Gradle.Detekt)
}
}

plugins {
id(Plugins.Ksp) version Versions.Compose.KspPlugin apply false
id(Plugins.Detekt) version Versions.Detekt
}

allprojects {
Expand Down
2 changes: 2 additions & 0 deletions buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ object Dependencies {
const val KotlinGradle = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.Kotlin}"
const val Kotlin = "org.jetbrains.kotlin:kotlin-stdlib:1.1.2"
const val PluginsRepo = "https://plugins.gradle.org/m2/"
const val Detekt = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:${Versions.Detekt}"
const val SonarQube = "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7.1"
}

object Room {
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/java/Plugins.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ object Plugins {
const val AndroidLibrary = "com.android.library"
const val AndroidApplication = "com.android.application"
const val Ksp = "com.google.devtools.ksp"
const val Detekt = "io.gitlab.arturbosch.detekt"
}
1 change: 1 addition & 0 deletions buildSrc/src/main/java/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ object Versions {
const val Kotlin = "1.8.10"
const val Coroutine = "1.6.4"
const val Room = "2.4.2"
const val Detekt = "1.21.0"

object Compose {
const val OrbitMvi = "4.5.0"
Expand Down
3 changes: 2 additions & 1 deletion buildSrc/src/main/java/plugin/base/CorePlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package plugin.base

import BuildConfig
import Dependencies
import Plugins
import Versions
import com.android.build.gradle.BaseExtension
import org.gradle.api.Plugin
Expand All @@ -10,7 +11,6 @@ import org.gradle.kotlin.dsl.dependencies
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import plugin.util.PluginConstants
import plugin.util.implementation
import java.io.File

/**
* Plugin containing all common code for any gradle
Expand All @@ -24,6 +24,7 @@ open class CorePlugin : Plugin<Project> {
apply("kotlinx-serialization")
apply("kotlin-parcelize")
apply("org.sonarqube")
apply(Plugins.Detekt)
}

val androidExtension =
Expand Down
Loading

0 comments on commit f88cee8

Please sign in to comment.