/* * Copyright 2019-2020 Mamoe Technologies and contributors. * * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证. * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link. * * https://github.com/mamoe/mirai/blob/master/LICENSE */ // 部分源码来自 kotlinx.coroutines // Source code from kotlinx.coroutines tasks.register("ensureBintrayAvailable") { doLast { if (!upload.Bintray.isBintrayAvailable(project)) { throw new IllegalStateException("bintray isn't available. ") } } } def vcs = "https://github.com/mamoe/mirai" def pomConfig = { licenses { license { name "AGPLv3 with Mamoe Exceptions" url "https://github.com/mamoe/mirai/blob/master/LICENSE" distribution "repo" } } developers { developer { id "mamoe" name "Mamoe Technologies" email "support@mamoe.net" } } scm { url vcs } } project.ext.configureMavenCentralMetadata = { pom -> def root = asNode() root.appendNode('name', project.name) root.appendNode('description', project.description) root.appendNode('url', vcs) root.children().last() + pomConfig } try { // empty xxx-javadoc.jar task javadocJar(type: Jar) { archiveClassifier = 'javadoc' } } catch (Exception ignored) { } try { task stubJavadoc(type: Jar) { archiveClassifier = 'javadoc' } } catch (Exception ignored) { } /** * Publish the platform JAR and POM so that consumers who depend on this module and can't read Gradle module * metadata can still get the platform artifact and transitive dependencies from the POM * (see details in https://youtrack.jetbrains.com/issue/KT-39184#focus=streamItem-27-4115233.0-0) */ project.ext.publishPlatformArtifactsInRootModule = { platformPublication -> afterEvaluate { def platformPomBuilder = null platformPublication.pom.withXml { platformPomBuilder = asString() } publishing.publications.kotlinMultiplatform { platformPublication.artifacts.forEach { artifact(it) } pom.withXml { def pomStringBuilder = asString() pomStringBuilder.setLength(0) // The platform POM needs its artifact ID replaced with the artifact ID of the root module: def platformPomString = platformPomBuilder.toString() platformPomString.eachLine { line -> if (!line.contains("