This repository has been archived by the owner on Sep 4, 2022. It is now read-only.
forked from QuiltMC/mappings-hasher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
85 lines (73 loc) · 2.18 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
plugins {
id 'java'
id 'application'
id 'maven-publish'
id "com.github.johnrengelman.shadow" version "7.0.0"
}
group 'me.shedaniel.quiltmc'
def runNumber = System.getenv("GITHUB_RUN_NUMBER") ?: "9999"
version "1.0.$runNumber"
// Target JDK 8
tasks.withType(JavaCompile).configureEach {
if (JavaVersion.current().isJava9Compatible()) {
options.release.set(8)
} else {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
application {
mainClass = 'me.shedaniel.quiltmc.mappings_hasher.Main'
}
repositories {
mavenCentral()
maven {
name = "Quilt"
url = "https://maven.quiltmc.org/repository/release"
}
}
dependencies {
shadow 'org.quiltmc:quilt-json5:1.0.0'
shadow 'org.quiltmc:lorenz-tiny:3.0.0'
shadow 'org.cadixdev:lorenz-io-proguard:0.5.6'
shadow "org.ow2.asm:asm:9.1"
}
tasks.getByName("run").setArgsString(minecraftVersion)
jar {
archiveClassifier = "raw"
}
shadowJar {
archiveClassifier = null
configurations = [project.configurations.shadow]
relocate "org.quiltmc", "me.shedaniel.mappings_hasher.quiltmc"
relocate "net.fabricmc", "me.shedaniel.mappings_hasher.fabricmc"
relocate "org.cadixdev", "me.shedaniel.mappings_hasher.cadixdev"
relocate "org.objectweb.asm", "me.shedaniel.mappings_hasher.asm"
relocate "me.jamiemansfield", "me.shedaniel.mappings_hasher.jamiemansfield"
}
[configurations.apiElements, configurations.runtimeElements].each { config ->
(components.java as AdhocComponentWithVariants).withVariantsFromConfiguration(config) {
configurationVariant.artifacts.removeIf { artifact ->
artifact.file == tasks.jar.archiveFile.get().asFile
}
}
}
publishing {
publications {
maven(MavenPublication) {
artifact tasks.shadowJar
}
}
repositories {
def ENV = System.getenv()
if (ENV.MAVEN_PASS) {
maven {
url = "https://deploy.shedaniel.me/"
credentials {
username = "shedaniel"
password = ENV.MAVEN_PASS
}
}
}
}
}