Skip to content

Commit

Permalink
Merge pull request #51 from RedMadRobot/refactoring/AND-81
Browse files Browse the repository at this point in the history
AND-81: Cleanup existing KTX
  • Loading branch information
osipxd authored May 3, 2024
2 parents 8fbead0 + 7d74198 commit 65a8aa8
Show file tree
Hide file tree
Showing 32 changed files with 378 additions and 479 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Run Detekt
uses: eskatos/gradle-command-action@v1
with:
arguments: detektReleaseAll
arguments: detektAll detektReleaseAll

publish:
name: Publish
Expand Down
47 changes: 3 additions & 44 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,46 +1,5 @@
import com.redmadrobot.build.dsl.*

plugins {
id("com.redmadrobot.android-config") version "0.15"
id("com.redmadrobot.publish-config") version "0.15"
id("com.redmadrobot.detekt") version "0.15"
id("com.github.ben-manes.versions") version "0.39.0"
`maven-publish`
}

redmadrobot {
android.minSdk.set(14)

publishing {
signArtifacts.set(!isRunningOnCi)
pom {
setGitHubProject("RedMadRobot/redmadrobot-android-ktx")

licenses {
mit()
}

developers {
developer(id = "osipxd", name = "Osip Fatkullin", email = "[email protected]")
}
}
}
}

subprojects {
apply(plugin = "io.gitlab.arturbosch.detekt")
group = "com.redmadrobot.extensions"

kotlinCompile {
// Fix module-name conflicts with Android KTX
kotlinOptions.moduleName = "redmadrobot.${project.name}"
}

apply(plugin = "maven-publish")
publishing {
repositories {
if (isRunningOnCi) githubPackages("RedMadRobot/redmadrobot-android-ktx")
if (isReleaseVersion && credentialsExist("ossrh")) ossrh()
}
}
alias(rmr.plugins.detekt)
alias(stack.plugins.versions)
convention.detekt
}
19 changes: 12 additions & 7 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@ plugins {
`kotlin-dsl`
}

repositories {
mavenCentral()
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = JavaVersion.VERSION_11.toString()
}

java {
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_11
}

dependencies {
implementation(rmr.infrastructure.publish)
implementation(rmr.infrastructure.android)
implementation(stack.gradle.android.cacheFixGradlePlugin)
implementation(stack.kotlin.gradlePlugin)
implementation(stack.detekt.gradlePlugin)
implementation(libs.android.gradlePlugin)
}
40 changes: 40 additions & 0 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}

@Suppress("UnstableApiUsage")
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)

repositories {
google {
content {
includeGroupByRegex("com\\.android.*")
includeGroupByRegex("com\\.google.*")
includeGroupByRegex("androidx.*")
}
}

mavenCentral()
gradlePluginPortal()
}

versionCatalogs {
val version = "2024.04.10"
create("rmr") {
from("com.redmadrobot.versions:versions-redmadrobot:$version")
}

create("stack") {
from("com.redmadrobot.versions:versions-stack:$version")
}

create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}
20 changes: 20 additions & 0 deletions buildSrc/src/main/kotlin/convention.detekt.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask

plugins {
id("io.gitlab.arturbosch.detekt")
}

tasks.withType<Detekt>().configureEach {
jvmTarget = JavaVersion.VERSION_11.toString()
}
tasks.withType<DetektCreateBaselineTask>().configureEach {
jvmTarget = JavaVersion.VERSION_11.toString()
}

dependencies {
//noinspection UseTomlInstead
detektPlugins("io.gitlab.arturbosch.detekt:detekt-rules-libraries:1.23.6")
//noinspection UseTomlInstead
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.6")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
plugins {
id("com.redmadrobot.android-library")
id("convention.publishing")
id("convention.detekt")
}

redmadrobot {
android.minSdk = 19
}
39 changes: 39 additions & 0 deletions buildSrc/src/main/kotlin/convention.publishing.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import com.redmadrobot.build.dsl.*

plugins {
id("com.redmadrobot.publish-config")
id("com.redmadrobot.publish")
}

group = "com.redmadrobot.extensions"

redmadrobot {
publishing {
signArtifacts = !isRunningOnCi
pom {
setGitHubProject("RedMadRobot/redmadrobot-android-ktx")

licenses {
mit()
}

developers {
developer(id = "osipxd", name = "Osip Fatkullin", email = "[email protected]")
developer(id = "sonulen", name = "Andrey Tolmachev", email = "[email protected]")
}
}
}
}

publishing {
repositories {
if (isRunningOnCi) githubPackages("RedMadRobot/redmadrobot-android-ktx")
if (isReleaseVersion && credentialsExist("ossrh")) ossrh()
}
}

kotlinCompile {
kotlinOptions {
moduleName = "redmadrobot.${project.name}"
}
}
73 changes: 0 additions & 73 deletions buildSrc/src/main/kotlin/dependencies.kt

This file was deleted.

Loading

0 comments on commit 65a8aa8

Please sign in to comment.