Skip to content

Commit

Permalink
1.21.1
Browse files Browse the repository at this point in the history
  • Loading branch information
UnRealDinnerbone committed Sep 10, 2024
1 parent 417023b commit cf0ea73
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 95 deletions.
84 changes: 4 additions & 80 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
plugins {
id("dev.nanite.mlp") version("0.1.12")
id("dev.nanite.mlp") version("0.3.0")
id("java-library")
id("maven-publish")
id("me.modmuss50.mod-publish-plugin") version "0.3.0"
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.0'
}


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

multiLoader.root() {
Expand All @@ -16,80 +16,9 @@ multiLoader.root() {
useFabric.set(project(":common").file("src/generated/resources"))
useNeo.set(project(":neo").file("src/generated/resources"))
}
group.set(project.property("maven_group"))
}

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()
}
}
}


}


publishMods {
dryRun = providers.environmentVariable("CURSE_TOKEN").getOrNull() == null
changelog = file("./CHANGELOG.md").text
Expand All @@ -102,6 +31,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 @@ -113,9 +43,6 @@ publishMods {
accessToken = providers.environmentVariable("CURSE_TOKEN")
projectId = "${curse_id}"
minecraftVersions.add("${minecraft_version}")
requires {
slug = "trenzalore"
}
}

curseforge("curseforgeFabric") {
Expand All @@ -128,9 +55,6 @@ 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=21.0.1
mod_version=21.1.0
maven_group=com.unrealdinnerbone
curse_id=517003
mod_name=JAGS
Expand All @@ -8,18 +8,18 @@ mod_id=jags


# 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
9 changes: 7 additions & 2 deletions neo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
plugins {
id 'multiloader'
}

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

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 cf0ea73

Please sign in to comment.