forked from architectury/tiny-remapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
117 lines (98 loc) · 2.39 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
plugins {
id 'java-library'
id 'maven-publish'
// id 'checkstyle'
id 'com.diffplug.spotless' version '6.12.1'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'dev.fastmc.maven-repo' version '1.0.0'
}
//version = '1.8.' + (System.getenv("GITHUB_RUN_NUMBER") ?: "9999")
version = '1.9-SNAPSHOT'
def ENV = System.getenv()
group = 'dev.architectury'
archivesBaseName = 'tiny-remapper'
repositories {
mavenCentral()
}
dependencies {
api 'org.ow2.asm:asm:9.4'
api 'org.ow2.asm:asm-commons:9.4'
implementation 'org.ow2.asm:asm-tree:9.4'
implementation 'org.ow2.asm:asm-util:9.4'
implementation 'it.unimi.dsi:fastutil:7.1.0'
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.0'
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
withSourcesJar()
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
if (JavaVersion.current().isJava9Compatible()) {
it.options.release = 8
}
}
shadowJar {
relocate 'net.fabricmc.tinyremapper', 'dev.architectury.tinyremapper'
archiveClassifier = null
configurations = [project.configurations.runtimeClasspath]
}
test {
useJUnitPlatform()
testLogging {
showStandardStreams = true
exceptionFormat = 'full'
events = ['passed', 'failed', 'skipped']
}
}
jar {
manifest {
attributes 'Implementation-Title': 'TinyRemapper',
'Implementation-Version': archiveVersion,
'Main-Class': "dev.architectury.tinyremapper.Main"
}
archiveClassifier = 'raw'
}
//checkstyle {
// configFile = file("checkstyle.xml")
// toolVersion = '8.31'
//}
spotless {
ratchetFrom 'origin/master'
enforceCheck false
java {
licenseHeaderFile(rootProject.file('HEADER')).yearSeparator(', ')
}
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact shadowJar
}
}
repositories {
if (ENV.MAVEN_URL) {
maven {
url ENV.MAVEN_URL
credentials {
username ENV.MAVEN_USERNAME
password ENV.MAVEN_PASSWORD
}
}
}
}
}
// A task to ensure that the version being released has not already been released.
task checkVersion {
doFirst {
def xml = new URL("https://maven.fabricmc.net/net/fabricmc/tiny-remapper/maven-metadata.xml").text
def metadata = new XmlSlurper().parseText(xml)
def versions = metadata.versioning.versions.version*.text();
if (versions.contains(version)) {
throw new RuntimeException("${version} has already been released!")
}
}
}
publish.mustRunAfter checkVersion