-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.gradle
163 lines (135 loc) · 4.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
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
plugins {
id 'java'
id 'maven-publish'
id 'jigsaw'
id 'com.github.johnrengelman.shadow'
}
group = 'com.github.PuzzlesHQ'
repositories {
mavenCentral()
maven { url "https://libraries.minecraft.net" }
maven {
url = "https://jitpack.io"
}
maven {
name = "meteor-maven"
url = "https://maven.meteordev.org/releases"
}
}
sourceSets {
loader
}
loom {
splitEnvironmentSourceSets()
accessWidenerPath = file("src/main/resources/puzzle_loader.manipulator")
mods {
"puzzle-loader" {
sourceSet sourceSets.main
sourceSet sourceSets.client
sourceSet sourceSets.loader
}
}
}
configurations {
allBundleBase
bundle.extendsFrom(allBundleBase)
implementation.extendsFrom(allBundleBase)
clientImplementation.extendsFrom(allBundleBase)
testImplementation.extendsFrom(allBundleBase)
allBundle
bundle.extendsFrom(allBundle)
implementation.extendsFrom(allBundle)
clientImplementation.extendsFrom(allBundle)
loaderImplementation.extendsFrom(allBundle)
testImplementation.extendsFrom(allBundle)
}
dependencies {
compileOnly('org.jetbrains:annotations:24.0.0')
loaderCompileOnly('org.jetbrains:annotations:24.0.0')
cosmicReach("finalforeach:cosmicreach:${cosmic_reach_client_version}")
allBundle(annotationProcessor("io.github.llamalad7:mixinextras-fabric:$mixinExtrasVersion"))
allBundle("com.google.guava:guava:$guavaVersion")
allBundle("com.google.code.gson:gson:$gsonVersion")
allBundle("org.hjson:hjson:$hjsonVersion")
bundle("com.mojang:brigadier:$brigadierVersion")
allBundle("org.apache.logging.log4j:log4j-api:$log4jVersion")
allBundle("org.apache.logging.log4j:log4j-core:$log4jVersion")
allBundle("org.apache.logging.log4j:log4j-slf4j2-impl:$log4jVersion")
allBundle("net.sf.jopt-simple:jopt-simple:$joptSimpleVersion")
allBundle("org.reflections:reflections:$reflectionsVersion")
bundle("meteordevelopment:orbit:$eventbusVersion")
// ASM
allBundle("org.ow2.asm:asm:$asmVersion")
allBundle("org.ow2.asm:asm-tree:$asmVersion");
allBundle("org.ow2.asm:asm-util:$asmVersion");
allBundle("org.ow2.asm:asm-analysis:$asmVersion");
allBundle("org.ow2.asm:asm-commons:$asmVersion");
allBundle("net.fabricmc:sponge-mixin:$mixinVersion");
allBundle("com.github.PuzzleLoader:access_manipulators:$accessManipulatorsVersion")
allBundle("org.jline:jline:3.25.0") // Maybe Remove
bundle("org.apache.commons:commons-lang3:3.17.0")
bundle("org.fusesource.jansi:jansi:2.2.0"){
exclude(group: "org.apache.commons", module: "commons-lang3") // use higher version above for paradox compat
}
allBundleBase(sourceSets.loader.output)
}
processResources {
def resourceTargets = ["assets/puzzle-loader/version.txt"]
String ver = version
if (!ver.contains(".")) {
ver = "69.69.69"
} else ver = (version + "").replaceAll((version + "").replaceAll("[\\d\\.]", ""), "")
def replaceProperties = [
"version" : ver,
]
inputs.properties replaceProperties
replaceProperties.put "project", project
filesMatching(resourceTargets) {
expand replaceProperties
}
}
//tasks.register("createPOM") {
// dependsOn(buildMergedBundleJar)
//
// doLast {
// File mvn = new File("$projectDir/maven");
// Util.delete(mvn)
// if (!mvn.exists()) mvn.mkdir();
//
// File pom = new File("$projectDir/maven/pom.xml")
// if (!pom.exists()) pom.createNewFile()
// pom.setText("""<project>
// <modelVersion>4.0.0</modelVersion>
// <groupId>""" + "io.github" + """</groupId>
// <artifactId>${id}</artifactId>
// <version>${version}</version>
// <name>${display}</name>
// <url>https://github.com/PuzzlesHQ/PuzzleLoader</url>
//</project>""")
//
// Hasher.createHashes(pom);
//
// File jar = new File("$projectDir/build/libs/PuzzleLoader-${version}-merged-bundle.jar");
// jar.renameTo("$projectDir/maven/puzzle-loader-${version}.jar")
//
// Hasher.createHashes(new File("$projectDir/maven/puzzle-loader-${version}.jar"));
// }
//
//// Util.zip(mvn, new File("$projectDir/build/component.zip"))
//
//}
publishing {
publications {
maven(MavenPublication) {
groupId = group
artifactId = id
artifact source: buildMergedBundleJar, classifier: 'client', extension: 'jar'
artifact source: buildServerBundleJar, classifier: 'server', extension: 'jar'
// artifact source: buildMergedBundleJar, extension: 'jar'
}
}
}
wrapper {
gradleVersion = "8.5"
distributionType = Wrapper.DistributionType.ALL
}