-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
85 lines (74 loc) · 3.63 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
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.20.2'
def minecraftVersionDefinitions = ext.minecraftVersionDefinitions
def minecraftVersionDefinition = minecraftVersionDefinitions[minecraftVersion]
project.version = "${project.version}+${minecraftVersion}"
sourceSets {
main.java.srcDirs = [
'src/main/java',
"src/registry/${FindVersion.findClosestLowerOrEqualVersionInDirectory(file('src/registry'), minecraftVersion)}",
"src/message/${FindVersion.findClosestLowerOrEqualVersionInDirectory(file('src/message'), minecraftVersion)}",
"src/customportalapi-polymer/${FindVersion.findClosestLowerOrEqualVersionInDirectory(file('src/customportalapi-polymer'), minecraftVersion)}"
]
}
repositories {
mavenCentral()
maven { url 'https://maven.wispforest.io' } // Owo config
maven { url 'https://maven.kyrptonaught.dev' } // Custom portal api
maven { url 'https://maven.nucleoid.xyz' } // Custom portal api transitive (polymer)
maven { url 'https://api.modrinth.com/maven' } // Custom portal api transitive (sodium)
}
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']}"
// Owo config
modImplementation annotationProcessor("io.wispforest:owo-lib:${minecraftVersionDefinition['owo']}") { exclude group: 'net.fabricmc.fabric-api' }
// We could include owo-sentinel for auto download, see https://github.com/wisp-forest/owo-lib
// Custom portal api
modImplementation include("net.kyrptonaught:customportalapi:${minecraftVersionDefinition['customportalapi']}") { exclude group: 'net.fabricmc.fabric-api' }
modImplementation include("eu.pb4:${minecraftVersionDefinition['polymer']}") { exclude group: 'net.fabricmc.fabric-api' }
}
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()
}