-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
133 lines (110 loc) · 3.15 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
buildscript {
repositories {
maven {
url "https://maven.modded-mc.com/repository/maven-public/"
}
google()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.1.0'
}
}
plugins {
id 'fabric-loom' version '0.8-SNAPSHOT'
id 'maven-publish'
id 'org.jetbrains.kotlin.jvm' version '1.5.21'
id "org.graalvm.plugin.compiler" version "0.1.0-alpha2"
}
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
String graalVersion = '21.1.0'
graal {
version graalVersion
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation group: 'com.electronwill.night-config', name: 'toml', version: '3.6.3'
implementation "org.graalvm.sdk:graal-sdk:$graalVersion"
implementation "org.graalvm.js:js:$graalVersion"
// necessary to integrate with legacy ScriptEngine based implementation
implementation "org.graalvm.js:js-scriptengine:$graalVersion"
implementation "io.ktor:ktor-server-core:1.6.2"
implementation "io.ktor:ktor-server-netty:1.6.2"
implementation 'team.yi.ktor:ktor-banner:0.2.0'
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
it.options.release = 16
}
java {
withSourcesJar()
toolchain {
languageVersion = JavaLanguageVersion.of(16)
vendor = JvmVendorSpec.ADOPTOPENJDK
}
}
compileKotlin {
kotlinOptions {
jvmTarget = JavaLanguageVersion.of(16)
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = JavaLanguageVersion.of(16)
}
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}
repositories {
}
}
task ('proguard', type: proguard.gradle.ProGuardTask) {
configuration './proguard.conf'
verbose
injars project.buildDir.toString() + '/libs/' + archivesBaseName + "-" + project.mod_version + ".jar"
outjars project.buildDir.toString() + '/libs/' + archivesBaseName + "-" + project.mod_version + "-min.jar"
printmapping 'out.map'
keepparameternames
renamesourcefileattribute 'SourceFile'
keepattributes 'Signature,Exceptions,InnerClasses,PermittedSubclasses,EnclosingMethod,Deprecated,SourceFile,LineNumberTable'
keepattributes '*Annotation*'
keepclassmembernames 'class * { \
java.lang.Class class$(java.lang.String); \
java.lang.Class class$(java.lang.String, boolean); \
}'
keepclassmembers 'class * { \
@net.minecraft.obfuscate.DontObfuscate public *; \
@org.graalvm.polyglot.HostAccess.Export public *; \
}'
keepclassmembers 'class org.sandboxpowered.fabric.mixin.* { \
<fields>; \
<init>(); \
<methods>; \
}'
}
remapJar.finalizedBy proguard