forked from PuzzleLoader/ExampleMod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
103 lines (84 loc) · 2.69 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
plugins {
id 'java'
id 'jigsaw'
id 'maven-publish'
id 'com.github.johnrengelman.shadow'
id 'org.jetbrains.kotlin.jvm'
}
group = "com.github"
loom {
splitEnvironmentSourceSets()
mods {
"puzzle-language-kotlin" {
sourceSet sourceSets.main
sourceSet sourceSets.client
}
}
}
repositories {
mavenCentral()
maven { url = "https://jitpack.io" }
}
def LIBRARY_VERSIONS_FILE = "generated/library_versions.json"
def KOTLIN_VERSION_FILE = "generated/kotlin_version.txt"
def kotlinLib = "org.jetbrains.kotlin:kotlin-stdlib"
def libraries = [
kotlinLib,
"org.jetbrains.kotlin:kotlin-stdlib-jdk8",
"org.jetbrains.kotlin:kotlin-stdlib-jdk7",
"org.jetbrains.kotlin:kotlin-reflect",
"org.jetbrains.kotlinx:kotlinx-coroutines-core",
"org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm",
"org.jetbrains.kotlinx:kotlinx-coroutines-jdk8",
"org.jetbrains.kotlinx:kotlinx-serialization-core-jvm",
"org.jetbrains.kotlinx:kotlinx-serialization-json-jvm",
"org.jetbrains.kotlinx:kotlinx-serialization-cbor-jvm",
"org.jetbrains.kotlinx:atomicfu-jvm",
"org.jetbrains.kotlinx:kotlinx-datetime-jvm"
]
import groovy.json.JsonSlurper
def libVersions = new JsonSlurper().parse(file(LIBRARY_VERSIONS_FILE))
def hasMissingLibVersion = !libVersions.keySet().containsAll(libraries)
def kotlinVersion = file(KOTLIN_VERSION_FILE).text
dependencies {
libraries.forEach {
bundle("${it}:${libVersions[it]}")
}
bundle("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
cosmicReach("finalforeach:cosmicreach:${cosmic_reach_version}")
}
version = modVersion + "+kotlin." + kotlinVersion
processResources {
def resourceTargets = [ // Locations of where to inject the properties
"puzzle.mod.json"
]
// Left item is the name in the target, right is the variable name
def replaceProperties = [
"mod_version" : modVersion,
"mod_desc" : desc,
"mod_name" : project.name,
"mod_id" : id,
]
inputs.properties replaceProperties
replaceProperties.put "project", project
filesMatching(resourceTargets) {
expand replaceProperties
}
}
kotlin {
jvmToolchain(17)
}
publishing {
publications {
maven(MavenPublication) {
groupId = group
artifactId = id
artifact source: buildMergedBundleJar, classifier: 'client', extension: 'jar'
artifact source: buildServerBundleJar, classifier: 'server', extension: 'jar'
}
}
}
wrapper {
gradleVersion = "8.5"
distributionType = Wrapper.DistributionType.ALL
}