forked from FallingColors/hexdummy
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
160 lines (134 loc) · 4.67 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
plugins {
id "architectury-plugin" version "3.4.+"
id "dev.architectury.loom" version "1.6.+" apply false
id "org.jetbrains.kotlin.jvm" version "1.8.0" apply false
// for template.env api keys
id "co.uzzu.dotenv.gradle" version "2.0.0"
}
architectury {
minecraft = project.minecraftVersion
}
subprojects {
apply plugin: "org.jetbrains.kotlin.jvm"
apply plugin: "dev.architectury.loom"
// Uncomment to silence the mojmap license warning
// loom {
// silentMojangMappingsLicense()
// }
dependencies {
minecraft "com.mojang:minecraft:${project.minecraftVersion}"
mappings "net.fabricmc:yarn:1.19.2+build.28:v2"
// Or feel free to use any other mappings you prefer
modImplementation "net.fabricmc:fabric-loader:${project.fabricLoaderVersion}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabricApiVersion}"
modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabricKotlinVersion}"
modCompileOnly "maven.modrinth:hexal:${hexalVersion}"
annotationProcessor "org.ow2.asm:asm:${project.asmVersion}"
annotationProcessor "org.ow2.asm:asm-analysis:${project.asmVersion}"
annotationProcessor "org.ow2.asm:asm-commons:${project.asmVersion}"
annotationProcessor "org.ow2.asm:asm-tree:${project.asmVersion}"
annotationProcessor "org.ow2.asm:asm-util:${project.asmVersion}"
}
sourceSets.main.kotlin.srcDirs += 'src/main/java'
sourceSets.main.resources.srcDirs += "src/generated/resources"
}
allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"
version = project.modVersion
group = project.mavenGroup
repositories {
maven { url 'https://jitpack.io' }
maven {
url "https://squiddev.cc/maven/"
}
maven { url "https://maven.terraformersmc.com/" }
maven { url "https://maven.terraformersmc.com/releases" }
maven { url "https://maven.shedaniel.me/" }
// Hex Casting Dependencies
maven { url "https://maven.blamejared.com/" }
maven {
name "entity reach"
url "https://maven.jamieswhiteshirt.com/libs-release/"
}
maven { url "https://mvn.devos.one/snapshots/" }
maven {
name = 'Ladysnake Mods'
url = 'https://maven.ladysnake.org/releases'
}
maven {
name = 'Kotlin for Forge'
url = 'https://thedarkcolour.github.io/KotlinForForge/'
}
maven {
url = "https://maven.theillusivec4.top/"
}
maven {
name = 'GeckoLib'
url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/'
}
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
filter {
includeGroup "maven.modrinth"
}
}
// Add any other repositories with your cross-platform dependency mods
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = 17
}
java {
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
java.withSourcesJar()
java.withJavadocJar()
}
sourcesJar {
duplicatesStrategy 'exclude'
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.release = 17
}
// Disables Gradle's custom module metadata from being published to maven. The
// metadata includes mapped dependencies which are not reasonably consumable by
// other mod developers.
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
processResources {
exclude '.cache'
}
processTestResources {
exclude '.cache'
}
}
ext.getArtifactId = { platform -> return "$modID-$platform-$minecraftVersion" }
ext.getLatestChangelog = {
Collection<String> lines = file("$rootDir/CHANGELOG.md").readLines()
String changelog = ""
Boolean atSegment = false
for (String line : lines) {
if (line.startsWith("## ")) {
if (atSegment) break // hit next segment
atSegment = true
}
if (atSegment) changelog += "$line\n"
}
return changelog.trim()
}
ext.bookPath = "data/oneironaut/patchouli_books/oneironautbook"
tasks.register("viewLatestChangelog") {
group "documentation"
description "Print the topmost single version section from the full CHANGELOG.md file."
doLast {
println(getLatestChangelog())
}
}