-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
32 lines (26 loc) · 1 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
import java.util.regex.Pattern
plugins {
id 'java-library'
}
group 'org.ships'
version '6.0.0.0'
description 'Full'
apply from: 'buildGradle/build.gradle'
var targetJavaVersion = isGreater(20, 5) ? 21 : 17
java.sourceCompatibility = JavaLanguageVersion.of(targetJavaVersion)
compileJava.options.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
dependencies {
api files(project.projectDir.path + '/ShipsForCore/build/libs/ShipsForCore-' + project.version + "-Beta.jar")
}
boolean isGreater(int major, int minor) {
var targetMinecraftVersion = project.hasProperty("folia-api-version") ? (String) project.property("folia-api-version") : "1.20.1"
var targetMajorVersion = Integer.parseInt(targetMinecraftVersion.split(Pattern.quote('.'))[1])
var targetMinorVersion = Integer.parseInt(targetMinecraftVersion.split(Pattern.quote('.'))[2])
if (targetMajorVersion < major) {
return true;
}
return targetMajorVersion == major && targetMinorVersion <= minor;
}