forked from ReplayMod/ReplayStudio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
118 lines (100 loc) · 3.34 KB
/
build.gradle
File metadata and controls
118 lines (100 loc) · 3.34 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
buildscript {
repositories {
mavenCentral()
gradlePluginPortal()
maven {
url 'https://oss.sonatype.org/content/groups/staging'
}
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'ch.raffael.gradlePlugins.preshadow:gradle-preshadow-plugin:1.0'
classpath 'gradle.plugin.com.github.johnrengelman:shadow:7.1.0'
classpath 'com.github.johni0702:gradle-reproducible-builds-plugin:3dbf20d'
}
}
defaultTasks 'publishToMavenLocal'
apply plugin: 'java-library'
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'maven-publish'
apply plugin: 'ch.raffael.preshadow'
apply plugin: 'de.johni0702.reproducible-builds'
def gitCommitHash() {
try {
def out = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = out
}
return out.toString().trim()
} catch (e) {
return "unknown"
}
}
group = 'com.replaymod.replaystudio'
description = 'ReplayStudio'
version = gitCommitHash()
mainClassName = 'com.replaymod.replaystudio.launcher.Launcher'
ext.projectName = 'ReplayStudio'
ext.packaging = 'jar'
ext.author = 'johni0702'
ext.authorUrl = 'https://github.com/johni0702'
java.toolchain.languageVersion.set(JavaLanguageVersion.of(8))
compileJava {
options.encoding = 'UTF-8'
}
repositories {
mavenCentral()
maven {
url 'https://jitpack.io'
}
maven {
url 'https://repo.viaversion.com'
}
maven {
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url 'https://jitpack.io'
}
}
dependencies {
preshadow 'com.github.replaymod.viaversion:viaversion-common:67f4a39a2'
preshadow 'com.google.guava:guava:17.0'
implementation 'com.google.code.gson:gson:2.3.1'
implementation 'it.unimi.dsi:fastutil:8.3.1' // this is the version MC ships with 1.14.4, upgrade with care
implementation 'com.github.viaversion:opennbt:0a02214' // 2.0-SNAPSHOT (ViaVersion Edition)
preshadow 'com.github.steveice10:packetlib:614d56cdc0' // 1.3
implementation 'org.apache.commons:commons-lang3:3.3.2'
implementation 'org.apache.commons:commons-collections4:4.0'
implementation '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'
}
preshadowJar {
relocate 'io.netty', 'com.github.steveice10.netty'
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'
}
shadowJar {
archiveClassifier.set("full")
append('META-INF/NOTICE.txt')
from(tasks.findByName('preshadowJar').outputs.files.collect {it.isDirectory() ? it : zipTree(it)})
}
build.dependsOn shadowJar
jar.manifest.mainAttributes(
'Main-Class': mainClassName,
'Implementation-Title': description,
'Implementation-Version': gitCommitHash()
)
publishing {
publications {
maven(MavenPublication) {
from(components.java)
}
}
}