Skip to content

Commit

Permalink
Update Gradle and redo publishing for hopefully the final time
Browse files Browse the repository at this point in the history
  • Loading branch information
DJtheRedstoner committed Nov 5, 2023
1 parent 1f4f988 commit 2eab0e3
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
package me.djtheredstoner.devauth.build

import groovy.util.Node
import groovy.util.NodeList
import org.gradle.api.Project
import org.gradle.api.component.AdhocComponentWithVariants
import org.gradle.api.file.DuplicatesStrategy
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.publish.tasks.GenerateModuleMetadata
import org.gradle.api.tasks.Copy
import org.gradle.authentication.http.BasicAuthentication
import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.create
import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.named
import org.gradle.kotlin.dsl.withType
import org.gradle.language.jvm.tasks.ProcessResources

fun Project.configureMcProject() {
Expand Down Expand Up @@ -51,9 +49,15 @@ fun Project.configureResources() {
}
}

// please spare me
// please spare me (update 2023-10-14: i was not in fact spared)
fun Project.configurePublishing() {
configure<PublishingExtension> {
if (project.name == "forge-legacy") {
(components["java"] as AdhocComponentWithVariants).withVariantsFromConfiguration(configurations["shadowRuntimeElements"]) {
skip()
}
}

publications.apply {
create("maven", MavenPublication::class.java).apply {
artifactId = "DevAuth-${project.name}"
Expand All @@ -78,14 +82,6 @@ fun Project.configurePublishing() {
}
}
}

afterEvaluate {
if (project.name == "forge-legacy") {
configurations.all {
artifacts.removeIf { it.classifier != "" && it.classifier != "sources" }
}
}
}
}

fun Project.fixRemap() {
Expand Down
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import org.gradle.jvm.tasks.Jar
plugins {
id("java-library")
id("build-logic")
id("gg.essential.loom") version "1.3.12" apply false
}

allprojects {
group = "me.djtheredstoner"
version = "1.1.2"
version = "1.2.0"

repositories {
mavenCentral()
Expand Down
4 changes: 2 additions & 2 deletions fabric/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import me.djtheredstoner.devauth.build.configureMcProject

plugins {
id("fabric-loom") version "1.1-SNAPSHOT"
id("gg.essential.loom")
id("io.github.juuxel.loom-quiltflower")
}

Expand All @@ -19,7 +19,7 @@ loom {
dependencies {
minecraft("com.mojang:minecraft:1.18.2")
mappings("net.fabricmc:yarn:1.18.2+build.2:v2")
modCompileOnly("net.fabricmc:fabric-loader:0.13.3")
modCompileOnly(localRuntime("net.fabricmc:fabric-loader:0.14.23")!!)

api(project(":common"))

Expand Down
2 changes: 1 addition & 1 deletion forge-latest/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import me.djtheredstoner.devauth.build.configureMcProject

plugins {
id("dev.architectury.loom") version "0.12.0-SNAPSHOT"
id("gg.essential.loom")
id("io.github.juuxel.loom-quiltflower")
}

Expand Down
6 changes: 3 additions & 3 deletions forge-legacy/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import dev.architectury.pack200.java.Pack200Adapter
import me.djtheredstoner.devauth.build.configureMcProject

plugins {
id("gg.essential.loom") version "0.10.0.4"
id("dev.architectury.architectury-pack200") version "0.1.3"
id("gg.essential.loom")
id("dev.architectury.architectury-pack200")
id("io.github.juuxel.loom-quiltflower")
id("com.github.johnrengelman.shadow")
}
Expand Down Expand Up @@ -49,7 +49,7 @@ tasks {
configurations = listOf(shade)
}
remapJar {
input.set(shadowJar.get().archiveFile)
inputFile.set(shadowJar.get().archiveFile)
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 2eab0e3

Please sign in to comment.