-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
108 lines (91 loc) · 2.77 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
plugins {
id 'java-library'
id 'maven-publish'
}
repositories {
mavenCentral()
maven {
url "https://repo.spongepowered.org/maven/"
}
maven {
url "https://maven.fabricmc.net/"
}
maven {
url 'https://jitpack.io'
}
}
sourceCompatibility = 17
targetCompatibility = 17
compileJava.options.release.set(17)
version = project_version
group = "com.qendolin.mindustryloader"
archivesBaseName = "mindustry-fabric-loader"
dependencies {
// Copied from https://github.com/FabricMC/fabric-loader/blob/master/build.gradle
testImplementation 'org.jetbrains:annotations:22.0.0'
api "net.fabricmc:fabric-loader:${loader_version}"
api "org.ow2.asm:asm:${project.asm_version}"
api "org.ow2.asm:asm-analysis:${project.asm_version}"
api "org.ow2.asm:asm-commons:${project.asm_version}"
api "org.ow2.asm:asm-tree:${project.asm_version}"
api "org.ow2.asm:asm-util:${project.asm_version}"
api("net.fabricmc:sponge-mixin:${project.mixin_version}") {
exclude module: 'launchwrapper'
exclude group: 'com.google.guava'
exclude group: 'com.google.code.gson'
}
api 'net.fabricmc:access-widener:2.1.0'
api "io.github.llamalad7:mixinextras-fabric:${mixin_extras_version}"
}
java {
withSourcesJar()
}
task exportDependencies(type: Copy) {
doFirst {
delete "fabric-dependencies"
}
configurations.implementation.setCanBeResolved(true)
configurations.api.setCanBeResolved(true)
from configurations.implementation {
exclude group: "com.google.guava"
exclude group: "com.google.code.gson"
exclude group: "org.jetbrains"
}
into "fabric-dependencies"
}
jar {
manifest {
attributes(
'Class-Path': configurations.runtimeClasspath.collect { it.getName() }.join(' '),
'Specification-Version': 8.0,
'Multi-Release': 'true'
)
}
}
sourceSets {
main {
java {
srcDir 'src'
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact(jar)
artifact(sourcesJar)
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
//Iterate over the compile dependencies (we don't want the test ones), adding a <dependency> node for each
configurations.implementation.allDependencies.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
repositories {
}
}