gradle works

This commit is contained in:
DaCodia
2024-07-25 05:24:57 -05:00
parent 303be9dae4
commit c74c4937e2
11 changed files with 188 additions and 238 deletions

View File

@@ -1,187 +1,79 @@
buildscript {
repositories {
// These repositories are only for Gradle plugins, put any other repositories in the repository block further below
maven { url = 'https://maven.minecraftforge.net' }
mavenCentral()
jcenter()
maven { url = 'https://maven.parchmentmc.org' }
maven { url = 'https://repo.spongepowered.org/repository/maven-public' }
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath "org.parchmentmc:librarian:${librarian_version}"
classpath "org.spongepowered:mixingradle:0.7-SNAPSHOT"
}
}
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
plugins { plugins {
id 'eclipse' id 'fabric-loom' version "1.5.+"
id 'maven-publish' id 'maven-publish'
id 'com.matthewprenger.cursegradle' version '1.4.0'
} }
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.parchmentmc.librarian.forgegradle'
apply plugin: 'org.spongepowered.mixin'
//mixin { version = '0.9.0c-1.19.2-fabric'
// add sourceSets.main, "createindustry.refmap.json"
//}
version = '0.9.0c-1.19.2'
group = 'com.drmangotea.createindustry' // http://maven.apache.org/guides/mini/guide-naming-conventions.html group = 'com.drmangotea.createindustry' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'createindustry' archivesBaseName = 'createindustry'
// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
java.toolchain.languageVersion = JavaLanguageVersion.of(17) sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
minecraft {
mappings channel: 'parchment', version: "${parchment_version}-${minecraft_version}"
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default.
runs {
client {
workingDirectory project.file('run')
arg '-mixin.config=createindustry.mixins.json'
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'forge.enabledGameTestNamespaces', 'createindustry'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
mods {
createindustry {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
arg '-mixin.config=createindustry.mixins.json'
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'forge.enabledGameTestNamespaces', 'createindustry'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
mods {
createindustry {
source sourceSets.main
}
}
}
gameTestServer {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'forge.enabledGameTestNamespaces', 'createindustry'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
mods {
createindustry {
source sourceSets.main
}
}
}
data {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
args '--mod', 'createindustry', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
mods {
createindustry {
source sourceSets.main
}
}
}
}
}
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories { repositories {
maven { url = "https://maven.shedaniel.me/" } // Cloth Config, REI
maven { maven { url = "https://maven.blamejared.com/" } // JEI
url = 'https://www.cursemaven.com' maven { url = "https://maven.parchmentmc.org" } // Parchment mappings
content { maven { url = "https://maven.quiltmc.org/repository/release" } // Quilt Mappings
includeGroup "curse.maven" 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, Porting Lib, Forge Tags, Milk Lib, Registrate
maven { maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // Forge Config API Port
// location of the maven that hosts JEI files since January 2023 maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes
// location of the maven for Vazkii's mods maven { url = "https://jitpack.io/" } // Mixin Extras, Fabric ASM
name = "Jared's maven" maven { url = "https://maven.tterrag.com/" } // Flywheel
url = "https://maven.blamejared.com/"
}
maven {
url "https://maven.tterrag.com/"
}
} }
dependencies { dependencies {
minecraft("com.mojang:minecraft:${minecraft_version}")
mappings(loom.layered {
it.mappings("org.quiltmc:quilt-mappings:${minecraft_version}+build.${quilt_version}:intermediary-v2")
})
modImplementation("net.fabricmc:fabric-loader:${fabric_loader_version}")
// dependencies
modImplementation("net.fabricmc.fabric-api:fabric-api:${fabric_api_version}")
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" // Create - dependencies are added transitively
modImplementation("com.simibubi.create:create-fabric-${minecraft_version}:${create_version}")
// Development QOL
compileOnly fg.deobf("com.tterrag.registrate:Registrate:${registrate_version}") modLocalRuntime("maven.modrinth:lazydfu:${lazydfu_version}")
implementation fg.deobf("com.jozufozu.flywheel:flywheel-forge-${minecraft_version}:${flywheel_version}") modLocalRuntime("com.terraformersmc:modmenu:${modmenu_version}")
implementation fg.deobf("com.simibubi.create:create-${minecraft_version}:${create_version}:all") { transitive = false }
implementation fg.deobf("curse.maven:createaddition-439890:5070245")
implementation fg.deobf("curse.maven:zinclib-968773:5110339")
implementation fg.deobf("curse.maven:mekanism-268560:4644795")
implementation fg.deobf("curse.maven:selene-499980:4983974")
implementation fg.deobf("curse.maven:spark-361579:4505309")
//implementation fg.deobf("curse.maven:create-steam-n-rails-688231:5246888")
compileOnly fg.deobf("mezz.jei:jei-${jei_minecraft_version}-common-api:${jei_version}")
compileOnly fg.deobf("mezz.jei:jei-${jei_minecraft_version}-forge-api:${jei_version}")
runtimeOnly fg.deobf("mezz.jei:jei-${jei_minecraft_version}-forge:${jei_version}")
annotationProcessor "org.spongepowered:mixin:0.8.5:processor"
testAnnotationProcessor "org.spongepowered:mixin:0.8.5:processor"
} }
// Example for how to get properties into the manifest for reading at runtime. processResources {
jar { // require dependencies to be the version compiled against or newer
manifest { Map<String, String> properties = Map.of(
attributes([ "version", version,
"Specification-Title" : "createindustry", "fabric_loader_version", fabric_loader_version,
"Specification-Vendor" : "tfmgsareus", "fabric_api_version", fabric_api_version,
"Specification-Version" : "1", // We are version 1 of ourselves "create_version", create_version,
"Implementation-Title" : project.name, "minecraft_version", minecraft_version
"Implementation-Version" : project.jar.archiveVersion, )
"Implementation-Vendor" : "tfmgsareus",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), inputs.properties(properties)
"MixinConfigs": "createindustry.mixins.json"
]) filesMatching("fabric.mod.json") {
expand properties
} }
} }
tasks.withType(JavaCompile).configureEach {
it.options.release = Integer.parseInt(sourceCompatibility)
}
jar.finalizedBy('reobfJar') java {
withSourcesJar()
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
}
publishing { publishing {
publications { publications {
mavenJava(MavenPublication) { mavenJava(MavenPublication) {
@@ -195,6 +87,70 @@ publishing {
} }
} }
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation //minecraft {
} //
//
// // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default.
//
// runs {
// client {
// workingDirectory project.file('run')
// arg '-mixin.config=createindustry.mixins.json'
// property 'forge.logging.markers', 'REGISTRIES'
// property 'forge.logging.console.level', 'debug'
// property 'forge.enabledGameTestNamespaces', 'createindustry'
// property 'mixin.env.remapRefMap', 'true'
// property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
// mods {
// createindustry {
// source sourceSets.main
// }
// }
// }
//
// server {
// workingDirectory project.file('run')
// arg '-mixin.config=createindustry.mixins.json'
// property 'forge.logging.markers', 'REGISTRIES'
// property 'forge.logging.console.level', 'debug'
// property 'forge.enabledGameTestNamespaces', 'createindustry'
// property 'mixin.env.remapRefMap', 'true'
// property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
// mods {
// createindustry {
// source sourceSets.main
// }
// }
// }
//
// gameTestServer {
// workingDirectory project.file('run')
// property 'forge.logging.markers', 'REGISTRIES'
// property 'forge.logging.console.level', 'debug'
// property 'forge.enabledGameTestNamespaces', 'createindustry'
// property 'mixin.env.remapRefMap', 'true'
// property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
// mods {
// createindustry {
// source sourceSets.main
// }
// }
// }
//
// data {
// workingDirectory project.file('run')
// property 'forge.logging.markers', 'REGISTRIES'
// property 'forge.logging.console.level', 'debug'
// args '--mod', 'createindustry', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
// mods {
// createindustry {
// source sourceSets.main
// }
// }
// }
// }
//}
//
//// Include resources generated by data generators.
//sourceSets.main.resources { srcDir 'src/generated/resources' }

View File

@@ -3,12 +3,15 @@ org.gradle.daemon=false
jei_minecraft_version = 1.19.2 jei_minecraft_version = 1.19.2
jei_version = 11.4.0.274 jei_version = 11.4.0.274
forge_version = 43.2.8 fabric_loader_version = 0.15.7
fabric_api_version = 0.92.0+1.20.1
minecraft_version = 1.19.2 minecraft_version = 1.19.2
flywheel_version = 0.6.10-20 create_version = 0.5.1-f-build.1334+mc1.19.2
create_version = 0.5.1.f-45 quilt_version = 22
librarian_version = 1.+
parchment_version = 2022.11.27 parchment_version = 2022.11.27
registrate_version = MC1.19-1.1.5 registrate_version = MC1.19-1.1.5
modmenu_version = 4.2.0-beta.2
lazydfu_version = 0.1.3

Binary file not shown.

View File

@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

35
gradlew vendored
View File

@@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop. # Darwin, MinGW, and NonStop.
# #
# (3) This script is generated from the Groovy template # (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project. # within the Gradle project.
# #
# You can find Gradle at https://github.com/gradle/gradle/. # You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,13 +80,11 @@ do
esac esac
done done
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # This is normally unused
# shellcheck disable=SC2034
APP_NAME="Gradle"
APP_BASE_NAME=${0##*/} APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum MAX_FD=maximum
@@ -133,22 +131,29 @@ location of your Java installation."
fi fi
else else
JAVACMD=java JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi
fi fi
# Increase the maximum file descriptors if we can. # Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #( case $MAX_FD in #(
max*) max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) || MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit" warn "Could not query maximum file descriptor limit"
esac esac
case $MAX_FD in #( case $MAX_FD in #(
'' | soft) :;; #( '' | soft) :;; #(
*) *)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" || ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD" warn "Could not set maximum file descriptor limit to $MAX_FD"
esac esac
@@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done done
fi fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
# shell script including quotes and variable substitutions, so put them in DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded. # Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \ set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \ "-Dorg.gradle.appname=$APP_BASE_NAME" \

1
gradlew.bat vendored
View File

@@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0 set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=. if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%

View File

@@ -1,9 +1,8 @@
pluginManagement { pluginManagement {
repositories { repositories {
gradlePluginPortal() gradlePluginPortal()
maven { url = 'https://maven.minecraftforge.net/' } maven { url = "https://maven.fabricmc.net/" }
maven { url = "https://maven.quiltmc.org/repository/release" }
} }
} }

View File

@@ -1,41 +0,0 @@
modLoader="javafml"
loaderVersion="[43,)"
license="MIT"
[[mods]]
modId="createindustry"
version="0.9.0c"
displayName="Create: The Factory Must Grow"
logoFile="logo.png"
authors="DrMangoTea, Pepa, Milky, Luna"
description='''
Create is by default a steam/clockpunk mod and most addons aim to expand this part of Create and do that pretty well, we thought the next natural expansion would be moving on from steampunk to dieselpunk. We believe that create could be later used not just as a single steampunk tech mod, but due to its modularity and polishedness it is a perfect base for other tech mods aiming to Create (get it) something new with it, essentially using it as a library. We wanna be the first one to try and prove this concept.
'''
[[dependencies.createindustry]]
modId="forge"
mandatory=true
versionRange="[43,)"
ordering="NONE"
side="BOTH"
[[dependencies.createindustry]]
modId="minecraft"
mandatory=true
versionRange="[1.19.2,1.20)"
ordering="NONE"
side="BOTH"

View File

@@ -1,16 +1,15 @@
{ {
"required": true, "required": true,
"minVersion": 0.8, "minVersion": "0.8",
"package": "com.drmangotea.createindustry.mixins", "package": "com.drmangotea.createindustry.mixins",
"compatibilityLevel": "JAVA_8", "compatibilityLevel": "JAVA_17",
"refmap": "createindustry.refmap.json",
"mixins": [ "mixins": [
"AllOreFeatureConfigEntriesMixin", "AllOreFeatureConfigEntriesMixin",
"FluidPropagatorMixin", "FluidPropagatorMixin",
"FluidPipeBlockMixin", "FluidPipeBlockMixin",
"PipeAttachmentModelMixin", "PipeAttachmentModelMixin",
"BucketItemMixin", "BucketItemMixin"
// "ArrowMixin" // "ArrowMixin"
//, //,
// "ScreenEffectRendererMixin" // "ScreenEffectRendererMixin"

View File

@@ -0,0 +1,30 @@
{
"schemaVersion": 1,
"id": "createindustry",
"version": "0.9.0c",
"name": "Create: The Factory Must Grow",
"description": "Create is by default a steam/clockpunk mod and most addons aim to expand this part of Create and do that pretty well, we thought the next natural expansion would be moving on from steampunk to dieselpunk. We believe that create could be later used not just as a single steampunk tech mod, but due to its modularity and polishedness it is a perfect base for other tech mods aiming to Create (get it) something new with it, essentially using it as a library. We wanna be the first one to try and prove this concept.\n",
"authors": [
"DrMangoTea, Pepa, Milky, Luna, but mostly DaCodia"
],
"contact": {
"sources": "https://github.com/Fabricators-of-Create/create-fabric-addon-template"
},
"license": "CC0",
"icon": "logo.png",
"environment": "*",
"entrypoints": {
"main": [
"com.drmangotea.createindustry.CreateTFMG"
]
},
"mixins": [
"createindustry.mixins.json"
],
"depends": {
"fabricloader": ">=${fabric_loader_version}",
"fabric-api": ">=${fabric_api_version}",
"create": "${create_version}",
"minecraft": "${minecraft_version}"
}
}

View File

@@ -1,8 +0,0 @@
{
"pack": {
"description": "createindustry resources",
"pack_format": 9,
"forge:resource_pack_format": 9,
"forge:data_pack_format": 10
}
}