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) } 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 = "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.whenTaskAdded { task -> if(task.name == "jsLegacyBrowserTest" || task.name == "jsLegacyNodeTest") { task.enabled = false } } } } apply from: "./extensions.gradle" private String getCurrentVersionChangelog() { OutputStream changelogDataOS = new ByteArrayOutputStream() exec { standardOutput = changelogDataOS commandLine './changelog_info_retriever', "$library_version", 'CHANGELOG.md' } return changelogDataOS.toString().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() } }