Skip to content

Commit

Permalink
Tooling Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
UnRealDinnerbone committed Jul 7, 2024
1 parent 6d73c90 commit fe65c22
Show file tree
Hide file tree
Showing 12 changed files with 85 additions and 91 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
### 6.0.1
### 6.0.2

- Update NeoForge
- Tooling Updates
80 changes: 2 additions & 78 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("dev.nanite.mlp") version("0.2.0")
id("dev.nanite.mlp") version("0.3.0")
id("java-library")
id("maven-publish")
id("me.modmuss50.mod-publish-plugin") version "0.3.0"
Expand All @@ -15,83 +15,7 @@ multiLoader.root() {
splitSources.set(true)
convertAccessWidener.set(true)
accessWidenerFile.set(project(":common").file("src/main/resources/${mod_id}.accesswidener"))

def get = filesToExpand.get()
def newList = new ArrayList<>(get)
newList.add("META-INF/neoforge.mods.toml")
filesToExpand.set(newList)
}

allprojects {
def isSnapshot = providers.environmentVariable("SNAPSHOT").map {it == "true"}.getOrElse(false)
version = "${mod_version}+mc${minecraft_version}${isSnapshot ? '-SNAPSHOT' : ''}"
setArchivesBaseName("${mod_name}-${project.name}".toLowerCase())
group = "com.unrealdinnerbone"

idea {
module {
downloadSources = true
downloadJavadoc = true
}
}
}

subprojects {


apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'dev.nanite.mlp'


sourceSets.main.resources.srcDir project.file('src/generated/resources')

java.toolchain.languageVersion = JavaLanguageVersion.of(21)


base {
archivesName = "${project.property("mod_name")}-${project.name}".toLowerCase()
}
repositories {
maven {
name = "NeoForge"
url = "https://maven.neoforged.net/"
}
maven {
name = "Fabric"
url = "https://maven.fabricmc.net/"
}
}
tasks.withType(ProcessResources).configureEach {
outputs.upToDateWhen { false }
}

test {
enabled = false
}

publishing {
repositories {
if (providers.environmentVariable("NANITE_TOKEN").isPresent()) {
maven {
def isSnapshot = providers.environmentVariable("SNAPSHOT").map {it == "true"}.getOrElse(false)
url "https://maven.nanite.dev/${isSnapshot ? 'snapshots' : 'releases'}"
credentials {
username = "nanite"
password = providers.environmentVariable("NANITE_TOKEN").get()
}
}
}
}
publications {
register("mavenJava", MavenPublication) {
groupId project.group
artifactId project.getArchivesBaseName()
}
}
}


group.set(project.property("maven_group"))
}


Expand Down
3 changes: 3 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins {
id 'groovy-gradle-plugin'
}
63 changes: 63 additions & 0 deletions buildSrc/src/main/groovy/multiloader.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
plugins {
id 'java-library'
id 'maven-publish'
id 'dev.nanite.mlp'
}

java.toolchain.languageVersion = JavaLanguageVersion.of(21)

def isASnapshot = providers.environmentVariable("SNAPSHOT").map {it == "true"}.getOrElse(false)
version = "${mod_version}+mc${minecraft_version}${isASnapshot ? '-SNAPSHOT' : ''}"
setArchivesBaseName("${mod_name}-${project.name}".toLowerCase())
group = "${maven_group}"

idea {
module {
downloadSources = true
downloadJavadoc = true
}
}

base {
archivesName = "${project.property("mod_name")}-${project.name}".toLowerCase()
}

repositories {
maven {
name = "NeoForge"
url = "https://maven.neoforged.net/"
}
maven {
name = "Fabric"
url = "https://maven.fabricmc.net/"
}
}

tasks.withType(ProcessResources).configureEach {
outputs.upToDateWhen { false }
}

test {
enabled = false
}

publishing {
repositories {
if (providers.environmentVariable("NANITE_TOKEN").isPresent()) {
maven {
def isSnapshot = providers.environmentVariable("SNAPSHOT").map {it == "true"}.getOrElse(false)
url "https://maven.nanite.dev/${isSnapshot ? 'snapshots' : 'releases'}"
credentials {
username = "nanite"
password = providers.environmentVariable("NANITE_TOKEN").get()
}
}
}
}
publications {
register("mavenJava", MavenPublication) {
groupId project.group
artifactId project.getArchivesBaseName()
}
}
}
6 changes: 4 additions & 2 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
plugins {
id 'multiloader'
}

multiLoader.common()

publishing.publications.mavenJava.from components.java


Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package com.unrealdinnerbone.trenzalore.api.registry;

import com.unrealdinnerbone.trenzalore.api.platform.Services;
import net.minecraft.advancements.CriteriaTriggers;
import net.minecraft.advancements.CriterionTrigger;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.flag.FeatureFlagSet;
import net.minecraft.world.inventory.AbstractContainerMenu;
Expand All @@ -17,7 +14,6 @@
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import org.jetbrains.annotations.ApiStatus;

import java.util.List;
import java.util.function.BiFunction;
Expand Down
Binary file modified common/src/main/resources/assets/trenzalore/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id 'multiloader'
}

multiLoader.fabric() {
fabricLoaderVersion.set("${fabric_loader_version}")
fabricApiVersion.set("${fabric_version}")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Project
mod_version=6.0.1
mod_version=6.0.2
maven_group=com.unrealdinnerbone
mod_name=Trenzalore
mod_author=UnRealDinnerbone
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 5 additions & 0 deletions neo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
plugins {
id 'multiloader'
}

multiLoader.neo() {
neoVersion.set("${neo_version}")
}

publishing.publications.mavenJava.from components.java

sourceSets.main.resources { srcDir 'src/generated/resources' }
3 changes: 0 additions & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
maven {
name = "NeoForge"
Expand All @@ -25,6 +24,4 @@ pluginManagement {
}




include("common", "neo", "fabric")

0 comments on commit fe65c22

Please sign in to comment.