-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
164 lines (134 loc) · 5.11 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
//file:noinspection GrDeprecatedAPIUsage
import com.modrinth.minotaur.dependencies.ModDependency
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id 'fabric-loom' version '1.8.2'
id 'org.jetbrains.kotlin.plugin.serialization' version '2.0.21'
id 'org.jetbrains.kotlin.jvm' version '2.0.21'
id 'com.modrinth.minotaur' version '2.+'
id 'maven-publish'
}
version = project.mod_version
group = project.maven_group
archives_base_name = "${project.archives_base_name}-${project.minecraft_version}"
base {
archivesName = project.archives_base_name
}
repositories {
}
modrinth {
token = project.hasProperty('modrinthToken') ? project.modrinthToken : System.getenv("MODRINTH_TOKEN")
projectId = project.id_main
versionNumber = project.mod_version
versionName = "IWTCMS ${project.mod_version}"
uploadFile = remapJar
//additionalFiles = [remapSourcesJar]
gameVersions = Eval.me(project.release_minecraft_versions)
versionType = project.release_type
loaders = ["fabric"]
syncBodyFrom = rootProject.file("README.md").text
changelog = rootProject.file("CHANGELOG.md").text
dependencies = [
new ModDependency(project.id_fabric_api, "required"),
new ModDependency(project.id_fabric_kotlin, "required"),
]
tasks.modrinth.dependsOn(tasks.modrinthSyncBody)
}
dependencies {
implementation 'io.ktor:ktor-server-core-jvm:3.0.1'
implementation 'io.ktor:ktor-server-host-common-jvm:3.0.1'
implementation 'io.ktor:ktor-server-status-pages-jvm:3.0.1'
implementation 'io.ktor:ktor-server-core-jvm:3.0.1'
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}"
// Ktor cool thing, but launching with fabricmc looks terrible
implementation include("io.ktor:ktor-server-core:${project.ktor_version}")
implementation include("io.ktor:ktor-server-netty:${project.ktor_version}")
implementation include("io.ktor:ktor-network-tls-certificates:${project.ktor_version}")
implementation include("io.ktor:ktor-server-websockets:${project.ktor_version}")
implementation include("io.ktor:ktor-server-sessions:${project.ktor_version}")
implementation include("io.ktor:ktor-serialization-kotlinx-json:${project.ktor_version}")
implementation include("io.ktor:ktor-server-content-negotiation:${project.ktor_version}")
implementation include("io.ktor:ktor-server-status-pages:$ktor_version")
include "io.ktor:ktor-events:${project.ktor_version}"
include "io.ktor:ktor-utils:${project.ktor_version}"
include "io.ktor:ktor-network-tls:${project.ktor_version}"
include "io.ktor:ktor-io:${project.ktor_version}"
include "io.ktor:ktor-http:${project.ktor_version}" // fuck this
include "io.ktor:ktor-websockets:${project.ktor_version}"
include "io.ktor:ktor-serialization:${project.ktor_version}"
include "io.ktor:ktor-serialization-kotlinx:${project.ktor_version}"
include "io.netty:netty-transport-classes-kqueue:${project.netty_version}"
include "io.netty:netty-codec-http2:${project.netty_version}"
include "io.netty:netty-codec-http:${project.netty_version}"
// already launched ktor
implementation include("com.typesafe:config:${project.hocon_config_version}")
implementation include("commons-codec:commons-codec:${project.commons_codec}")
}
tasks.withType(JavaCompile).configureEach {
it.options.release = 21
}
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = 21
}
}
java {
// 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()
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
tasks.register("preparePythonClient") {
group = "build"
def clientDir = file("$buildDir/../python")
def outputZip = file("$buildDir/resources/web/iwtcms_client.zip")
inputs.dir(clientDir)
outputs.file(outputZip)
doLast {
ant.zip(destfile: outputZip, basedir: clientDir)
}
}
jar {
from("LICENSE")
}
processResources {
dependsOn tasks.preparePythonClient
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
doLast {
copy {
from("$buildDir/resources/web/iwtcms_client.zip")
into("$buildDir/resources/main/web")
}
}
}
publishing {
publications {
create("mavenJava", MavenPublication) {
artifactId = project.archives_base_name
groupId = project.maven_group
version = version
//noinspection GroovyAssignabilityCheck
from components.java
}
}
repositories {
maven {
name = 'Lumivoid'
url = 'https://maven.lumivoid.pp.ua/repository/lumivoid/'
credentials {
username = project.hasProperty("mavenUsername") ? project.mavenUsername : System.getenv("MAVEN_USERNAME")
password = project.hasProperty("mavenPassword") ? project.mavenPassword : System.getenv("MAVEN_PASSWORD")
}
}
}
}