-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AND-81: extract common build-logic to convention plugins in buildSrc
- Loading branch information
Showing
13 changed files
with
123 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,5 @@ | ||
import com.redmadrobot.build.dsl.* | ||
|
||
plugins { | ||
alias(libs.plugins.gradle.android) apply false | ||
alias(stack.plugins.kotlin.android) apply false | ||
|
||
alias(rmr.plugins.android.config) | ||
alias(rmr.plugins.publish.config) | ||
alias(rmr.plugins.detekt) | ||
alias(stack.plugins.versions) | ||
`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() | ||
} | ||
} | ||
convention.detekt | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
pluginManagement { | ||
repositories { | ||
gradlePluginPortal() | ||
google() | ||
mavenCentral() | ||
} | ||
} | ||
|
||
@Suppress("UnstableApiUsage") | ||
dependencyResolutionManagement { | ||
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")) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.set(!isRunningOnCi) | ||
pom { | ||
setGitHubProject("RedMadRobot/redmadrobot-android-ktx") | ||
|
||
licenses { | ||
mit() | ||
} | ||
|
||
developers { | ||
developer(id = "osipxd", name = "Osip Fatkullin", email = "[email protected]") | ||
} | ||
} | ||
} | ||
} | ||
|
||
publishing { | ||
repositories { | ||
if (isRunningOnCi) githubPackages("RedMadRobot/redmadrobot-android-ktx") | ||
if (isReleaseVersion && credentialsExist("ossrh")) ossrh() | ||
} | ||
} | ||
|
||
kotlinCompile { | ||
kotlinOptions { | ||
moduleName = "redmadrobot.${project.name}" | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters