-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
207 lines (168 loc) · 5.62 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
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
plugins {
id("fabric-loom") version("0.5-SNAPSHOT")
id("maven-publish")
id("com.dorongold.task-tree") version "1.5"
id "com.jfrog.bintray" version "1.8.5"
// id "io.github.febb.febbgradle" version "1.1.3"
}
apply plugin: FebbAssembly
//febb {
//// minecraftVersion = minecraft_version
//// yarnBuild = mappings_build
// def manifest = project.file("build/febbAssembly/$minecraft_version/abstracted/directOutput/abstractionManifest.json")
// //TODO: not a very good solution, need a way to run abstraction before febbgradle does its stuff
// if(!manifest.exists()){
// manifest.parentFile.mkdirs()
// manifest.write("{}")
// }
// customAbstractionManifest = manifest
//}
test {
workingDir = 'testRun'
}
repositories {
maven {
url = 'https://raw.githubusercontent.com/Devan-Kerman/Devan-Repo/master/'
}
maven { url = "https://dl.bintray.com/febb/maven" }
maven {
url 'https://jitpack.io'
content {
// this repository *only* contains artifacts with group "my.company"
includeGroup "net.devtech"
includeGroup "com.github.Chocohead"
}
}
flatDir {
dirs 'mods/'
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
def totalVersion = "$minecraft_version+$mappings_build-$api_build"
group 'io.github.febb'
version totalVersion
archivesBaseName = "api"
sourceSets {
testmod {
compileClasspath += main.compileClasspath
runtimeClasspath += main.runtimeClasspath
}
test {
compileClasspath += main.compileClasspath
runtimeClasspath += main.runtimeClasspath
}
}
dependencies {
// fabric
minecraft("com.mojang:minecraft:$minecraft_version")
mappings("net.fabricmc:yarn:$minecraft_version+build.$mappings_build:v2")
modImplementation("net.fabricmc:fabric-loader:$loader_version")
modImplementation "net.fabricmc.fabric-api:fabric-api:$fabric_version"
// api
compileOnly(files("$project.buildDir/febbAssembly/$project.minecraft_version/abstracted/api.jar"))
// nanoevents (includes fasm)
modImplementation "net.devtech:NanoEvents:$nano_events_ver"
testmodCompileOnly 'net.devtech:nanoevents-ap:1.0.4'
compileOnly 'net.devtech:nanoevents-ap:1.0.4'
annotationProcessor 'net.devtech:nanoevents-ap:1.0.4'
testmodAnnotationProcessor 'net.devtech:nanoevents-ap:1.0.4'
// https://mvnrepository.com/artifact/org.jetbrains/annotations
compileOnly 'org.jetbrains:annotations:19.0.0'
fileTree(dir: 'mods', 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
testImplementation name
testmodImplementation name
}
testImplementation group: 'junit', name: 'junit', version: '4.12'
afterEvaluate {
testmodCompile project
testCompile project
//testmodCompile project("${it.name}:").sourceSets.testmod.output
}
}
processTestmodResources {
inputs.property "version", project.version
from(sourceSets.testmod.output.classesDirs.singleFile) {
include "nanoevents/**"
}
from(sourceSets.testmod.resources.srcDirs) {
include "fabric.mod.json"
expand "version": project.version
}
from(sourceSets.testmod.resources.srcDirs) {
exclude "fabric.mod.json"
}
}
processResources {
inputs.property "version", project.version
from(sourceSets.main.output.classesDirs.singleFile) {
include "nanoevents/**"
}
from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"
expand "version": project.version
}
from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
}
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
groupId 'io.github.febb'
artifactId "api"
version totalVersion
def artifacts = FebbAssembly.Companion.artifacts
artifact(remapJar) {
builtBy remapJar
classifier "impl-fabric"
}
artifact(artifacts.apiBinariesJar) {
classifier "api"
}
artifact(artifacts.apiSourcesJar) {
classifier "api-sources"
}
artifact(artifacts.abstractionManifestJar) {
artifact(artifacts.apiBinariesJar) {
classifier "api"
}
artifact(artifacts.apiSourcesJar) {
classifier "api-sources"
}
artifact(artifacts.abstractionManifestJar) {
classifier "dev-manifest"
}
}
}
}
}
bintray {
user = project.hasProperty('bintray_user') ? project.property('bintray_user') : ""
key = project.hasProperty('bintray_api_key') ? project.property('bintray_api_key') : ""
publications = ["mavenJava"]
publish = true //[Default: false] Whether version should be auto published after an upload
pkg {
repo = "maven"
name = "Febb-Api"
userOrg = "febb"
licenses = ["LGPLv3"]
version {
name = totalVersion
released = new Date()
}
}
}