Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Version Catalog and Gradle Kotlin DSL #5534

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 0 additions & 137 deletions build.gradle

This file was deleted.

105 changes: 105 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import io.getstream.chat.android.Dependencies
import io.getstream.chat.android.command.changelog.plugin.ChangelogReleaseSectionPlugin
import io.getstream.chat.android.command.changelog.task.ChangelogReleaseSectionTask
import io.getstream.chat.android.command.changelog.task.ChangelogAddModelSectionTask
import io.getstream.chat.android.command.release.plugin.ReleasePlugin
import io.getstream.chat.android.command.release.task.ReleaseTask
import io.getstream.chat.android.command.unittest.plugin.UnitTestsPlugin
import io.getstream.chat.android.command.unittest.task.UnitTestsTask
import io.getstream.chat.android.command.version.plugin.VersionBumpPlugin
import io.getstream.chat.android.command.version.plugin.MinorBumpPlugin
import io.getstream.chat.android.command.version.plugin.VersionPrintPlugin
import io.getstream.chat.android.command.version.task.VersionPrintTask
import io.getstream.chat.android.command.changelog.plugin.ChangelogAddModelSectionPlugin
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask

plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.android.test) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.kotlin.compose) apply false
alias(libs.plugins.androidx.baseline.profile) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.android.junit5) apply false
alias(libs.plugins.paparazzi) apply false
alias(libs.plugins.google.services) apply false
alias(libs.plugins.firebase.crashlytics) apply false
alias(libs.plugins.spotless) apply false
alias(libs.plugins.detekt) apply false
alias(libs.plugins.shot) apply false
alias(libs.plugins.androidx.navigation) apply false
id("io.getstream.chat.UnitTestsPlugin")
id("io.getstream.chat.ReleasePlugin")
id("io.getstream.chat.ChangelogReleaseSectionPlugin")
id("io.getstream.chat.VersionBumpPlugin")
id("io.getstream.chat.MinorBumpPlugin")
id("io.getstream.chat.VersionPrintPlugin")
id("io.getstream.chat.ChangelogAddModelSectionPlugin")
alias(libs.plugins.gitversioner)
alias(libs.plugins.gradle.versions)
alias(libs.plugins.nexus.publish)
alias(libs.plugins.binary.compatibility.validator)
alias(libs.plugins.dokka)
}

apply(from = "${rootDir}/scripts/sample-app-versioner.gradle")

subprojects {
if (name != "stream-chat-android-docs"
&& buildFile.exists()) {
apply(from = "${rootDir}/spotless/spotless.gradle")
}
apply(plugin = "io.gitlab.arturbosch.detekt")
}

tasks.withType<DependencyUpdatesTask> {
rejectVersionIf {
Dependencies.isStable(currentVersion) && Dependencies.isNonStable(candidate.version)
}
}

tasks.withType<VersionPrintTask> {
config.printFilePath = "build/tmp/temp-version"
}

tasks.withType<UnitTestsTask> {
config.outputPath = "build/tmp/unit-tests-command.sh"
}

tasks.withType<ReleaseTask> {
config.changelogPath = "CHANGELOG.md"
}

tasks.withType<ChangelogReleaseSectionTask> {
config.changelogPath = "CHANGELOG.md"
}

tasks.withType<ChangelogAddModelSectionTask> {
config.changelogPath = "CHANGELOG.md"
config.changelogModel = "CHANGELOG_MODEL.md"
}

tasks.withType<Delete> {
delete(rootProject.layout.buildDirectory)
}

apiValidation {
ignoredPackages.add("com/getstream/sdk/chat/databinding")
ignoredPackages.add("io/getstream/chat/android/ui/databinding")

ignoredProjects += listOf(
"stream-chat-android-docs",
"stream-chat-android-ui-components-sample",
"stream-chat-android-test",
"stream-chat-android-compose-sample",
"stream-chat-android-ui-guides",
)

nonPublicMarkers += listOf(
"io.getstream.chat.android.core.internal.InternalStreamChatApi",
)
}

apply(from = "${rootDir}/scripts/publish-root.gradle")
42 changes: 41 additions & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,46 @@ repositories {
mavenCentral()
}

gradlePlugin {
plugins {
create("UnitTestsPlugin") {
id = "io.getstream.chat.UnitTestsPlugin"
implementationClass = "io.getstream.chat.android.command.unittest.plugin.UnitTestsPlugin"
version = "1.0.0"
}
create("ReleasePlugin") {
id = "io.getstream.chat.ReleasePlugin"
implementationClass = "io.getstream.chat.android.command.release.plugin.ReleasePlugin"
version = "1.0.0"
}
create("ChangelogReleaseSectionPlugin") {
id = "io.getstream.chat.ChangelogReleaseSectionPlugin"
implementationClass = "io.getstream.chat.android.command.changelog.plugin.ChangelogReleaseSectionPlugin"
version = "1.0.0"
}
create("VersionBumpPlugin") {
id = "io.getstream.chat.VersionBumpPlugin"
implementationClass = "io.getstream.chat.android.command.version.plugin.VersionBumpPlugin"
version = "1.0.0"
}
create("MinorBumpPlugin") {
id = "io.getstream.chat.MinorBumpPlugin"
implementationClass = "io.getstream.chat.android.command.version.plugin.MinorBumpPlugin"
version = "1.0.0"
}
create("VersionPrintPlugin") {
id = "io.getstream.chat.VersionPrintPlugin"
implementationClass = "io.getstream.chat.android.command.version.plugin.VersionPrintPlugin"
version = "1.0.0"
}
create("ChangelogAddModelSectionPlugin") {
id = "io.getstream.chat.ChangelogAddModelSectionPlugin"
implementationClass = "io.getstream.chat.android.command.changelog.plugin.ChangelogAddModelSectionPlugin"
version = "1.0.0"
}
}
}

dependencies {
implementation("com.squareup.moshi:moshi-kotlin:1.13.0")
implementation("com.squareup.moshi:moshi-kotlin:1.15.1")
}
Loading
Loading