forked from iPortalTeam/ImmersivePortalsMod
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
221 lines (181 loc) · 6.39 KB
/
Copy pathbuild.gradle
File metadata and controls
221 lines (181 loc) · 6.39 KB
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
plugins {
id 'fabric-loom' version '0.5-SNAPSHOT'
id 'maven-publish'
}
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
subprojects {
apply plugin: 'fabric-loom'
apply plugin: 'maven-publish'
}
minecraft {
accessWidener = file("src/main/resources/imm_ptl_peripheral.accesswidener")
}
repositories {
flatDir {
dirs 'deps'
}
}
allprojects {
loom {
shareCaches = true
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
version = rootProject.mod_version
repositories {
mavenCentral()
mavenLocal()
maven {
url 'http://maven.fabricmc.net/'
name 'Fabric'
}
maven {
name = 'JitPack'
url = 'https://jitpack.io'
}
jcenter()
}
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
dependencies {
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}"
//For Nullable
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
modCompileOnly "me.shedaniel.cloth:config-${cloth_config_version}"
modCompileOnly "io.github.prospector:modmenu:${modmenu_version}"
modImplementation 'com.github.Virtuoel:Pehkui:1.17-SNAPSHOT'
modCompileOnly 'com.github.qouteall:sodium-fabric:compat_next_1_16_4-SNAPSHOT'
// modCompileOnly 'com.github.qouteall:sodium-fabric:compat_next_1_16_4-SNAPSHOT'
// modImplementation("me.jellysquid.mods:sodium:0.1.1-SNAPSHOT")
}
afterEvaluate {
remapJar {
input = file("${project.buildDir}/libs/$archivesBaseName-${version}-dev.jar")
archiveName = "${archivesBaseName}-${version}-mc${project.minecraft_version}-fabric.jar"
}
artifacts {
//dev file: file("${project.buildDir}/libs/$archivesBaseName-${version}-dev.jar"), type: "jar", builtBy: jar
}
processResources {
inputs.property "version", project.version
from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"
expand "version": project.version
}
from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
}
}
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}
}
jar {
from "LICENSE"
}
subprojects {
publishing {
publications {
mavenJava(MavenPublication) {
afterEvaluate {
artifact(file("${project.buildDir}/libs/$archivesBaseName-${version}-mc${project.minecraft_version}-fabric.jar")) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}
}
}
}
subprojects.each { remapJar.dependsOn("${it.path}:remapJar") }
publishing {
publications {
mavenJava(MavenPublication) {
artifact(file("${project.buildDir}/libs/$archivesBaseName-${version}-mc${project.minecraft_version}-fabric.jar")) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
pom.withXml {
def depsNode = asNode().appendNode("dependencies")
subprojects.each {
def depNode = depsNode.appendNode("dependency")
depNode.appendNode("groupId", it.group)
depNode.appendNode("artifactId", it.name)
depNode.appendNode("version", it.version)
depNode.appendNode("scope", "compile")
}
}
}
}
}
repositories {
}
dependencies {
modImplementation "me.shedaniel.cloth:config-${cloth_config_version}"
modImplementation "io.github.prospector:modmenu:${modmenu_version}"
include "me.shedaniel.cloth:config-${cloth_config_version}"
include "io.github.prospector:modmenu:${modmenu_version}"
//make the game launch faster in dev
modRuntime("com.github.SuperCoder7979:databreaker:master-SNAPSHOT") {
exclude module: "fabric-loader"
}
// OptiFine
// modImplementation 'com.github.qouteall:OptiFabric:llama-SNAPSHOT'
// modImplementation "com.github.Chocohead:Fabric-ASM:v2.1"
// compile 'org.zeroturnaround:zt-zip:1.13'
// compile('net.fabricmc:stitch:0.5.1+build.77') {
// transitive = false
// }
afterEvaluate {
subprojects.each {
compile project(path: ":${it.name}")
include project("${it.name}:")
}
}
// fileTree(dir: 'deps', include: '*.jar').each {
// String baseName = it.name.replace(".jar", "")
// String version = "0.1.0"
// int split = baseName.lastIndexOf('-')
//
// if (split != -1) {
// version = baseName.substring(split + 1)
// baseName = baseName.substring(0, split)
// }
//
// String name = "testmod:${baseName}:${version}"
//
// System.out.println("Found test mod: " + it.name.replace(".jar", "") + " -> " + name)
//
// modImplementation name
//// modCompileOnly name
//// modRuntime name
// }
}
task printClasspath {
doLast {
// NOTE don't forget to exclude the submod dev jar
configurations.compileClasspath.each { println "\"" + (it.toString().replace("\\", "/")) + "\"," }
}
}
task additionalCopy(type:Copy){
from file("${project.buildDir}/libs/$archivesBaseName-${version}-mc${project.minecraft_version}-fabric.jar")
into file("${project.buildDir}/to_upload")
}