Skip to content

Commit 95e6da1

Browse files
committed
build: Don't add version info to the JAR manifest
1 parent 34f8106 commit 95e6da1

File tree

2 files changed

+13
-31
lines changed

2 files changed

+13
-31
lines changed

buildSrc/build.gradle.kts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import org.gradle.api.internal.artifacts.DefaultModuleIdentifier
2+
import org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency
3+
import org.gradle.api.internal.artifacts.dependencies.DefaultMutableVersionConstraint
4+
15
plugins {
26
`kotlin-dsl`
37
}
@@ -9,4 +13,13 @@ repositories {
913

1014
dependencies {
1115
implementation(libs.kotlinx.serialization.json)
16+
implementation(libs.plugins.paperweight.patcher.asModuleDependency())
17+
}
18+
19+
private fun Provider<PluginDependency>.asModuleDependency() = this.map {
20+
DefaultExternalModuleDependency(
21+
DefaultModuleIdentifier.newId(it.pluginId, "${it.pluginId}.gradle.plugin"),
22+
DefaultMutableVersionConstraint(it.version),
23+
null,
24+
)
1225
}
Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
import io.papermc.paperweight.util.Git
2-
import io.papermc.paperweight.util.path
3-
41
plugins {
52
alias(libs.plugins.kotlin.jvm)
6-
7-
// for version info in the jar manifest
8-
alias(libs.plugins.paperweight.patcher) apply false
93
}
104

115
group = providers.gradleProperty("group").get()
@@ -28,28 +22,3 @@ tasks.test {
2822
kotlin {
2923
jvmToolchain(21)
3024
}
31-
32-
tasks.jar {
33-
manifest {
34-
val git = Git(rootProject.layout.projectDirectory.path)
35-
val gitCommit = git.exec(providers, "rev-parse", "--short=7", "HEAD").get().trim()
36-
val gitTimestamp = git.exec(providers, "show", "-s", "--format=%cI", gitCommit).get().trim()
37-
val gitBranch = git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim()
38-
attributes(
39-
"Implementation-Title" to project.name,
40-
"Implementation-Version" to project.version,
41-
"Implementation-Vendor" to "ElectroPlay Development Team",
42-
"Specification-Title" to "proxycheck.io",
43-
"Specification-Version" to "v3",
44-
"Specification-Vendor" to "https://proxycheck.io/api/",
45-
"Git-Branch" to gitBranch,
46-
"Git-Commit" to gitCommit,
47-
"Git-Timestamp" to gitTimestamp,
48-
"Implementation-SCM-Branch" to gitBranch,
49-
"Implementation-SCM-Revision" to gitCommit,
50-
"Implementation-SCM-Timestamp" to gitTimestamp,
51-
"Contact-Website" to "https://epserv.ru/",
52-
"Contact-Email" to "admin@epserv.ru",
53-
)
54-
}
55-
}

0 commit comments

Comments
 (0)