forked from MrNavaStar/InvSync
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
90 lines (78 loc) · 3.04 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
import de.michiruf.gradle.findversion.FindVersion
plugins {
id 'java'
id 'fabric-loom' version '1.4-SNAPSHOT'
}
apply from: 'build.allprojects.gradle'
apply from: 'build.versions.gradle'
def minecraftVersion = project.minecraftVersion as String ?: '1.19.1'
def minecraftVersionDefinitions = ext.minecraftVersionDefinitions
def minecraftVersionDefinition = minecraftVersionDefinitions[minecraftVersion]
project.version = "${project.version}+${minecraftVersion}"
sourceSets {
main.java.srcDirs = [
'src/main/java',
//"src/versionedFeature/${FindVersion.findClosestLowerOrEqualVersionInDirectory(file('src/versionedFeature'), minecraftVersion)}"
]
}
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url "https://maven.shedaniel.me/" }
}
dependencies {
// Minecraft and fabric
minecraft "com.mojang:minecraft:${minecraftVersion}"
mappings "net.fabricmc:yarn:${minecraftVersionDefinition['mappings']}:v2"
modImplementation "net.fabricmc:fabric-loader:${minecraftVersionDefinition['fabric']}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${minecraftVersionDefinition['fabricApi']}"
// OrmLite
modImplementation include('com.j256.ormlite:ormlite-jdbc:6.1')
modImplementation include('org.xerial:sqlite-jdbc:3.40.0.0')
modImplementation include('mysql:mysql-connector-java:8.0.30')
modImplementation include('org.postgresql:postgresql:42.5.1')
// Tests
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.1'
}
processResources {
var replaceProperties = [
version : project.version,
minecraft: minecraftVersion,
mappings : minecraftVersionDefinition['mappings'],
fabric : minecraftVersionDefinition['fabric'],
fabricApi: minecraftVersionDefinition['fabricApi']
]
inputs.properties replaceProperties
filteringCharset 'UTF-8'
filesMatching('fabric.mod.json') {
expand replaceProperties
}
}
def targetJavaVersion = 17
tasks.withType(JavaCompile).configureEach {
// 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
// If Javadoc is generated, this must be specified in that task too.
it.options.encoding = "UTF-8"
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
it.options.release = targetJavaVersion
}
}
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
// 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()
}
test {
useJUnitPlatform()
maxHeapSize = '1G'
testLogging {
events 'passed'
}
}