mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-14 20:50:09 +08:00
Add version info in META-INF/MANIFEST.MF
(#1355)
This commit is contained in:
parent
8a1154a0d7
commit
28c2309fbb
@ -101,6 +101,7 @@ allprojects {
|
||||
if (isKotlinJvmProject) {
|
||||
configureFlattenSourceSets()
|
||||
}
|
||||
configureJarManifest()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@ import org.gradle.api.Project
|
||||
import org.gradle.api.plugins.JavaPluginExtension
|
||||
import org.gradle.api.tasks.compile.JavaCompile
|
||||
import org.gradle.api.tasks.testing.Test
|
||||
import org.gradle.api.tasks.bundling.Jar
|
||||
import org.gradle.kotlin.dsl.*
|
||||
import org.jetbrains.kotlin.gradle.dsl.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
|
||||
@ -182,6 +183,18 @@ fun Project.configureFlattenSourceSets() {
|
||||
}
|
||||
}
|
||||
|
||||
fun Project.configureJarManifest() {
|
||||
this.tasks.withType<Jar> {
|
||||
manifest {
|
||||
attributes(
|
||||
"Implementation-Vendor" to "Mamoe Technologies",
|
||||
"Implementation-Title" to this@configureJarManifest.name.toString(),
|
||||
"Implementation-Version" to this@configureJarManifest.version.toString()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline fun <reified T> Any?.safeAs(): T? {
|
||||
return this as? T
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user