Skip to content

Commit

Permalink
clean up buildscript
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamalam360 committed Nov 3, 2021
1 parent 0dec4e4 commit d671c10
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 58 deletions.
71 changes: 19 additions & 52 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
id 'fabric-loom' version '0.9-SNAPSHOT'
id 'maven-publish'
id 'org.cadixdev.licenser' version '0.6.1'
id "fabric-loom" version "0.9-SNAPSHOT"
id "org.cadixdev.licenser" version "0.6.1"
}

sourceCompatibility = JavaVersion.VERSION_16
Expand All @@ -15,69 +14,37 @@ minecraft {
}

repositories {
maven{
url "https://maven.terraformersmc.com/releases"
}
maven {
url = "https://maven.terraformersmc.com/releases"
}
}

dependencies {
//to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

modRuntime "com.terraformersmc:modmenu:2.0.14"
minecraft("com.mojang:minecraft:${project.minecraft_version}")
mappings("net.fabricmc:yarn:${project.yarn_mappings}:v2")
modImplementation("net.fabricmc:fabric-loader:${project.loader_version}")
modRuntime("com.terraformersmc:modmenu:${project.mod_menu_version}")
}

processResources {
inputs.property "version", project.version
inputs.property "version", project.version

filesMatching("fabric.mod.json") {
expand "version": project.version
}
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}

// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = 16
options.encoding = "UTF-8"
options.release = 16
}

// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
java {
withSourcesJar()
withSourcesJar()
}

jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
}

// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(jar) {
builtBy remapJar
}
artifact("${project.buildDir.absolutePath}/libs/${archivesBaseName}-${project.version}.jar"){
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}

// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
// mavenLocal()
}
}
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
org.gradle.jvmargs = -Xmx4G

org.gradle.jvmargs=-Xmx4G
#Fabric properties
minecraft_version=1.17.1
yarn_mappings=1.17.1+build.61
loader_version=0.12.4

#Mod properties
mod_version = 1.5.0
maven_group = io.github.jamalam360
archives_base_name = rightclickharvest
mod_version=1.5.0
maven_group=io.github.jamalam360
archives_base_name=rightclickharvest
#Other Dependencies
mod_menu_version=2.0.14

0 comments on commit d671c10

Please sign in to comment.