Skip to content

Commit

Permalink
Updates 1.21.1
Browse files Browse the repository at this point in the history
  • Loading branch information
UnRealDinnerbone committed Sep 10, 2024
1 parent 64d768a commit 2384922
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 105 deletions.
83 changes: 3 additions & 80 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,80 +12,10 @@ multiLoader.root() {
minecraftVersion.set(project.property("minecraft_version"))
modID.set(project.property("mod_id"))
splitSources.set(true)
}

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"


}

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/"
}
maven {
name = "Nanite"
url = "https://maven.nanite.dev/releases"
}
}
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"))

}


publishMods {
dryRun = providers.environmentVariable("CURSE_TOKEN").getOrNull() == null
changelog = file("./CHANGELOG.md").text
Expand All @@ -98,6 +28,7 @@ publishMods {
modLoaders.add("fabric")
}


def neoOptions = publishOptions {
file = project.provider { project(":neo").tasks.jar }.flatMap { it.archiveFile }
displayName = "${project.name} Neo ${mod_version}+mc${minecraft_version}"
Expand All @@ -109,9 +40,6 @@ publishMods {
accessToken = providers.environmentVariable("CURSE_TOKEN")
projectId = "${curse_id}"
minecraftVersions.add("${minecraft_version}")
requires {
slug = "trenzalore"
}
}

curseforge("curseforgeFabric") {
Expand All @@ -124,9 +52,4 @@ publishMods {
curseforge("curseforgeNeoForge") {
from(curseForgeOptions, neoOptions)
}

}




}
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'
}
73 changes: 73 additions & 0 deletions buildSrc/src/main/groovy/multiloader.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
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 {
repositories {
maven {
name = "NeoForge"
url = "https://maven.neoforged.net/"
}
maven {
name = "Fabric"
url = "https://maven.fabricmc.net/"
}
maven {
name = "Nanite"
url = "https://maven.nanite.dev/releases"
}
maven {
name = "Curse Maven"
url = "https://cursemaven.com"
}
}
}

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()
}
}
}
4 changes: 4 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id 'multiloader'
}

multiLoader.common()

publishing.publications.mavenJava.from components.java
Expand Down
12 changes: 6 additions & 6 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
plugins {
id 'multiloader'
}

multiLoader.fabric() {
fabricLoaderVersion.set("${fabric_loader_version}")
fabricApiVersion.set("${fabric_version}")
}

publishing.publications.mavenJava.from components.java

dependencies {
modImplementation("com.unrealdinnerbone:trenzalore-fabric:${project.property("trenzalore_version")}+mc${project.property("minecraft_version")}")
}


publishing.publications.mavenJava.from components.java

remapJar {
setArchivesBaseName("${project.property("mod_name")}-${project.name}".toLowerCase())
}
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Project
mod_version=6.0.0
mod_version=7.0.0
maven_group=com.unrealdinnerbone
curse_id=517002
mod_name=IBICF
Expand All @@ -8,18 +8,18 @@ mod_id=ibicf


# Common
minecraft_version=1.21
minecraft_version=1.21.1

# Forge
#forge_version=49.0.13

neo_version=21.0.0-beta
neo_version=21.1.50

fabric_version=0.100.1+1.21
fabric_loader_version=0.15.11
fabric_version=0.104.0+1.21.1
fabric_loader_version=0.16.5

# Other
trenzalore_version=6.0.0
trenzalore_version=6.1.1

# Gradle
org.gradle.jvmargs=-Xmx3G
Expand Down
18 changes: 6 additions & 12 deletions neo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
plugins {
id 'multiloader'
}

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

java.sourceSets {
main {
java {
srcDirs = ["src/main/java", project(":common").file("src/client/java")]
}
resources {
srcDirs = ["src/main/resources", project(":common").file("src/client/resources")]
}
}
}
publishing.publications.mavenJava.from components.java

sourceSets.main.resources { srcDir project(":common").file('src/generated/resources') }

dependencies {
implementation("com.unrealdinnerbone:trenzalore-neo:${project.property("trenzalore_version")}+mc${project.property("minecraft_version")}")
}

publishing.publications.mavenJava.from components.java

2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pluginManagement {

plugins {
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7" apply(false)
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
}

}
Expand Down

0 comments on commit 2384922

Please sign in to comment.