-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.gradle
88 lines (69 loc) · 2.2 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
plugins {
id 'fabric-loom' version '0.8-SNAPSHOT'
id 'maven-publish'
id 'eclipse'
id 'idea'
}
sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16
archivesBaseName = project.archives_base_name
version = project.mod_version
def versionPropsFile = file('version.properties')
def Properties versionProps = new Properties()
def major = 1
def minor = 0
def build = 0
if (versionPropsFile.canRead()) {
versionProps.load(new FileInputStream(versionPropsFile))
major = versionProps['VERSION_MAJOR'].toInteger()
minor = versionProps['VERSION_MINOR'].toInteger()
build = versionProps['VERSION_BUILD'].toInteger()
}
build += 1
if (versionPropsFile.canWrite()) {
versionProps['VERSION_MAJOR'] = major.toString()
versionProps['VERSION_MINOR'] = minor.toString()
versionProps['VERSION_BUILD'] = build.toString()
versionProps.store(versionPropsFile.newWriter(), null)
}
version = "${major}.${minor}.${build}"
minecraft {}
repositories {
maven { url "https://maven.fabricmc.net/" }
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.terraformersmc.com/releases/" }
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.minecraft_version}+build.${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modApi "com.terraformersmc:modmenu:${project.modmenu_version}"
modApi ("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_version}") {
exclude (group: "net.fabricmc.fabric-api")
}
include ("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_version}") {
exclude (group: "net.fabricmc.fabric-api")
}
}
processResources {
inputs.property "version", project.version
duplicatesStrategy = 'WARN'
from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"
expand "version": project.version
}
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}
jar {
from "LICENSE"
}
assemble {
version += "-${project.minecraft_version}-release"
}