forked from ReplayMod/ReplayStudio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
132 lines (109 loc) · 3.42 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
plugins {
id 'java-library'
id 'maven-publish'
id 'application'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'net.minecraftforge.gradleutils' version '2.+'
id 'dev._100media.gradleutils' version '1.+'
}
group = 'dev._100media.replaymod.replaystudio'
description = 'ReplayStudio'
version = gradleutils.getTagOffsetBranchVersion(null)
println('Version: ' + version)
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
application {
mainClass = 'com.replaymod.replaystudio.launcher.Launcher'
}
compileJava {
options.encoding = 'UTF-8'
}
repositories {
mavenCentral()
maven {
url 'https://jitpack.io'
content {
includeGroupByRegex 'com\\.github\\..*'
}
}
maven {
url 'https://repo.viaversion.com'
}
maven {
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url 'https://jitpack.io'
}
}
configurations {
shade
apiShade
api.extendsFrom apiShade
shade.extendsFrom apiShade
implementation.extendsFrom shade
}
dependencies {
apiShade 'com.github.replaymod.viaversion:viaversion-common:88dd62c'
apiShade 'com.google.guava:guava:31.0.1-jre'
shade 'com.google.code.gson:gson:2.8.8'
shade 'it.unimi.dsi:fastutil:8.5.6' // this is the version MC ships with, upgrade with care
shade 'com.github.viaversion:opennbt:0a02214' // 2.0-SNAPSHOT (ViaVersion Edition)
apiShade 'com.github.steveice10:packetlib:614d56cdc0' // 1.3
shade 'org.apache.commons:commons-lang3:3.12.0'
shade 'org.apache.commons:commons-collections4:4.0'
shade 'commons-cli:commons-cli:1.2'
compileOnly(annotationProcessor("org.projectlombok:lombok:1.16.6"))
testImplementation 'junit:junit:4.11'
testImplementation 'com.google.guava:guava-testlib:18.0'
testImplementation 'pl.pragmatists:JUnitParams:1.0.4'
}
java {
withSourcesJar()
}
jar {
manifest {
attributes([
'Specification-Title': project.name,
'Specification-Vendor': 'johni0702',
'Specification-Version': gradleutils.gitInfo.tag,
'Main-Class': application.mainClass.get(),
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Implementation-Vendor': 'johni0702'
])
}
}
def relocateTargets = [
'org.apache.commons', 'org.slf4j', 'org.xbill.DNS',
'it.unimi.dsi.fastutil', 'com.github.steveice10.opennbt',
'com.github.steveice10.packetlib', 'com.google.gson',
'com.google.thirdparty', 'io.netty'
]
shadowJar {
archiveClassifier = 'fat'
minimize()
append 'META-INF/LICENSE.txt'
exclude 'LICENSE'
exclude '**/module-info.class'
relocate 'us.myles.ViaVersion.api', 'com.replaymod.replaystudio.lib.viaversion.legacyapi'
relocate 'com.viaversion.viaversion', 'com.replaymod.replaystudio.lib.viaversion'
relocate 'com.google.common', 'com.replaymod.replaystudio.lib.guava'
relocateTargets.forEach {
relocate it, "${project.group}.lib.$it"
}
}
assemble.dependsOn shadowJar
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
repositories {
maven hundredMedia.getPublishing100MediaMaven()
maven {
name = 'MCMods'
url = "file://${project.projectDir}/mcmodsrepo"
}
}
}