-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
51 lines (46 loc) · 1.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
plugins {
id "base"
id "maven-publish"
}
group = "dev.architectury"
def runNumber = (System.getenv("GITHUB_RUN_NUMBER") == null ? "9999" : System.getenv("GITHUB_RUN_NUMBER"))
def publishingVersions = project.publishing_versions.split(",")
["neoforge", "forge"].each { loader ->
fileTree("mappings/$loader").filter { it.isFile() }.each { file ->
def version = file.name.substring(0, file.name.lastIndexOf("."))
if (publishingVersions.find { it == version } == null) return
def task = tasks.register("jar${loader.capitalize()}$version", Zip) {
from(file) {
into("mappings")
rename { "mappings.tiny" }
}
archiveExtension = "jar"
archivesBaseName = "yarn-mappings-patch-$loader"
archiveVersion = "$version+build.$runNumber"
metadataCharset "UTF-8"
destinationDirectory = base.libsDirectory
}
publishing {
publications {
create("maven${loader.capitalize()}$version", MavenPublication) {
artifactId = "yarn-mappings-patch-$loader"
it.version = "$version+build.$runNumber"
artifact(task)
}
}
}
}
}
publishing {
repositories {
if (System.getenv("MAVEN_PASS") != null) {
maven {
url = "https://deploy.shedaniel.me/"
credentials {
username = "shedaniel"
password = System.getenv("MAVEN_PASS")
}
}
}
}
}