Compare commits

..

1 commit

150 changed files with 34 additions and 36 deletions

View file

@ -35,7 +35,7 @@ fun ShadowJar.configureStandard() {
val sourcesJar by tasks.existing(AbstractArchiveTask::class) {
from(
zipTree(project(":nugget-lib").tasks
zipTree(project(":paperweight-lib").tasks
.named("sourcesJar", AbstractArchiveTask::class)
.flatMap { it.archiveFile })
) {
@ -43,15 +43,15 @@ val sourcesJar by tasks.existing(AbstractArchiveTask::class) {
}
}
val prefix = project.name.substringAfter("nugget-")
val prefix = project.name.substringAfter("paperweight-")
gradlePlugin {
website.set("https://git.zontreck.com/ObsidianMC/nugget")
vcsUrl.set("https://git.zontreck.com/ObsidianMC/nugget")
plugins.create("nugget-$prefix") {
website.set("https://github.com/PaperMC/paperweight")
vcsUrl.set("https://github.com/PaperMC/paperweight")
plugins.create("paperweight-$prefix") {
id = "io.papermc.paperweight." + prefix
displayName = "nugget $prefix"
tags.set(listOf("obsidian", "minecraft"))
displayName = "paperweight $prefix"
tags.set(listOf("paper", "minecraft"))
}
}
@ -64,7 +64,7 @@ val shadowJar by tasks.existing(ShadowJar::class) {
return@existing
}
val prefix = "obsidian.libs"
val prefix = "paper.libs"
listOf(
"com.github.salomonbrys.kotson",
"com.google.errorprone.annotations",
@ -91,21 +91,11 @@ val shadowJar by tasks.existing(ShadowJar::class) {
}
}
val MAVEN_PASSWORD = "AriasCreationsMavenPassword"
val MAVEN_USER = "AriasCreationsMavenUser"
publishing {
repositories {
maven {
url = uri("https://git.zontreck.com/api/packages/ObsidianMC/maven")
name = "obsidian"
credentials {
username = project.findProperty(MAVEN_USER)?.toString()
password = project.findProperty(MAVEN_PASSWORD)?.toString()
}
maven("https://repo.papermc.io/repository/maven-snapshots/") {
credentials(PasswordCredentials::class)
name = "paper"
}
}
@ -119,11 +109,11 @@ publishing {
}
fun MavenPom.pomConfig() {
val repoPath = "ObsidianMC/nugget"
val repoUrl = "https://git.zontreck.com/$repoPath"
val repoPath = "PaperMC/paperweight"
val repoUrl = "https://github.com/$repoPath"
name.set("nugget")
description.set("Gradle plugin for the ObsidianMC project")
name.set("paperweight")
description.set("Gradle plugin for the PaperMC project")
url.set(repoUrl)
inceptionYear.set("2020")

View file

@ -1,4 +1,4 @@
group = com.zontreck.nugget
group = io.papermc.paperweight
version = 1.7.4-SNAPSHOT
org.gradle.caching = true

View file

@ -4,7 +4,7 @@ plugins {
}
dependencies {
shade(projects.nuggetLib)
shade(projects.paperweightLib)
implementation(libs.bundles.kotson)
}

View file

@ -49,7 +49,7 @@ class PaperweightCore : Plugin<Project> {
override fun apply(target: Project) {
checkJavaVersion()
Git.checkForGit()
printId<PaperweightCore>("nugget-core", target.gradle)
printId<PaperweightCore>("paperweight-core", target.gradle)
val ext = target.extensions.create(PAPERWEIGHT_EXTENSION, PaperweightCoreExtension::class, target)
@ -70,7 +70,7 @@ class PaperweightCore : Plugin<Project> {
target.configurations.create(DECOMPILER_CONFIG)
target.configurations.create(PAPERCLIP_CONFIG)
if (target.providers.gradleProperty("nugget.dev").orNull == "true") {
if (target.providers.gradleProperty("paperweight.dev").orNull == "true") {
target.tasks.register<CreateDiffOutput>("diff") {
inputDir.convention(ext.paper.paperServerDir.map { it.dir("src/main/java") })
val prop = target.providers.gradleProperty("paperweight.diff.output")

View file

@ -200,9 +200,14 @@ abstract class CreateBundlerJar : ZippedTask() {
return when (val ident = id.componentIdentifier) {
is ModuleComponentIdentifier -> ModuleId.fromIdentifier(id)
is ProjectComponentIdentifier -> {
val capability = variant.capabilities.first()
val version = capability.version ?: throw PaperweightException("Unknown version for ${capability.group}:${capability.name}")
ModuleId(capability.group, capability.name, version)
val mainCap = variant.attributes.getAttribute(mainCapabilityAttribute)
if (mainCap != null) {
ModuleId.parse(mainCap)
} else {
val capability = variant.capabilities.first()
val version = capability.version ?: throw PaperweightException("Unknown version for ${capability.group}:${capability.name}")
ModuleId(capability.group, capability.name, version)
}
}
else -> throw PaperweightException("Unknown artifact result type: ${ident::class.java.name}")
}

Some files were not shown because too many files have changed in this diff Show more