11import java.nio.file.Paths
22import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
33
4+ apply plugin : " io.gitlab.arturbosch.detekt"
5+
46buildscript {
57 // Buildscript is evaluated before everything else so we can't use getExtOrDefault
68 def kotlin_version = rootProject. ext. has(' kotlinVersion' ) ? rootProject. ext. get(' kotlinVersion' ) : project. properties[' DdSdkReactNative_kotlinVersion' ]
@@ -16,7 +18,7 @@ buildscript {
1618 // noinspection DifferentKotlinGradleVersion
1719 classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version "
1820 classpath " org.jlleitschuh.gradle:ktlint-gradle:11.5.1"
19- classpath " io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.18.0 "
21+ classpath " io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.8 "
2022 classpath ' com.github.bjoernq:unmockplugin:0.7.9'
2123// Uncomment here and in settings.gradle for getting rid of IDE errors for new architecture:
2224// classpath "com.facebook.react:react-native-gradle-plugin"
@@ -36,7 +38,7 @@ if (isNewArchitectureEnabled()) {
3638}
3739apply plugin : ' kotlin-android'
3840apply plugin : ' org.jlleitschuh.gradle.ktlint'
39- apply plugin : " io.gitlab.arturbosch.detekt "
41+
4042
4143/**
4244 * Finds the path of the installed npm package with the given name using Node's
@@ -96,6 +98,7 @@ def getExtOrIntegerDefault(name) {
9698}
9799
98100android {
101+ compileSdk getExtOrIntegerDefault(' compileSdkVersion' )
99102 compileSdkVersion getExtOrIntegerDefault(' compileSdkVersion' )
100103 buildToolsVersion getExtOrDefault(' buildToolsVersion' )
101104
@@ -122,6 +125,7 @@ android {
122125 }
123126
124127 defaultConfig {
128+ compileSdk getExtOrIntegerDefault(' compileSdkVersion' )
125129 minSdkVersion getExtOrIntegerDefault(' minSdkVersion' )
126130 targetSdkVersion getExtOrIntegerDefault(' targetSdkVersion' )
127131 versionCode 1
@@ -222,6 +226,8 @@ dependencies {
222226 testImplementation " org.jetbrains.kotlin:kotlin-reflect:$kotlin_version "
223227
224228 unmock ' org.robolectric:android-all:4.4_r1-robolectric-r2'
229+ detektPlugins " io.gitlab.arturbosch.detekt:detekt-formatting:1.23.8"
230+ detektPlugins " io.gitlab.arturbosch.detekt:detekt-rules-libraries:1.23.8"
225231}
226232
227233unMock {
0 commit comments