-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
109 lines (93 loc) · 2.89 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
plugins {
id "fabric-loom" version "1.6.9"
id "maven-publish"
id "org.ajoberstar.grgit" version '4.1.0'
}
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
archivesBaseName = project.archives_base_name
version = "${project.mod_version}-mc${project.minecraft_version}-rev.${grgit.head().abbreviatedId}"
group = project.maven_group
repositories {
mavenLocal()
mavenCentral()
maven {
url = "https://m2.dv8tion.net/releases/"
content { includeGroup "net.dv8tion" }
}
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation(fabricApi.module("fabric-api-base", project.fabric_version))
modImplementation(fabricApi.module("fabric-command-api-v2", project.fabric_version))
modImplementation(fabricApi.module("fabric-lifecycle-events-v1", project.fabric_version))
modImplementation(fabricApi.module("fabric-message-api-v1", project.fabric_version))
include(implementation("net.dv8tion:JDA:5.0.0-beta.24"){
exclude module: "opus-java"
})
include("net.sf.trove4j:core:3.1.0")
include("org.apache.commons:commons-collections4:4.4")
include("com.fasterxml.jackson.core:jackson-core:2.17.0")
include("com.fasterxml.jackson.core:jackson-databind:2.17.0")
include("com.fasterxml.jackson.core:jackson-annotations:2.17.0")
include("com.squareup.okhttp3:okhttp:4.12.0")
include('com.squareup.okio:okio-jvm:3.4.0')
include("com.neovisionaries:nv-websocket-client:2.14")
// for "squareup" libs (they all use kotlin)
modLocalRuntime("net.fabricmc:fabric-language-kotlin:1.10.20+kotlin.1.9.24")
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version,
"mcversion": "1.21-beta.3"
}
}
java {
withSourcesJar()
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
}
tasks.withType(AbstractArchiveTask) {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
}
task buildOrPublish {
group = "build"
String mavenUser = System.getenv().MAVEN_USER
if (mavenUser != null && !mavenUser.isEmpty()) {
dependsOn(tasks.getByName("publish"))
println("prepared for publish")
} else {
dependsOn(tasks.getByName("build"))
println("prepared for build")
}
}
publishing {
publications {
maven(MavenPublication) {
groupId = project.maven_group
artifactId = project.archives_base_name
version = "${project.mod_version}-rev.${grgit.head().abbreviatedId}"
from components.java
}
}
repositories {
maven {
url = "https://mvn.devos.one/${System.getenv().PUBLISH_SUFFIX}/"
credentials {
username = System.getenv().MAVEN_USER
password = System.getenv().MAVEN_PASS
}
authentication { basic(BasicAuthentication) }
}
}
}