-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
98 lines (83 loc) · 2.6 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
plugins {
id "java"
id "java-gradle-plugin"
id "maven-publish"
}
// CI nonsense //
String buildContext = "Local"
if(System.getenv("GITHUB_SHA") != null) {
String hash = System.getenv("GITHUB_SHA")
if(hash.length() > 8) hash = hash.substring(0, 8)
buildContext = "Github Actions CI, commit " + hash
}
if(System.getenv("VOLDE_RELEASE_MODE") == null) {
version += "-SNAPSHOT"
}
//for now, stick to Java 8
sourceCompatibility = targetCompatibility = "1.8"
repositories {
maven {
name = "fabric"
url = "https://maven.fabricmc.net/"
mavenContent {
includeGroup "net.fabricmc"
}
}
mavenCentral()
}
dependencies {
implementation gradleApi()
//java staples
compileOnly "org.jetbrains:annotations:24.0.1"
implementation "com.google.code.gson:gson:2.8.5"
//bytecode
// implementation "org.ow2.asm:asm:9.6" //pulled in by tiny-remapper, might as well use theirs
// implementation "org.ow2.asm:asm-commons:9.6"
// implementation "org.ow2.asm:asm-tree:9.6"
//mappings
implementation "net.fabricmc:mapping-io:0.5.0"
implementation "net.fabricmc:tiny-remapper:0.10.3" //pulls in asm 9.6
implementation "org.cadixdev:lorenz:0.5.7"
implementation "org.cadixdev:lorenz-io-proguard:0.5.7"
//access wideners
implementation "net.fabricmc:access-widener:2.1.0"
}
jar {
manifest {
//Reading from project.version is deprecated in Gradle 7 lol
String ver = project.respondsTo("archivesVersion") ? project.archivesVersion : project.version
attributes "Implementation-Version": "${ver} (build ctx: ${buildContext})"
}
}
gradlePlugin {
plugins {
"${name}" {
id = "${group}.${name}"
implementationClass = "agency.highlysuspect.minivan.MinivanPlugin"
}
}
}
publishing {
publications {
plugin(MavenPublication) { publication ->
groupId project.group
artifactId project.archivesBaseName
version project.version
from components["java"]
}
}
repositories {
if (project.hasProperty("publish-username")) {
maven {
url "https://repo-api.sleeping.town/"
credentials {
username project.hasProperty("publish-username") ? project.getProperty("publish-username") : null
password project.hasProperty("publish-password") ? project.getProperty("publish-password") : null
}
}
}
maven {
url file("build/maven").toURI().toString()
}
}
}