Skip to content

Commit

Permalink
Updated build scripts to match current dev branch
Browse files Browse the repository at this point in the history
  • Loading branch information
lanAnderson committed Sep 26, 2024
1 parent 07a237a commit 1a5f292
Show file tree
Hide file tree
Showing 7 changed files with 222 additions and 94 deletions.
25 changes: 25 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 34 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'dev.architectury.loom' version '1.7-SNAPSHOT' apply false
id 'architectury-plugin' version '3.4-SNAPSHOT'
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
id 'net.darkhax.curseforgegradle' version '1.1.18'
id 'net.darkhax.curseforgegradle' version '1.1.25'
id 'com.modrinth.minotaur' version '2.+'
}

Expand All @@ -27,13 +27,18 @@ subprojects {

repositories {
mavenCentral()
maven { url = "https://api.modrinth.com/maven" } // LazyDFU
maven { url 'https://modmaven.dev/' } //Mekanism
maven { url = "https://maven.shedaniel.me/" } // Cloth Config, REI
maven { url = "https://maven.terraformersmc.com/releases/" } // Mod Menu
maven { url = "https://maven.blamejared.com/" } // JEI
maven { url = "https://maven.parchmentmc.org" } // Parchment mappings
maven { url = "https://maven.quiltmc.org/repository/release" } // Quilt Mappings
maven { url = 'https://maven.ladysnake.org/releases' } // Cardinal Components
maven { url = "https://maven.theillusivec4.top/" } //Curios
maven { url = "https://maven.ladysnake.org/releases" } // Cardinal Components
maven { url = "https://jm.gserv.me/repository/maven-public/" } //Journeymap API for Fabric
maven { url 'https://maven.wispforest.io/releases' } //Accessories
maven { url 'https://maven.su5ed.dev/releases' } //Accessories
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" }
exclusiveContent {
forRepository {
maven { url = "https://cursemaven.com" }
Expand All @@ -42,6 +47,14 @@ subprojects {
includeGroup "curse.maven"
}
}
exclusiveContent {
forRepository {
maven { url = "https://api.modrinth.com/maven" }
}
filter {
includeGroup "maven.modrinth"
}
}
}

loom {
Expand All @@ -51,18 +64,12 @@ subprojects {
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.officialMojangMappings()
// mappings(loom.layered {
// officialMojangMappings()
// parchment("org.parchmentmc.data:parchment-${project.minecraft_version}:${project.parchment_version}@zip")
// })
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
//withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
Expand All @@ -71,6 +78,24 @@ subprojects {
it.options.release = 17
}

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

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}

processResources {
def expandProps = [
"version" : mod_version,
Expand Down
32 changes: 12 additions & 20 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
architectury {
common(rootProject.enabled_platforms.split(","))
}

repositories {
maven { url = "https://api.modrinth.com/maven" } // LazyDFU
maven { url = "https://maven.terraformersmc.com/releases/" } // Mod Menu
maven { url = "https://mvn.devos.one/snapshots/" }
// Create Fabric, Porting Lib, Forge Tags, Milk Lib, Registrate Fabric
maven { url = "https://mvn.devos.one/releases/" } // Porting Lib Releases
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // Forge Config API Port
maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes
maven { url = "https://jitpack.io/" } // Mixin Extras, Fabric ASM
common enabled_platforms.split(',')
}

dependencies {
// We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies
// Do NOT use other classes from fabric loader
// We depend on Fabric Loader here to use the Fabric @Environment annotations,
// which get remapped to the correct annotations on each platform.
// Do NOT use other classes from Fabric Loader.
modImplementation "net.fabricmc:fabric-loader:${project.fabric_loader_version}"

// Compile against Fabric versions of the Minimap mods in common
// beware of differences across platforms!
// dependencies must also be pulled in to minimize problems, from remapping issues to compile errors.
modCompileOnly "curse.maven:xaeros-minimap-263420:${project.xaeros_minimap_fabric_version}"
modCompileOnly "curse.maven:journeymap-32274:${project.journeymap_fabric_version}"
// api "fuzs.forgeconfigapiport:forgeconfigapiport-common:${project.forge_config_api_port_version}"
modCompileOnly("io.wispforest:accessories-common:${project.accessories_version}-mojmap")

// Minimap Mods
// Not used in common unless they are actually loaded.
modCompileOnly "maven.modrinth:xaeros-minimap:${project.xaeros_minimap_version}_Forge_1.20"
modCompileOnly "curse.maven:ftb-chunks-forge-314906:${project.ftb_chunks_forge_version}"
modCompileOnly "curse.maven:ftb-library-fabric-438495:${project.ftb_library_fabric_version}"
modCompileOnly "curse.maven:ftb-library-forge-404465:${project.ftb_library_forge_version}"
modCompileOnly "maven.modrinth:journeymap:${project.minecraft_version}-${project.journeymap_version}-forge"
}
87 changes: 68 additions & 19 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,38 +35,83 @@ dependencies {
common(project(path: ":common", configuration: "namedElements")) { transitive = false }
shadowBundle project(path: ':common', configuration: 'transformProductionFabric')

// //Energy
// include modApi("teamreborn:energy:${project.tech_reborn_energy_version}")
// modImplementation "RebornCore:RebornCore-1.20:${project.tech_reborn_version}"
// modImplementation "TechReborn:TechReborn-1.20:${project.tech_reborn_version}"

//Xaero's Minimap
modLocalRuntime "curse.maven:xaeros-minimap-263420:${project.xaeros_minimap_fabric_version}"
modCompileOnly("maven.modrinth:xaeros-minimap:${project.xaeros_minimap_version}_Fabric_1.20") {
exclude group: 'net.fabricmc', module: 'fabric-loader'
}

//JourneyMap
modCompileOnly "curse.maven:journeymap-32274:${project.journeymap_fabric_version}"
modCompileOnlyApi group: 'info.journeymap', name: 'journeymap-api', version: project.journeymap_api_version_fabric, changing: true
modCompileOnly("maven.modrinth:journeymap:${project.minecraft_version}-${project.journeymap_version}-fabric") {
exclude group: 'net.fabricmc', module: 'fabric-loader'
}

//FTB Chunks + Dependencies
modCompileOnly "curse.maven:ftb-chunks-fabric-472657:${project.ftb_chunks_fabric_version}"
modCompileOnly "curse.maven:ftb-library-fabric-438495:${project.ftb_library_fabric_version}"
modCompileOnly "curse.maven:ftb-teams-fabric-438497:${project.ftb_teams_fabric_version}"
modCompileOnly "curse.maven:architectury-api-419699:${project.architectury_api_fabric_version}"
modCompileOnly("curse.maven:ftb-chunks-fabric-472657:${project.ftb_chunks_fabric_version}") {
exclude group: 'net.fabricmc', module: 'fabric-loader'
}
modCompileOnly("curse.maven:ftb-library-fabric-438495:${project.ftb_library_fabric_version}") {
exclude group: 'net.fabricmc', module: 'fabric-loader'
}
modCompileOnly("curse.maven:ftb-teams-fabric-438497:${project.ftb_teams_fabric_version}") {
exclude group: 'net.fabricmc', module: 'fabric-loader'
}
modCompileOnly("maven.modrinth:architectury-api:${project.architectury_version}+fabric") {
exclude group: 'net.fabricmc', module: 'fabric-loader'
}

//Trinkets + Accessories
modCompileOnly "curse.maven:accessories-938917:${project.accessories_fabric_version}"
modCompileOnly "curse.maven:accessories-tc-layer-1005680:${project.tclayer_fabric_version}"
modCompileOnly "me.shedaniel.cloth:cloth-config-forge:${project.cloth_config_version}"
modImplementation("io.wispforest:accessories-fabric:${project.accessories_version}")
modImplementation("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {
exclude group: 'net.fabricmc', module: 'fabric-loader'
}
modCompileOnly("maven.modrinth:accessories-tc-layer:${project.trinkets_version}") {
exclude group: 'net.fabricmc', module: 'fabric-loader'
}
modCompileOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-base:5.2.1"
modCompileOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-item:5.2.1"
modCompileOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:5.2.1"

// //Forge Config API Port
// modApi "fuzs.forgeconfigapiport:forgeconfigapiport-fabric:${project.forge_config_api_port_version}"
// modImplementation("maven.modrinth:forge-config-api-port:v${project.forge_config_api_port_version}-${project.minecraft_version}-Fabric") {
// exclude group: 'net.fabricmc', module: 'fabric-loader'
// }

// Development QOL
modLocalRuntime("maven.modrinth:lazydfu:${lazydfu_version}")
modLocalRuntime("com.terraformersmc:modmenu:${modmenu_version}")
modLocalRuntime("maven.modrinth:lazydfu:${project.lazydfu_version}") {
exclude group: 'net.fabricmc', module: 'fabric-loader'
}
modLocalRuntime("com.terraformersmc:modmenu:${project.modmenu_version}")

// Recipe Viewers - Create Fabric supports JEI, REI, and EMI.
modLocalRuntime("mezz.jei:jei-${project.minecraft_version}-fabric:${project.jei_version}") {
exclude group: 'net.fabricmc', module: 'fabric-loader'
}

// Minimap Mod Dev Tests
// See root gradle.properties to choose which to use at runtime.
switch (fabric_recipe_viewer.toLowerCase(Locale.ROOT)) {
case "jei": modLocalRuntime("mezz.jei:jei-${minecraft_version}-fabric:${jei_version}"); break
case "rei": modLocalRuntime("me.shedaniel:RoughlyEnoughItems-fabric:${rei_version}"); break
case "emi": modLocalRuntime("dev.emi:emi:${emi_version}"); break
case "disabled": break
default: println("Unknown recipe viewer specified: ${fabric_recipe_viewer}. Must be JEI, REI, EMI, or disabled.")
switch (project.minimap_mod.toLowerCase(Locale.ROOT)) {
case "xaero":
modLocalRuntime("maven.modrinth:xaeros-minimap:${project.xaeros_minimap_version}_Fabric_1.20")
break
case "journey":
modLocalRuntime("maven.modrinth:journeymap:${project.minecraft_version}-${project.journeymap_version}-fabric")
break
case "ftb":
modLocalRuntime("curse.maven:ftb-chunks-fabric-472657:${project.ftb_chunks_fabric_version}")
modLocalRuntime("curse.maven:ftb-library-fabric-438495:${project.ftb_library_fabric_version}")
modLocalRuntime("curse.maven:ftb-teams-fabric-438497:${project.ftb_teams_fabric_version}")
modLocalRuntime("maven.modrinth:architectury-api:${project.architectury_version}+fabric")
break
case "none":
break
default: println("Unknown recipe viewer specified: ${project.minimap_mod}. Must be xaero, journey, ftb, " +
"atlas, voxel, or none")
}
}

Expand Down Expand Up @@ -101,6 +146,7 @@ modrinth {
changelog = recentChangelogText

dependencies {
// required.project "forge-config-api-port"
optional.project "xaeros-minimap"
optional.project "xaeros-minimap-fair"
optional.project "journeymap"
Expand All @@ -110,6 +156,8 @@ modrinth {
}

task publishCurseForge(type: net.darkhax.curseforgegradle.TaskPublishCurseForge) {
group = "curseforge"

int firstHeading = changelogText.indexOf("## [")
int nextHeading = changelogText.indexOf("## [", firstHeading + 1)
String recentChangelogText = changelogText.substring(firstHeading, nextHeading)
Expand All @@ -128,6 +176,7 @@ task publishCurseForge(type: net.darkhax.curseforgegradle.TaskPublishCurseForge)
mainFile.addModLoader("Fabric")
mainFile.addJavaVersion("Java 17")

// mainFile.addRequirement("forge-config-api-port-fabric")
mainFile.addOptional("xaeros-minimap")
mainFile.addOptional("xaeros-minimap-fair-play-edition")
mainFile.addOptional("journeymap")
Expand All @@ -137,7 +186,7 @@ task publishCurseForge(type: net.darkhax.curseforgegradle.TaskPublishCurseForge)
}

task publishFabric {
group = "publishing"
group = "upload"
afterEvaluate {
dependsOn(tasks.publishCurseForge)
dependsOn(tasks.modrinth)
Expand Down
2 changes: 1 addition & 1 deletion fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"pocketgps.mixins.json"
],
"depends": {
"fabricloader": ">=${fabric_loader_version}",
"fabricloader": "~${fabric_loader_version}",
"minecraft": "${fabric_version_range}",
"java": ">=${java_version}",
"fabric-api": "*"
Expand Down
Loading

0 comments on commit 1a5f292

Please sign in to comment.