Skip to content

Commit

Permalink
Chore: Moved some stuff around on the webserver and made presets
Browse files Browse the repository at this point in the history
  • Loading branch information
kd8lvt committed Oct 30, 2024
1 parent 664da50 commit 5b684d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 111 deletions.
120 changes: 10 additions & 110 deletions build.gradle
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"
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ fabric_version=0.103.0+1.21.1
# Mod Properties
mod_version=1.0.6
game_version=1.21.0+1.21.1
maven_group=com.kd8lvt.exclusionzone
archives_base_name=exclusionzone
modid=exclusionzone

0 comments on commit 5b684d1

Please sign in to comment.