mirror of
https://github.com/mamoe/mirai.git
synced 2025-04-17 09:09:23 +08:00
Remove bintray in mirai-console-gradle
This commit is contained in:
parent
f527aa9b40
commit
36159c39f4
mirai-console/tools/gradle-plugin
@ -39,7 +39,6 @@ dependencies {
|
||||
|
||||
api("com.github.jengelman.gradle.plugins:shadow:6.0.0")
|
||||
api(`jetbrains-annotations`)
|
||||
api("com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5")
|
||||
|
||||
|
||||
testApi(kotlin("test-junit5"))
|
||||
|
@ -1,10 +1,10 @@
|
||||
/*
|
||||
* Copyright 2019-2021 Mamoe Technologies and contributors.
|
||||
* Copyright 2019-2022 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.
|
||||
* 此源代码的使用受 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
|
||||
* https://github.com/mamoe/mirai/blob/dev/LICENSE
|
||||
*/
|
||||
|
||||
@file:Suppress("unused", "MemberVisibilityCanBePrivate")
|
||||
@ -12,8 +12,6 @@
|
||||
package net.mamoe.mirai.console.gradle
|
||||
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import com.jfrog.bintray.gradle.BintrayExtension
|
||||
import com.jfrog.bintray.gradle.BintrayPlugin
|
||||
import org.gradle.api.JavaVersion
|
||||
import org.gradle.api.XmlProvider
|
||||
import org.gradle.api.plugins.PluginContainer
|
||||
@ -280,28 +278,9 @@ public open class MiraiConsoleExtension {
|
||||
|
||||
// Custom configurations
|
||||
|
||||
internal val bintrayConfigs = mutableListOf<BintrayExtension.() -> Unit>()
|
||||
internal val bintrayPackageConfigConfigs = mutableListOf<BintrayExtension.PackageConfig.() -> Unit>()
|
||||
internal val mavenPomConfigs = mutableListOf<XmlProvider.() -> Unit>()
|
||||
internal val mavenPublicationConfigs = mutableListOf<MavenPublication.() -> Unit>()
|
||||
|
||||
/**
|
||||
* 自定义配置 [BintrayExtension],覆盖
|
||||
*/
|
||||
@Suppress("DeprecatedCallableAddReplaceWith")
|
||||
@Deprecated("不再支持发布到 bintray. 该配置会在 2.8 删除.", level = DeprecationLevel.ERROR)
|
||||
public fun bintray(configure: BintrayExtension.() -> Unit) {
|
||||
bintrayConfigs.add(configure)
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义配置 [BintrayExtension.PackageConfig]
|
||||
*/
|
||||
@Suppress("DeprecatedCallableAddReplaceWith")
|
||||
@Deprecated("不再支持发布到 bintray. 该配置会在 2.8 删除.", level = DeprecationLevel.ERROR)
|
||||
public fun packageConfig(configure: BintrayExtension.PackageConfig.() -> Unit) {
|
||||
bintrayPackageConfigConfigs.add(configure)
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义配置 maven pom.xml [XmlProvider]
|
||||
|
@ -13,7 +13,6 @@
|
||||
package net.mamoe.mirai.console.gradle
|
||||
|
||||
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
|
||||
import com.jfrog.bintray.gradle.BintrayPlugin
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.Task
|
||||
@ -258,7 +257,6 @@ public class MiraiConsoleGradlePlugin : Plugin<Project> {
|
||||
plugins.apply("org.gradle.maven-publish")
|
||||
// plugins.apply("org.gradle.maven")
|
||||
plugins.apply(ShadowPlugin::class.java)
|
||||
plugins.apply(BintrayPlugin::class.java)
|
||||
|
||||
project.setupConfigurations()
|
||||
|
||||
|
@ -10,7 +10,6 @@
|
||||
package net.mamoe.mirai.console.gradle
|
||||
|
||||
import com.google.gson.Gson
|
||||
import com.jfrog.bintray.gradle.tasks.BintrayUploadTask
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.Task
|
||||
import org.gradle.api.artifacts.Configuration
|
||||
@ -136,16 +135,16 @@ private fun Project.registerPublishPluginTasks(target: KotlinTarget, isSingleTar
|
||||
Unit
|
||||
}
|
||||
|
||||
val bintrayUpload = tasks.getByName(BintrayUploadTask.getTASK_NAME()).dependsOn(
|
||||
"buildPlugin".wrapNameWithPlatform(target, isSingleTarget),
|
||||
generateMetadataTask,
|
||||
// "shadowJar",
|
||||
tasks.filterIsInstance<BuildMiraiPluginTask>().single { it.target == target }
|
||||
)
|
||||
tasks.register("publishPlugin".wrapNameWithPlatform(target, isSingleTarget)).get().apply {
|
||||
group = "mirai"
|
||||
dependsOn(bintrayUpload)
|
||||
}
|
||||
// val bintrayUpload = tasks.getByName(BintrayUploadTask.getTASK_NAME()).dependsOn(
|
||||
// "buildPlugin".wrapNameWithPlatform(target, isSingleTarget),
|
||||
// generateMetadataTask,
|
||||
// // "shadowJar",
|
||||
// tasks.filterIsInstance<BuildMiraiPluginTask>().single { it.target == target }
|
||||
// )
|
||||
// tasks.register("publishPlugin".wrapNameWithPlatform(target, isSingleTarget)).get().apply {
|
||||
// group = "mirai"
|
||||
// dependsOn(bintrayUpload)
|
||||
// }
|
||||
}
|
||||
|
||||
internal inline fun File.renamed(block: File.(nameWithoutExtension: String) -> String): File =
|
||||
@ -154,33 +153,33 @@ internal inline fun File.renamed(block: File.(nameWithoutExtension: String) -> S
|
||||
private fun Project.registerBintrayPublish() {
|
||||
val mirai = miraiExtension
|
||||
|
||||
bintray {
|
||||
user = mirai.publishing.user ?: findPropertySmartOrFail("bintray.user")
|
||||
key = mirai.publishing.key ?: findPropertySmartOrFail("bintray.key")
|
||||
|
||||
val targets = kotlinJvmOrAndroidTargets
|
||||
if (targets.size == 1) {
|
||||
setPublications("mavenJava")
|
||||
} else {
|
||||
setPublications(*targets.map { "mavenJava".wrapNameWithPlatform(it, false) }.toTypedArray())
|
||||
}
|
||||
|
||||
setConfigurations("archives")
|
||||
|
||||
publish = mirai.publishing.publish
|
||||
override = mirai.publishing.override
|
||||
|
||||
pkg.apply {
|
||||
repo = mirai.publishing.repo ?: findPropertySmartOrFail("bintray.repo")
|
||||
name = mirai.publishing.packageName ?: findPropertySmartOrFail("bintray.package")
|
||||
userOrg = mirai.publishing.org ?: findPropertySmart("bintray.org")
|
||||
desc = mirai.publishing.description ?: project.description
|
||||
|
||||
mirai.publishing.bintrayPackageConfigConfigs.forEach { it.invoke(this) }
|
||||
}
|
||||
|
||||
mirai.publishing.bintrayConfigs.forEach { it.invoke(this) }
|
||||
}
|
||||
// bintray {
|
||||
// user = mirai.publishing.user ?: findPropertySmartOrFail("bintray.user")
|
||||
// key = mirai.publishing.key ?: findPropertySmartOrFail("bintray.key")
|
||||
//
|
||||
// val targets = kotlinJvmOrAndroidTargets
|
||||
// if (targets.size == 1) {
|
||||
// setPublications("mavenJava")
|
||||
// } else {
|
||||
// setPublications(*targets.map { "mavenJava".wrapNameWithPlatform(it, false) }.toTypedArray())
|
||||
// }
|
||||
//
|
||||
// setConfigurations("archives")
|
||||
//
|
||||
// publish = mirai.publishing.publish
|
||||
// override = mirai.publishing.override
|
||||
//
|
||||
// pkg.apply {
|
||||
// repo = mirai.publishing.repo ?: findPropertySmartOrFail("bintray.repo")
|
||||
// name = mirai.publishing.packageName ?: findPropertySmartOrFail("bintray.package")
|
||||
// userOrg = mirai.publishing.org ?: findPropertySmart("bintray.org")
|
||||
// desc = mirai.publishing.description ?: project.description
|
||||
//
|
||||
// mirai.publishing.bintrayPackageConfigConfigs.forEach { it.invoke(this) }
|
||||
// }
|
||||
//
|
||||
// mirai.publishing.bintrayConfigs.forEach { it.invoke(this) }
|
||||
// }
|
||||
}
|
||||
|
||||
private fun Project.registerMavenPublications(target: KotlinTarget, isSingleTarget: Boolean) {
|
||||
@ -242,12 +241,6 @@ private fun Project.registerMavenPublications(target: KotlinTarget, isSingleTarg
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Configures the [bintray][com.jfrog.bintray.gradle.BintrayExtension] extension.
|
||||
*/
|
||||
@PublishedApi
|
||||
internal fun Project.bintray(configure: com.jfrog.bintray.gradle.BintrayExtension.() -> Unit): Unit =
|
||||
(this as org.gradle.api.plugins.ExtensionAware).extensions.configure("bintray", configure)
|
||||
|
||||
@PublishedApi
|
||||
internal val Project.sourceSets: org.gradle.api.tasks.SourceSetContainer
|
||||
|
Loading…
Reference in New Issue
Block a user