Skip to content

Commit

Permalink
fix: fixed up build.gradle, commented out CF publishing for now
Browse files Browse the repository at this point in the history
  • Loading branch information
desht committed Nov 23, 2023
1 parent 1e88d0c commit 2d71bce
Showing 1 changed file with 64 additions and 75 deletions.
139 changes: 64 additions & 75 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,11 @@ architectury {
minecraft = rootProject.minecraft_version
}

subprojects {
apply plugin: "dev.architectury.loom"

loom {
silentMojangMappingsLicense()
}

dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
// The following line declares the mojmap mappings, you may use other mappings as well
mappings loom.officialMojangMappings()
// The following line declares the yarn mappings you may select this one as well.
// mappings "net.fabricmc:yarn:1.20.1+build.10:v2"
}
}

allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"
apply from: "https://raw.githubusercontent.com/FTBTeam/mods-meta/main/gradle/git-md-changelog.gradle"

base {
archivesName = rootProject.archives_base_name
Expand Down Expand Up @@ -69,7 +54,10 @@ subprojects {

dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
// The following line declares the mojmap mappings, you may use other mappings as well
mappings loom.officialMojangMappings()
// The following line declares the yarn mappings you may select this one as well.
// mappings "net.fabricmc:yarn:1.20.1+build.10:v2"
}

publishing {
Expand Down Expand Up @@ -97,63 +85,64 @@ subprojects {
}
}

// TODO: Move this to a common location?
Closure<ReleaseType> releaseTypeToPublishType = { type ->
switch(type) {
case "release": return ReleaseType.STABLE
case "beta": return ReleaseType.BETA
case "alpha": return ReleaseType.ALPHA
default: return ReleaseType.STABLE
}
}

publishMods {
dryRun = providers.environmentVariable("CURSEFORGE_TOKEN").getOrNull() == null
changelog = providers.environmentVariable("CHANGELOG").orElse("")
version = mod_version
type = releaseTypeToPublishType(ftbPublishing.relType)

def curseOptions = curseforgeOptions {
accessToken = providers.environmentVariable("CURSEFORGE_TOKEN")
projectId = project.curseforge_id
minecraftVersions.add(rootProject.minecraft_version)

requires {
slug = 'architectury-api'
}
}

curseforge("forge") {
from curseOptions
modLoaders.add("neoforge")
modLoaders.add("forge")
file = project(":forge").tasks.remapJar.archiveFile

requires {
slug = 'ftb-library-forge'
slug = 'architectury-api'
}
}

curseforge("fabric") {
from curseOptions

file = project(":fabric").tasks.remapJar.archiveFile
modLoaders.add("fabric")

requires {
slug = "fabric-api"
slug = 'ftb-library-fabric'
}
}

github {
repository = "ftbteam/ftb-economy"
accessToken = providers.environmentVariable("GITHUB_TOKEN")
commitish = providers.environmentVariable("GITHUB_SHA").orElse("dryRun")
tagName = providers.environmentVariable("GITHUB_REF_NAME").orElse("dryRun")

// Gradle doesn't like accessing the buildApi task directly so we need to use the provider
file = project.provider { project(":common").tasks.buildApi }.flatMap { it.archiveFile }
}
}
//// TODO: Move this to a common location?
//Closure<ReleaseType> releaseTypeToPublishType = { type ->
// switch(type) {
// case "release": return ReleaseType.STABLE
// case "beta": return ReleaseType.BETA
// case "alpha": return ReleaseType.ALPHA
// default: return ReleaseType.STABLE
// }
//}

//publishMods {
// dryRun = providers.environmentVariable("CURSEFORGE_TOKEN").getOrNull() == null
// changelog = providers.environmentVariable("CHANGELOG").orElse("")
// version = mod_version
// type = releaseTypeToPublishType(ftbPublishing.relType)
//
// def curseOptions = curseforgeOptions {
// accessToken = providers.environmentVariable("CURSEFORGE_TOKEN")
// projectId = project.curseforge_id
// minecraftVersions.add(rootProject.minecraft_version)
//
// requires {
// slug = 'architectury-api'
// }
// }
//
// curseforge("forge") {
// from curseOptions
// modLoaders.add("neoforge")
// modLoaders.add("forge")
// file = project(":forge").tasks.remapJar.archiveFile
//
// requires {
// slug = 'ftb-library-forge'
// slug = 'architectury-api'
// }
// }
//
// curseforge("fabric") {
// from curseOptions
//
// file = project(":fabric").tasks.remapJar.archiveFile
// modLoaders.add("fabric")
//
// requires {
// slug = "fabric-api"
// slug = 'ftb-library-fabric'
// }
// }
//
// github {
// repository = "ftbteam/ftb-economy"
// accessToken = providers.environmentVariable("GITHUB_TOKEN")
// commitish = providers.environmentVariable("GITHUB_SHA").orElse("dryRun")
// tagName = providers.environmentVariable("GITHUB_REF_NAME").orElse("dryRun")
//
// // Gradle doesn't like accessing the buildApi task directly so we need to use the provider
// file = project.provider { project(":common").tasks.buildApi }.flatMap { it.archiveFile }
// }
//}

0 comments on commit 2d71bce

Please sign in to comment.