Skip to content

Commit

Permalink
Merge pull request #306 from KyoriPowered/feature/manifest-meta
Browse files Browse the repository at this point in the history
  • Loading branch information
zml2008 authored Mar 8, 2021
2 parents 82ee18b + 4faba74 commit 68b7e13
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 50 deletions.
6 changes: 1 addition & 5 deletions api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,4 @@ dependencies {
testImplementation("com.google.guava:guava:23.0")
}

jar {
manifest.attributes(
"Automatic-Module-Name": "net.kyori.adventure"
)
}
applyJarMetadata(this, "net.kyori.adventure")
1 change: 1 addition & 0 deletions bom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies {
constraints {
[
"api",
"extra-kotlin",
"key",
"nbt",
"serializer-configurate3",
Expand Down
19 changes: 19 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,25 @@ group "net.kyori"
version "4.7.0-SNAPSHOT"
description "A user-interface library for Minecraft: Java Edition."

def applyJarMetadata(project, moduleName) {
if("jar" in project.tasks.names) {
project.tasks.named("jar", Jar).configure {
manifest.attributes(
"Automatic-Module-Name": moduleName,
"Specification-Title": moduleName,
"Specification-Version": project.version,
"Specification-Vendor": "KyoriPowered"
)
if(project.grgit) {
manifest.attributes(
"Git-Commit": project.grgit.head().id,
"Git-Branch": project.grgit.branch.current().name
)
}
}
}
}

subprojects {
// The bom is special... this is a bit ugly, but not much more we can do without making our own script plugin
if(name != "adventure-bom") {
Expand Down
6 changes: 1 addition & 5 deletions extra-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,4 @@ dependencies {
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
}

jar {
manifest.attributes(
"Automatic-Module-Name": "net.kyori.adventure.extra.kotlin"
)
}
applyJarMetadata(this, "net.kyori.adventure.extra.kotlin")
6 changes: 1 addition & 5 deletions key/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,4 @@ dependencies {
testImplementation("com.google.guava:guava:23.0")
}

jar {
manifest.attributes(
"Automatic-Module-Name": "net.kyori.adventure.key"
)
}
applyJarMetadata(this, "net.kyori.adventure.key")
6 changes: 1 addition & 5 deletions nbt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@ dependencies {
compileOnlyApi("org.jetbrains:annotations:20.1.0")
}

jar {
manifest.attributes(
"Automatic-Module-Name": "net.kyori.adventure.nbt"
)
}
applyJarMetadata(this, "net.kyori.adventure.nbt")
6 changes: 1 addition & 5 deletions serializer-configurate3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ dependencies {
testImplementation(project(":adventure-text-serializer-gson"))
}

jar {
manifest.attributes(
"Automatic-Module-Name": "net.kyori.adventure.serializer.configurate3"
)
}
applyJarMetadata(this, "net.kyori.adventure.serializer.configurate3")
6 changes: 1 addition & 5 deletions serializer-configurate4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ dependencies {
testImplementation(project(":adventure-text-serializer-gson"))
}

jar {
manifest.attributes(
"Automatic-Module-Name": "net.kyori.adventure.serializer.configurate4"
)
}
applyJarMetadata(this, "net.kyori.adventure.serializer.configurate4")
6 changes: 1 addition & 5 deletions text-serializer-gson-legacy-impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ dependencies {
api(project(":adventure-nbt"))
}

jar {
manifest.attributes(
"Automatic-Module-Name": "net.kyori.adventure.text.serializer.gson.legacyimpl"
)
}
applyJarMetadata(this, "net.kyori.adventure.text.serializer.gson.legacyimpl")
6 changes: 1 addition & 5 deletions text-serializer-gson/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ dependencies {
testImplementation(project(":adventure-nbt"))
}

jar {
manifest.attributes(
"Automatic-Module-Name": "net.kyori.adventure.text.serializer.gson"
)
}
applyJarMetadata(this, "net.kyori.adventure.text.serializer.gson")
6 changes: 1 addition & 5 deletions text-serializer-legacy/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,4 @@ dependencies {
api(project(":adventure-api"))
}

jar {
manifest.attributes(
"Automatic-Module-Name": "net.kyori.adventure.text.serializer.legacy"
)
}
applyJarMetadata(this, "net.kyori.adventure.text.serializer.legacy")
6 changes: 1 addition & 5 deletions text-serializer-plain/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,4 @@ dependencies {
api(project(":adventure-api"))
}

jar {
manifest.attributes(
"Automatic-Module-Name": "net.kyori.adventure.text.serializer.plain"
)
}
applyJarMetadata(this, "net.kyori.adventure.text.serializer.plain")

0 comments on commit 68b7e13

Please sign in to comment.