Created
July 17, 2024 00:02
-
-
Save bconlon1/8bf514c1073eb8713ad8f3426bd9cf4d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import net.neoforged.gradle.common.tasks.JarJar | |
plugins { | |
id 'java-library' | |
id 'eclipse' | |
id 'idea' | |
id 'maven-publish' | |
id 'net.neoforged.gradle.userdev' version "${neogradle_version}" | |
id 'io.github.0ffz.github-packages' version '[1,2)' | |
id 'com.matthewprenger.cursegradle' version '[1.4,1.5)' | |
id 'com.modrinth.minotaur' version '[2,3)' | |
} | |
tasks.named('wrapper', Wrapper).configure { | |
distributionType = Wrapper.DistributionType.BIN | |
} | |
version = "${minecraft_version}-${mod_version}-neoforge" | |
group = mod_group | |
base { | |
archivesName = mod_id | |
} | |
java.toolchain.languageVersion = JavaLanguageVersion.of(21) | |
minecraft.accessTransformers.file rootProject.file('src/main/resources/META-INF/accesstransformer.cfg') | |
runs { | |
configureEach { | |
systemProperty 'forge.logging.markers', 'REGISTRIES' | |
systemProperty 'forge.logging.console.level', 'info' | |
modSource project.sourceSets.main | |
} | |
client { | |
systemProperty 'forge.enabledGameTestNamespaces', mod_id | |
} | |
server { | |
systemProperty 'forge.enabledGameTestNamespaces', mod_id | |
programArgument '--nogui' | |
} | |
gameTestServer { | |
systemProperty 'neoforge.enabledGameTestNamespaces', mod_id | |
} | |
data { | |
programArguments.addAll '--mod', mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath(), '--existing', file('src/generated/resources/').getAbsolutePath(), '--existing-mod', 'nitrogen_internals', '--existing-mod', 'cumulus_menus' | |
} | |
} | |
sourceSets.main.resources { | |
srcDir 'src/generated/resources' | |
} | |
dependencies { | |
implementation "net.neoforged:neoforge:21.0.103-beta-pr-1298-EntityWidth" | |
implementation "com.aetherteam.nitrogen:nitrogen_internals:${project.nitrogen_version}" | |
implementation "com.aetherteam.cumulus:cumulus_menus:${project.cumulus_version}" | |
implementation "io.wispforest:accessories-neoforge:${project.accessories_version}+${project.minecraft_version}" | |
// compileOnly "mezz.jei:jei-${project.mc_version}-common-api:${project.jei_version}" | |
// compileOnly "mezz.jei:jei-${project.mc_version}-neoforge-api:${project.jei_version}" | |
// runtimeOnly(fg.deobf("mezz.jei:jei-${mc_version}-forge:${jei_version}")) | |
jarJar("com.aetherteam.nitrogen:nitrogen_internals:${project.nitrogen_version}") { | |
jarJar.ranged(it, "[${project.nitrogen_version},)") | |
jarJar.pin(it, "${project.nitrogen_version}") | |
} | |
jarJar("com.aetherteam.cumulus:cumulus_menus:${project.cumulus_version}") { | |
jarJar.ranged(it, "[${project.cumulus_version},)") | |
jarJar.pin(it, "${project.cumulus_version}") | |
} | |
jarJar("io.wispforest:accessories-neoforge:${project.accessories_version}+${project.minecraft_version}") { | |
jarJar.ranged(it, "[${project.accessories_version}+${project.minecraft_version},)") | |
jarJar.pin(it, "${project.accessories_version}+${project.minecraft_version}") | |
} | |
//compileOnly fileTree(dir: 'libs', include: '*.jar') | |
} | |
repositories { | |
maven { | |
name 'Maven for PR #1298' // https://github.com/neoforged/NeoForge/pull/1298 | |
url 'https://prmaven.neoforged.net/NeoForge/pr1298' | |
content { | |
includeModule('net.neoforged', 'testframework') | |
includeModule('net.neoforged', 'neoforge') | |
} | |
} | |
maven { url = "https://jitpack.io" } | |
maven { url = "https://maven.blamejared.com" } | |
maven { url = "https://www.cursemaven.com" } | |
maven { url = "https://dvs1.progwml6.com/files/maven/" } | |
maven { url = "https://gitlab.com/api/v4/projects/21830712/packages/maven" } | |
maven { url = "https://maven.wispforest.io" } | |
maven { url = "https://maven.wispforest.io/releases" } | |
maven { url = "https://maven.shedaniel.me/" } | |
maven { url = "https://maven.fabricmc.net" } | |
maven githubPackage.invoke("The-Aether-Team/Nitrogen") | |
maven githubPackage.invoke("The-Aether-Team/Cumulus") | |
mavenLocal() | |
} | |
tasks.withType(ProcessResources).configureEach { | |
var replaceProperties = [ | |
mod_id : mod_id, | |
mod_name : mod_name, | |
mod_version : mod_version, | |
mod_license : mod_license, | |
mod_url : mod_url, | |
mod_tracker : mod_tracker, | |
mod_credits : mod_credits, | |
mod_authors : mod_authors, | |
mod_description : mod_description, | |
minecraft_version : minecraft_version, | |
minecraft_version_range: minecraft_version_range, | |
neo_version : neo_version, | |
neo_version_range : neo_version_range, | |
loader_version_range : loader_version_range | |
] | |
inputs.properties replaceProperties | |
filesMatching(['META-INF/neoforge.mods.toml']) { | |
expand replaceProperties | |
} | |
} | |
tasks.withType(JavaCompile).configureEach { | |
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation | |
options.compilerArgs << "-Xmaxerrs" << "9000" | |
} | |
tasks.named('jar', Jar).configure { | |
archiveClassifier = 'no-embeds' | |
} | |
tasks.named('jarJar', JarJar).configure { | |
archiveClassifier = '' | |
} | |
tasks.register('sourceJar', Jar) { | |
dependsOn 'classes' | |
from sourceSets.main.allSource | |
archiveClassifier = 'sources' | |
} | |
compileJava { | |
options.incremental = false | |
} | |
build { | |
dependsOn 'jarJar' | |
} | |
publishing { | |
publications { | |
mavenJava(MavenPublication) { | |
artifactId project.archivesBaseName | |
artifact project.tasks.jarJar | |
artifact project.sourceJar | |
} | |
} | |
repositories { | |
maven { | |
name = "GitHubPackages" | |
url = "https://maven.pkg.github.com/The-Aether-Team/The-Aether-II" | |
credentials { | |
username = System.getenv("GITHUB_ACTOR") | |
password = System.getenv("GITHUB_TOKEN") | |
} | |
} | |
} | |
} | |
curseforge { | |
project { | |
apiKey = System.getenv("CURSEFORGE_TOKEN") | |
id = "${curseforge_id}" | |
releaseType = "${version_type}" | |
changelog = file("$rootDir/docs/CHANGELOG.md") | |
changelogType = "markdown" | |
addGameVersion("${minecraft_version}") | |
addGameVersion("NeoForge") | |
mainArtifact(tasks.jarJar) { | |
displayName = "${mod_name} - ${version}" | |
relations { | |
// embeddedLibrary "cumulus" | |
} | |
} | |
} | |
options { | |
debug = true | |
} | |
} | |
modrinth { | |
token = System.getenv("MODRINTH_TOKEN") | |
projectId = "${modrinth_id}" | |
versionNumber = "${version}" | |
versionType = "${version_type}" | |
versionName = "${mod_name} - ${version}" | |
changelog = new File("$rootDir/docs/CHANGELOG.md").text | |
uploadFile = tasks.jarJar | |
gameVersions = ["${minecraft_version}"] | |
loaders = ["neoforge"] | |
dependencies { | |
// embedded.version "cumulus", "${cumulus_version}" | |
} | |
debugMode = true | |
} | |
idea { | |
module { | |
downloadSources = true | |
downloadJavadoc = true | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FAILURE: Build completed with 2 failures. | |
1: Task failed with an exception. | |
----------- | |
* Where: | |
Build file 'D:\Development Workspaces\Minecraft\Aether\The-Aether-II\build.gradle' line: 60 | |
* What went wrong: | |
A problem occurred evaluating root project 'The-Aether-II'. | |
> Could not resolve all dependencies for configuration ':neoGradleInternalUnhandledResolveRequestedNeoForgeVersion'. | |
> Could not find net.neoforged:neoforge:21.0.103-beta-pr-1298-EntityWidth. | |
Searched in the following locations: | |
- file:/D:/Development%20Workspaces/Minecraft/Aether/The-Aether-II/.gradle/repositories/net/neoforged/neoforge/21.0.103-beta-pr-1298-EntityWidth/ivy-21.0.103-beta-pr-1298-EntityWidth-ng2.xml | |
- https://libraries.minecraft.net/net/neoforged/neoforge/21.0.103-beta-pr-1298-EntityWidth/neoforge-21.0.103-beta-pr-1298-EntityWidth.pom | |
- https://maven.neoforged.net/releases/net/neoforged/neoforge/21.0.103-beta-pr-1298-EntityWidth/neoforge-21.0.103-beta-pr-1298-EntityWidth.pom | |
Required by: | |
project : | |
* Try: | |
> Run with --stacktrace option to get the stack trace. | |
> Run with --info or --debug option to get more log output. | |
> Run with --scan to get full insights. | |
> Get more help at https://help.gradle.org. | |
============================================================================== | |
2: Task failed with an exception. | |
----------- | |
* What went wrong: | |
A problem occurred configuring root project 'The-Aether-II'. | |
> Could not find run type client. Available run types: [] | |
* Try: | |
> Run with --stacktrace option to get the stack trace. | |
> Run with --info or --debug option to get more log output. | |
> Run with --scan to get full insights. | |
> Get more help at https://help.gradle.org. | |
============================================================================== | |
CONFIGURE FAILED in 2s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pluginManagement { | |
repositories { | |
maven { | |
name 'Maven for PR #1298' // https://github.com/neoforged/NeoForge/pull/1298 | |
url 'https://prmaven.neoforged.net/NeoForge/pr1298' | |
content { | |
includeModule('net.neoforged', 'testframework') | |
includeModule('net.neoforged', 'neoforge') | |
} | |
} | |
google() | |
mavenLocal() | |
gradlePluginPortal() | |
maven { url = 'https://maven.neoforged.net/releases/' } | |
} | |
} | |
plugins { | |
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment