Skip to content

Commit cae7a55

Browse files
authored
Add automated production environment task (#724)
* Add automated production environment task * Remove local properties
1 parent 6dc46c8 commit cae7a55

File tree

5 files changed

+22
-7
lines changed

5 files changed

+22
-7
lines changed

build.gradle

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import net.earthcomputer.clientcommands.buildscript.CheckLanguageFilesTask
22
import net.earthcomputer.clientcommands.buildscript.GenerateBuildInfoTask
3+
import net.fabricmc.loom.task.prod.ClientProductionRunTask
34

45
plugins {
5-
id 'fabric-loom' version '1.9-SNAPSHOT'
6+
id 'fabric-loom' version '1.10-SNAPSHOT'
67
id 'maven-publish'
78
id 'com.modrinth.minotaur' version '2.+'
89
id 'com.github.breadmoirai.github-release' version '2.4.1'
@@ -56,6 +57,7 @@ dependencies {
5657
}
5758
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
5859
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
60+
productionRuntimeMods "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
5961

6062
include modImplementation("dev.xpple:clientarguments:${project.clientarguments_version}")
6163
include modImplementation("dev.xpple:betterconfig-fabric:${project.betterconfig_version}")
@@ -70,7 +72,10 @@ dependencies {
7072

7173
compileOnly 'com.demonwav.mcdev:annotations:2.0.0'
7274

73-
modRuntimeOnly('me.djtheredstoner:DevAuth-fabric:1.1.0') {
75+
modRuntimeOnly("me.djtheredstoner:DevAuth-fabric:${project.devauth_version}") {
76+
exclude group: 'net.fabricmc', module: 'fabric-loader'
77+
}
78+
productionRuntimeMods("me.djtheredstoner:DevAuth-fabric:${project.devauth_version}") {
7479
exclude group: 'net.fabricmc', module: 'fabric-loader'
7580
}
7681

@@ -133,6 +138,16 @@ tasks.withType(JavaCompile).configureEach {
133138
options.encoding = "UTF-8"
134139
}
135140

141+
tasks.register("prodClient", ClientProductionRunTask) {
142+
runDir = file("run")
143+
144+
jvmArgs.add("-Ddevauth.enabled=true")
145+
146+
javaLauncher = javaToolchains.launcherFor {
147+
languageVersion = JavaLanguageVersion.of(21)
148+
}
149+
}
150+
136151
tasks.register('sourcesJar', Jar) {
137152
dependsOn classes
138153
archiveClassifier.set("sources")

gradle.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ org.gradle.jvmargs=-Xmx2G
77
minecraft_version_dependency=1.21.4
88
minecraft_version_list=1.21.4
99
minecraft_version_list_presentable=1.21.4
10-
loader_version=0.16.9
10+
loader_version=0.16.10
1111

1212
parchment_mcversion=1.21
1313
parchment_version=2024.11.10
@@ -28,6 +28,7 @@ org.gradle.jvmargs=-Xmx2G
2828
seedfinding_seed_version=1.171.2
2929
latticg_version=1.07
3030
mapping_io_version=0.7.1
31+
devauth_version=1.2.1
3132
checkstyle_version=10.21.1
3233

3334
jazzer_junit_version=0.22.1

gradle/wrapper/gradle-wrapper.jar

122 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

+2-3
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ done
8686
# shellcheck disable=SC2034
8787
APP_BASE_NAME=${0##*/}
8888
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89-
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90-
' "$PWD" ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
9190

9291
# Use the maximum available, or set MAX_FD != -1 to use that value.
9392
MAX_FD=maximum
@@ -206,7 +205,7 @@ fi
206205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
207206

208207
# Collect all arguments for the java command:
209-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
210209
# and any embedded shellness will be escaped.
211210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
212211
# treated as '${Hostname}' itself on the command line.

0 commit comments

Comments
 (0)