Skip to content

Commit

Permalink
✨ feature(loader): add an apiJar task, add manifest attributes for …
Browse files Browse the repository at this point in the history
…packages spec/impl

Signed-off-by: xtrm <[email protected]>
  • Loading branch information
xtrm-en committed Aug 3, 2024
1 parent 28dfc58 commit e100055
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build-logic/src/main/kotlin/config-publish.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
publishing {
repositories {
maven {
name = "WeaveMC"
name = "WeaveReleases"
url = uri("https://repo.weavemc.dev/releases")
credentials(PasswordCredentials::class)
authentication {
Expand Down
51 changes: 43 additions & 8 deletions loader/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,55 @@ dependencies {
}
}

tasks {
jar {
manifest.attributes(
"Premain-Class" to "net.weavemc.loader.impl.bootstrap.AgentKt",
"Main-Class" to "net.weavemc.loader.impl.bootstrap.AgentKt",
"Can-Retransform-Classes" to "true",
)
}
tasks.jar {
exclude("net/weavemc/loader/api/**")
manifest.attributes(
"Premain-Class" to "net.weavemc.loader.impl.bootstrap.AgentKt",
"Main-Class" to "net.weavemc.loader.impl.bootstrap.AgentKt",
"Can-Retransform-Classes" to "true",

"Automatic-Module-Name" to "net.weavemc.loader",
)

manifest.attributes(
mapOf(
"Specification-Title" to "Weave Loader",
"Specification-Version" to "0", // we're still in beta so this is 0
"Specification-Vendor" to "WeaveMC",
"Implementation-Title" to "Weave Loader",
"Implementation-Version" to project.version,
"Implementation-Vendor" to "WeaveMC",
), "net.weavemc.loader"
)
}

val apiJar by tasks.creating(Jar::class) {
archiveClassifier.set("api")
from(sourceSets.main.get().output)
include("net/weavemc/loader/api/**")

manifest.attributes(
mapOf(
"Specification-Title" to "Weave Loader API",
"Specification-Version" to "0",
"Specification-Vendor" to "WeaveMC",
"Implementation-Title" to "Weave Loader API",
"Implementation-Version" to project.version,
"Implementation-Vendor" to "WeaveMC",
), "net.weavemc.loader.api"
)
}

artifacts {
archives(apiJar)
}

publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
artifact(apiJar)

groupId = "net.weavemc"
artifactId = "loader"
version = "${project.version}"
Expand Down

0 comments on commit e100055

Please sign in to comment.