Skip to content

Commit

Permalink
Fix publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebemish committed Oct 26, 2023
1 parent 9ee149e commit 2ef031c
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 28 deletions.
12 changes: 1 addition & 11 deletions Common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ plugins {

apply plugin: 'org.quiltmc.loom'

base.archivesName = "${artifact_id}-common-${libs.versions.minecraft.get()}"

loom {
runConfigs.configureEach {
ideConfigGenerated = false
Expand All @@ -28,19 +26,11 @@ tasks.withType(AbstractRemapJarTask).each {
it.targetNamespace = "named"
}

processResources {
def buildProps = project.properties.clone()

filesMatching(['pack.mcmeta']) {

expand buildProps
}
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifactId base.archivesName.get()
}
}

Expand Down
11 changes: 6 additions & 5 deletions FabriQuilt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dependencies {
modLocalRuntime libs.quilt.loader
modLocalRuntime libs.qfapi

implementation project(":Common")
compileOnly project(":Common")

compileOnly libs.autoservice
annotationProcessor libs.autoservice
Expand Down Expand Up @@ -75,7 +75,7 @@ processResources {
from project(":Common").sourceSets.main.resources
}

tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
source(project(":Common").sourceSets.main.allSource)
}

Expand All @@ -99,6 +99,7 @@ publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifactId base.archivesName.get()
}
}

Expand All @@ -108,17 +109,17 @@ publishing {

// Publishing

import net.darkhax.curseforgegradle.TaskPublishCurseForge;
import net.darkhax.curseforgegradle.TaskPublishCurseForge

if (System.getenv('CURSEFORGE_KEY')) {
task curseforge(type: TaskPublishCurseForge) {
tasks.register('curseforge', TaskPublishCurseForge) {
disableVersionDetection()
apiToken = System.getenv('CURSEFORGE_KEY')
def projectId = '577096'
def mainFile = upload(projectId, tasks.remapJar)
mainFile.displayName = "Dynamic Asset Generator [Fabric/Quilt] v$project.version"
mainFile.releaseType = "${project.release_type}"
mainFile.addModLoader('Fabric','Quilt')
mainFile.addModLoader('Fabric', 'Quilt')
mainFile.addGameVersion("${libs.versions.minecraft.get()}")
mainFile.addRequirement("fabric-api")
mainFile.changelog = ''
Expand Down
9 changes: 4 additions & 5 deletions NeoForge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ plugins {
apply plugin: 'java'
apply plugin: 'maven-publish'

base.archivesName = "${artifact_id}-neoforge-${libs.versions.minecraft.get()}"

minecraft {
mappings channel: 'parchment', version: "${libs.versions.parchment.minecraft.get()}-${libs.versions.parchment.mappings.get()}-${libs.versions.minecraft.get()}"

Expand Down Expand Up @@ -64,7 +62,7 @@ mixin {
config 'mixin.dynamic_asset_generator.json'
}

tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
source(project(":Common").sourceSets.main.allSource)
}

Expand All @@ -88,6 +86,7 @@ publishing {
artifact jar
artifact sourcesJar
artifact javadocJar
artifactId base.archivesName.get()
}
}
repositories {
Expand All @@ -96,10 +95,10 @@ publishing {

// Publishing

import net.darkhax.curseforgegradle.TaskPublishCurseForge;
import net.darkhax.curseforgegradle.TaskPublishCurseForge

if (System.getenv('CURSEFORGE_KEY')) {
task curseforge(type: TaskPublishCurseForge) {
tasks.register('curseforge', TaskPublishCurseForge) {
disableVersionDetection()
apiToken = System.getenv('CURSEFORGE_KEY')
def projectId = '577096'
Expand Down
10 changes: 6 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ subprojects { p ->
apply plugin: 'java-library'
apply plugin: libs.plugins.quilt.licenser.get().pluginId

group = rootProject.group
version = rootProject.version
base.archivesName = "${rootProject.name}-${p.name.toLowerCase(Locale.ROOT)}-${libs.versions.minecraft.get()}"

java.toolchain.languageVersion = JavaLanguageVersion.of(17)
java.withSourcesJar()
java.withJavadocJar()
Expand Down Expand Up @@ -74,10 +78,8 @@ subprojects { p ->
it.options.release = 17
}

// Disables Gradle's custom module metadata from being published to maven. The
// metadata includes mapped dependencies which are not reasonably consumable by
// other mod developers.
tasks.withType(GenerateModuleMetadata) {
// Disables Gradle's custom module metadata from being published to maven. Ideally I'll be able to remove this soon-ish
tasks.withType(GenerateModuleMetadata).configureEach {
enabled = false
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ parchment_mappings = "2023.03.12"
neoforge = "1.20.1-47.1.75"
mixin = "0.8.4"

quilt_loader = "0.19.2"
quilt_loader = "0.21.1"
qfapi = "7.2.2+0.88.1-1.20.1"

mdg_plugin = "1.4.1"
Expand Down
2 changes: 0 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
pluginManagement {

repositories {

maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
Expand Down

0 comments on commit 2ef031c

Please sign in to comment.