-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.gradle
102 lines (86 loc) · 2.61 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
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '6+', changing: true
}
}
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
apply plugin: 'net.minecraftforge.gradle'
apply from: 'minecraft.gradle'
def getGitRef() {
try {
final def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
} catch (final Throwable ignored) {
return 'unknown'
}
}
version = "${semver}+${getGitRef()}"
group = 'li.cil.sedna'
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
repositories {
mavenCentral()
final def GithubPackages = [
["fnuecke/ceres", "li.cil.ceres"],
["fnuecke/sedna", "li.cil.sedna"],
["fnuecke/buildroot", "li.cil.sedna"]
]
GithubPackages.each { final repo, final group ->
maven {
url = uri("https://maven.pkg.github.com/${repo}")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GPR_USER")
password = project.findProperty("gpr.key") ?: System.getenv("GPR_KEY")
}
content { includeGroup group }
}
}
}
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
implementation('li.cil.ceres:ceres:0.0.4') { transitive = false }
implementation('li.cil.sedna:sedna:2.0.9') { transitive = false }
implementation('li.cil.sedna:sedna-buildroot:0.0.8') { transitive = false }
}
minecraft {
mappings channel: 'official', version: minecraft_version
}
jar {
finalizedBy 'shadowJar'
manifest {
attributes([
'Specification-Title' : 'sedna',
'Specification-Vendor' : 'Sangar',
'Specification-Version' : '1',
'Implementation-Title' : project.name,
'Implementation-Version' : "${semver}",
'Implementation-Vendor' : 'Sangar',
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
shadowJar {
finalizedBy 'reobfJar'
dependencies {
include(dependency('li.cil.ceres:ceres:.*'))
include(dependency('li.cil.sedna:sedna:.*'))
include(dependency('li.cil.sedna:sedna-buildroot:.*'))
}
archiveClassifier.set('')
}
reobf {
shadowJar {}
}
artifacts {
archives shadowJar
}