diff --git a/AndroidCLI/build.gradle.kts b/AndroidCLI/build.gradle.kts index 2e521684ce..0e705de5e7 100644 --- a/AndroidCLI/build.gradle.kts +++ b/AndroidCLI/build.gradle.kts @@ -17,6 +17,8 @@ plugins { id("com.android.application") id("kotlin-android") + id("io.gitlab.arturbosch.detekt") + id("org.jlleitschuh.gradle.ktlint") } repositories { diff --git a/AndroidLibBenchmark/build.gradle.kts b/AndroidLibBenchmark/build.gradle.kts index 29f6ac6b1d..035a70b43d 100644 --- a/AndroidLibBenchmark/build.gradle.kts +++ b/AndroidLibBenchmark/build.gradle.kts @@ -18,6 +18,8 @@ plugins { id("com.android.library") id("kotlin-android") id("androidx.benchmark") version Versions.ANDROID_BENCHMARK.version + id("io.gitlab.arturbosch.detekt") + id("org.jlleitschuh.gradle.ktlint") } repositories { diff --git a/Selektric/build.gradle.kts b/Selektric/build.gradle.kts index 60eb659196..a203d1f273 100644 --- a/Selektric/build.gradle.kts +++ b/Selektric/build.gradle.kts @@ -18,10 +18,6 @@ import java.util.Locale import java.nio.file.Files import java.nio.file.Paths -repositories { - mavenCentral() -} - plugins { base } diff --git a/build.gradle.kts b/build.gradle.kts index 5a03d021ca..17f7f934f6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -71,9 +71,6 @@ dependencies { subprojects { group = rootProject.group version = rootProject.version - apply { - plugin("io.gitlab.arturbosch.detekt") - } plugins.withType().configureEach { tasks.withType().configureEach { metaInf { @@ -156,14 +153,16 @@ subprojects { systemProperty(it.key, it.value) } } - configure { - toolVersion = Versions.DETEKT.version - source = files("src") - config = files("${rootProject.projectDir}/config/detekt/config.yml") - buildUponDefaultConfig = true - parallel = false - debug = false - ignoreFailures = false + plugins.withId("io.gitlab.arturbosch.detekt") { + configure { + toolVersion = Versions.DETEKT.version + source = files("src") + config = files("${rootProject.projectDir}/config/detekt/config.yml") + buildUponDefaultConfig = true + parallel = false + debug = false + ignoreFailures = false + } } tasks.withType().configureEach { exclude("**/res/**") @@ -202,14 +201,13 @@ subprojects { } allprojects { - apply { - plugin("org.jlleitschuh.gradle.ktlint") - } - configure { - version.set(Versions.KTLINT.version) - disabledRules.set(setOf("import-ordering", "indent", "wrapping")) - reporters { - reporter(ReporterType.HTML) + plugins.withId("org.jlleitschuh.gradle.ktlint") { + configure { + version.set(Versions.KTLINT.version) + disabledRules.set(setOf("import-ordering", "indent", "wrapping")) + reporters { + reporter(ReporterType.HTML) + } } } tasks.withType().configureEach { diff --git a/selekt-android-lint/build.gradle.kts b/selekt-android-lint/build.gradle.kts index 68845f9b68..c82b5381c3 100644 --- a/selekt-android-lint/build.gradle.kts +++ b/selekt-android-lint/build.gradle.kts @@ -23,6 +23,8 @@ plugins { kotlin("jvm") `maven-publish` signing + id("io.gitlab.arturbosch.detekt") + id("org.jlleitschuh.gradle.ktlint") } java { diff --git a/selekt-android-sqlcipher/build.gradle.kts b/selekt-android-sqlcipher/build.gradle.kts index 09a92b00c6..a383af00bc 100644 --- a/selekt-android-sqlcipher/build.gradle.kts +++ b/selekt-android-sqlcipher/build.gradle.kts @@ -23,6 +23,7 @@ plugins { id("com.android.library") `maven-publish` signing + id("io.gitlab.arturbosch.detekt") } repositories { diff --git a/selekt-android/build.gradle.kts b/selekt-android/build.gradle.kts index d1fc4670ff..e60154253a 100644 --- a/selekt-android/build.gradle.kts +++ b/selekt-android/build.gradle.kts @@ -23,6 +23,8 @@ plugins { `maven-publish` signing id("org.jetbrains.kotlinx.kover") + id("io.gitlab.arturbosch.detekt") + id("org.jlleitschuh.gradle.ktlint") } repositories { @@ -66,7 +68,7 @@ dependencies { compileOnly(androidX("room", "runtime", Versions.ANDROIDX_ROOM.version)) implementation(projects.selektAndroidSqlcipher) implementation(projects.selektJava) - implementation(projects.selektSqlite3) + implementation(projects.selektSqlite3Classes) kaptTest(androidX("room", "compiler", Versions.ANDROIDX_ROOM.version)) testImplementation(androidX("lifecycle", "livedata-ktx", Versions.ANDROIDX_LIVE_DATA.version)) testImplementation(androidX("room", "runtime", Versions.ANDROIDX_ROOM.version)) diff --git a/selekt-api/build.gradle.kts b/selekt-api/build.gradle.kts index ef095808a8..a2fb70ffa7 100644 --- a/selekt-api/build.gradle.kts +++ b/selekt-api/build.gradle.kts @@ -26,6 +26,8 @@ plugins { `maven-publish` signing id("org.jetbrains.kotlinx.kover") + id("io.gitlab.arturbosch.detekt") + id("org.jlleitschuh.gradle.ktlint") } java { diff --git a/selekt-java/build.gradle.kts b/selekt-java/build.gradle.kts index 2bc1773228..75e0d36972 100644 --- a/selekt-java/build.gradle.kts +++ b/selekt-java/build.gradle.kts @@ -31,6 +31,8 @@ plugins { `maven-publish` signing id("bb-jmh") + id("io.gitlab.arturbosch.detekt") + id("org.jlleitschuh.gradle.ktlint") } disableKotlinCompilerAssertions() @@ -57,7 +59,7 @@ val integrationTestRuntimeOnly: Configuration by configurations.getting { dependencies { implementation(projects.selektApi) - implementation(projects.selektSqlite3) + implementation(projects.selektSqlite3Classes) jmhImplementation(kotlinX("coroutines-core", version = Versions.KOTLINX_COROUTINES.version)) } diff --git a/selekt-sqlite3-classes/build.gradle.kts b/selekt-sqlite3-classes/build.gradle.kts new file mode 100644 index 0000000000..5c9fdeee2e --- /dev/null +++ b/selekt-sqlite3-classes/build.gradle.kts @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Bloomberg Finance L.P. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +repositories { + mavenCentral() +} + +plugins { + kotlin("jvm") + `maven-publish` + signing + id("io.gitlab.arturbosch.detekt") + id("org.jlleitschuh.gradle.ktlint") +} + +disableKotlinCompilerAssertions() + +java { + withJavadocJar() + withSourcesJar() +} + +publishing { + publications.register("main") { + from(components.getByName("java")) + pom { + commonInitialisation(project) + description.set("Selekt Java SQLite interface library.") + } + } +} diff --git a/selekt-sqlite3/src/main/resources/META-INF/proguard/consumer-rules.pro b/selekt-sqlite3-classes/resources/META-INF/proguard/consumer-rules.pro similarity index 100% rename from selekt-sqlite3/src/main/resources/META-INF/proguard/consumer-rules.pro rename to selekt-sqlite3-classes/resources/META-INF/proguard/consumer-rules.pro diff --git a/selekt-sqlite3/src/main/kotlin/com/bloomberg/selekt/ExternalSQLite3.kt b/selekt-sqlite3-classes/src/main/kotlin/com/bloomberg/selekt/ExternalSQLite3.kt similarity index 100% rename from selekt-sqlite3/src/main/kotlin/com/bloomberg/selekt/ExternalSQLite3.kt rename to selekt-sqlite3-classes/src/main/kotlin/com/bloomberg/selekt/ExternalSQLite3.kt diff --git a/selekt-sqlite3/src/main/kotlin/com/bloomberg/selekt/SQLCodes.kt b/selekt-sqlite3-classes/src/main/kotlin/com/bloomberg/selekt/SQLCodes.kt similarity index 100% rename from selekt-sqlite3/src/main/kotlin/com/bloomberg/selekt/SQLCodes.kt rename to selekt-sqlite3-classes/src/main/kotlin/com/bloomberg/selekt/SQLCodes.kt diff --git a/selekt-sqlite3/build.gradle.kts b/selekt-sqlite3/build.gradle.kts index 695a2c371c..db486ba2d0 100644 --- a/selekt-sqlite3/build.gradle.kts +++ b/selekt-sqlite3/build.gradle.kts @@ -18,14 +18,8 @@ import java.nio.file.Files import java.nio.file.Paths import java.util.Locale -repositories { - mavenCentral() -} - plugins { - kotlin("jvm") - `maven-publish` - signing + base } val cFlags = arrayOf( @@ -64,23 +58,6 @@ val cFlags = arrayOf( "-DSQLITE_USE_URI=1" ) -disableKotlinCompilerAssertions() - -java { - withJavadocJar() - withSourcesJar() -} - -publishing { - publications.register("main") { - from(components.getByName("java")) - pom { - commonInitialisation(project) - description.set("Selekt Java SQLite interface library.") - } - } -} - tasks.register("configureSqlCipher") { workingDir = File("$projectDir/src/main/external/sqlcipher") commandLine("./configure") diff --git a/settings.gradle.kts b/settings.gradle.kts index 63fdd258ba..efd9aab967 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -26,6 +26,7 @@ include(":selekt-android-sqlcipher") include(":selekt-api") include(":selekt-java") include(":selekt-sqlite3") +include(":selekt-sqlite3-classes") pluginManagement { repositories {