mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 18:40:15 +08:00
Include all configuration when generating metadata
This commit is contained in:
parent
eb7b4b8eb9
commit
22f22bf65c
@ -13,6 +13,7 @@ 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
|
||||
import org.gradle.api.publish.maven.MavenPublication
|
||||
import org.gradle.api.tasks.TaskContainer
|
||||
import org.gradle.api.tasks.bundling.Jar
|
||||
@ -98,10 +99,15 @@ private fun Project.registerPublishPluginTasks(target: KotlinTarget, isSingleTar
|
||||
val output = outputs.files.singleFile
|
||||
output.parentFile.mkdir()
|
||||
|
||||
val dependencies = configurations[target.compilations["main"].apiConfigurationName].allDependencies.map {
|
||||
"${it.group}:${it.name}:${it.version}"
|
||||
fun getConfigurationsToInclude(): List<Configuration> {
|
||||
val compilation = target.compilations["main"]
|
||||
return compilation.relatedConfigurationNames.map { configurations[it] }
|
||||
}
|
||||
|
||||
val dependencies = getConfigurationsToInclude().flatMap { it.allDependencies }.map {
|
||||
"${it.group}:${it.name}:${it.version}"
|
||||
}.distinct()
|
||||
|
||||
val json = Gson().toJson(PluginMetadata(
|
||||
groupId = mirai.publishing.groupId ?: project.group.toString(),
|
||||
artifactId = mirai.publishing.artifactId ?: project.name,
|
||||
@ -114,6 +120,8 @@ private fun Project.registerPublishPluginTasks(target: KotlinTarget, isSingleTar
|
||||
|
||||
output.writeText(json)
|
||||
}
|
||||
|
||||
Unit
|
||||
}
|
||||
|
||||
val bintrayUpload = tasks.getByName(BintrayUploadTask.getTASK_NAME()).dependsOn(
|
||||
|
Loading…
Reference in New Issue
Block a user