This repository has been archived by the owner on Nov 15, 2024. It is now read-only.
forked from theosib/motion-print
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
90 lines (73 loc) · 2.47 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
buildscript {
repositories {
jcenter()
maven {
name = "Fabric"
url = "https://maven.fabricmc.net/"
}
}
dependencies {
classpath 'net.fabricmc:fabric-loom:0.4-SNAPSHOT'
}
}
apply plugin: "fabric-loom"
repositories {
maven {
url 'https://masa.dy.fi/maven'
}
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
ext.configFile = file "build.properties"
configFile.withReader {
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}
dependencies {
minecraft "com.mojang:minecraft:${config.minecraft_version}"
mappings "net.fabricmc:yarn:${config.mappings_version}:v2"
modCompile "net.fabricmc:fabric-loader:${config.fabric_loader_version}"
compile "com.google.code.findbugs:jsr305:3.0.2"
// Fabric API. This is technically optional, but you probably want it anyway.
//modCompile "net.fabricmc:fabric:${config.fabric_api_version}
}
minecraft {
ext.mod_version = config.mod_version
if (mod_version.endsWith('-dev')) {
mod_version = mod_version + "." + new Date().format('yyyyMMdd.HHmmss')
}
}
compileJava {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
options.encoding = 'UTF-8'
}
group = config.group + "." + config.mod_id
archivesBaseName = config.mod_file_name + '-' + config.minecraft_version_out
version = project.minecraft.mod_version
processResources
{
// Exclude the GIMP image files
exclude '**/*.xcf'
exclude '**/xcf'
exclude '**/*.DS_Store'
exclude '**/.DS_Store'
// this will ensure that this task is redone when the versions change.
//inputs.property "mod_version", project.minecraft.mod_version
//inputs.property "minecraft_version", project.config.minecraft_version
inputs.property "mod_version", project.minecraft.mod_version
from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"
expand "mod_version": project.minecraft.mod_version
}
from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
}
// 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"
}