-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: Moved some stuff around on the webserver and made presets
- Loading branch information
Showing
2 changed files
with
10 additions
and
111 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,115 +1,15 @@ | ||
//file:noinspection GroovyAssignabilityCheck | ||
//file:noinspection GrUnresolvedAccess | ||
plugins { | ||
id 'fabric-loom' version '1.6-SNAPSHOT' | ||
id 'maven-publish' | ||
id 'org.ajoberstar.grgit' version '5.3.0' | ||
plugins { //Incredibly annoying I can't offload this block to a non-build.gradle file :( | ||
id 'fabric-loom' version '1.6-SNAPSHOT' | ||
id 'maven-publish' | ||
//Required for versioning.gradle - not loaded if not needed | ||
id 'org.ajoberstar.grgit' version '5.3.0' apply false | ||
} | ||
apply from:"https://kd8lvt.com/gradle/minecraft/versioning.gradle" | ||
|
||
group = project.maven_group | ||
//git commit file name when built in-dev | ||
version = VERConsts.getVersionName() | ||
//Feel free to download these .gradle files and inspect them :) | ||
|
||
tasks.register("prod") { | ||
project.version = VERConsts.getVersionName(true) | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
dependencies { | ||
minecraft "com.mojang:minecraft:${project.minecraft_version}" | ||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" | ||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" | ||
|
||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" | ||
|
||
modImplementation "com.ptsmods:devlogin:3.5" | ||
} | ||
|
||
base { | ||
archivesName = project.archives_base_name-project.minecraft_version | ||
} | ||
|
||
|
||
loom { | ||
splitEnvironmentSourceSets() | ||
|
||
mods { | ||
"exclusionzone" { | ||
sourceSet sourceSets.main | ||
sourceSet sourceSets.client | ||
} | ||
} | ||
|
||
accessWidenerPath = file("src/main/resources/exclusionzone.accesswidener") | ||
|
||
runs { | ||
// This adds a new gradle task that runs the datagen API: "gradlew runDatagen" | ||
datagen { | ||
inherit server | ||
name "Data Generation" | ||
vmArg "-Dfabric-api.datagen" | ||
vmArg "-Dfabric-api.datagen.output-dir=${file("src/main/generated")}" | ||
vmArg "-Dfabric-api.datagen.modid=${modid}" | ||
|
||
runDir "build/datagen" | ||
} | ||
} | ||
} | ||
|
||
processResources { | ||
inputs.property "version", project.version | ||
|
||
filesMatching("fabric.mod.json") { | ||
expand "version": project.version | ||
} | ||
} | ||
|
||
tasks.withType(JavaCompile).configureEach { | ||
it.options.release = 21 | ||
} | ||
|
||
java { | ||
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task | ||
// if it is present. | ||
// If you remove this line, sources will not be generated. | ||
withSourcesJar() | ||
|
||
sourceCompatibility = JavaVersion.VERSION_21 | ||
targetCompatibility = JavaVersion.VERSION_21 | ||
} | ||
|
||
jar { | ||
from("LICENSE") { | ||
rename { "${it}_${project.base.archivesName.get()}"} | ||
} | ||
} | ||
|
||
// configure the maven publication | ||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
from components.java | ||
} | ||
} | ||
|
||
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. | ||
repositories { | ||
// Add repositories to publish to here. | ||
// Notice: This block does NOT have the same function as the block in the top level. | ||
// The repositories here will be used for publishing your artifact, not for | ||
// retrieving dependencies. | ||
} | ||
} | ||
|
||
sourceSets { | ||
main { | ||
resources { | ||
srcDirs += [ | ||
'src/main/generated' | ||
] | ||
} | ||
} | ||
} | ||
//Preset to build for Java 21 using Yarn, and output a sources jar on build. | ||
apply from:"https://kd8lvt.com/gradle/minecraft/fabric/presets/yarn.j21.withSources.gradle" | ||
//Oh hey, versioning.gradle, lookit that. | ||
apply from:"https://kd8lvt.com/gradle/minecraft/versioning.gradle" |
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