1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2026-07-01 15:45:31 +00:00
Files
tgbotapi/build.gradle
InsanusMokrassar 0e9f9111eb Update dependencies and migrate to Gradle 9 / Dokka v2
Dependency bumps: Kotlin 2.3.20->2.3.21, Coroutines 1.10.2->1.11.0,
Ktor 3.4.2->3.5.1, KSP 2.3.6->2.3.9, MicroUtils 0.29.2->0.30.0,
Dokka 2.0.0->2.2.0, Versions plugin 0.53.0->0.54.0, NMCP 1.4.4->1.6.0.

Gradle wrapper 8.13->9.6.1 with build-script fixes for Gradle 9:
Project.exec() -> providers.exec(), tasks.whenTaskAdded -> tasks.configureEach.

Dokka migrated to the Dokka Gradle Plugin v2. The docs module is now
included as the KDocs aggregator (dokka {} DSL with sourceRoots, new URI,
ProcessIsolation heap for the generator worker), excluded from binary
compatibility validation, and the kdocs workflow runs :docs:dokkaGenerate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 17:54:13 +06:00

92 lines
3.0 KiB
Groovy

buildscript {
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
mavenLocal()
}
dependencies {
classpath libs.kotlin.gradle.plugin
classpath libs.kotlin.ksp.plugin
classpath libs.kotlin.serialization.plugin
classpath libs.kotlin.dokka.plugin
classpath libs.github.release.plugin
}
}
plugins {
alias(libs.plugins.kotlin.dokka)
alias(libs.plugins.versions)
alias(libs.plugins.validator)
alias(libs.plugins.nmcp.aggregation)
}
// docs is a dokka-only aggregator module, exclude it from binary compatibility validation
apiValidation {
ignoredProjects += ["docs"]
}
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
nmcpAggregation {
centralPortal {
username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER')
password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD')
validationTimeout = Duration.ofSeconds(0)
publishingType = System.getenv('PUBLISHING_TYPE') != "" ? System.getenv('PUBLISHING_TYPE') : "USER_MANAGED"
}
publishAllProjectsProbablyBreakingProjectIsolation()
}
}
// temporal crutch until legacy tests will be stabled or legacy target will be removed
allprojects {
repositories {
mavenCentral()
google()
maven { url "https://nexus.inmo.dev/repository/maven-releases/" }
mavenLocal()
}
if (it != rootProject.findProject("docs")) {
tasks.configureEach { task ->
if(task.name == "jsLegacyBrowserTest" || task.name == "jsLegacyNodeTest") {
task.enabled = false
}
}
}
}
apply from: "./extensions.gradle"
private String getCurrentVersionChangelog() {
return providers.exec {
commandLine './changelog_info_retriever', "$library_version", 'CHANGELOG.md'
}.standardOutput.asText.get().trim()
}
def githubTokenVariableName = "GITHUB_RELEASE_TOKEN"
def githubTokenVariableFromEnv = System.getenv(githubTokenVariableName)
def secretFile = new File(projectDir, "secret.gradle")
if (secretFile.exists() || project.hasProperty(githubTokenVariableName) || (githubTokenVariableFromEnv != "" && githubTokenVariableFromEnv != null)) {
if (secretFile.exists()) {
apply from: './secret.gradle'
}
apply plugin: "com.github.breadmoirai.github-release"
def githubReleaseToken = project.hasProperty(githubTokenVariableName) ? project.property(githubTokenVariableName).toString() : githubTokenVariableFromEnv
githubRelease {
token githubReleaseToken
owner = "InsanusMokrassar"
repo = "TelegramBotAPI"
tagName = "v$library_version"
releaseName = "$library_version"
targetCommitish = "$library_version"
body = getCurrentVersionChangelog()
}
}