forked from sisby-folk/starcaller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
125 lines (110 loc) · 3 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
118
119
120
121
122
123
124
125
//file:noinspection GroovyAssignabilityCheck
//file:noinspection GroovyAccessibility
buildscript {
dependencies {
classpath "com.modrinth.minotaur:Minotaur:${libs.versions.minotaur.get()}"
classpath "com.github.breadmoirai:github-release:${libs.versions.githubRelease.get()}"
}
}
plugins {
id 'maven-publish'
alias libs.plugins.loom
}
version = "$project.baseVersion+$project.branch"
archivesBaseName = project.name
group = 'folk.sisby'
repositories {
mavenLocal()
maven { url 'https://maven.fabricmc.net/'}
maven { url 'https://repo.sleeping.town/'}
maven { url "https://maven.terraformersmc.com/" }
}
dependencies {
minecraft libs.mc
mappings variantOf(libs.yarn) { classifier "v2" }
modImplementation libs.fl
modImplementation libs.fapi
modImplementation libs.kaleidoConfig
modImplementation libs.lib39core
modImplementation libs.lib39sandman
include libs.kaleidoConfig
include libs.lib39core
include libs.lib39sandman
}
processResources {
final Map<String, String> map = [
"version" : version.toString(),
"mc" : libs.versions.mc.get(),
"fl" : libs.versions.fl.get(),
"kaleidoConfig": libs.versions.kaleidoConfig.get(),
"fapi" : libs.versions.fapi.get(),
"lib39" : libs.versions.lib39.get(),
]
inputs.properties(map)
filesMatching('*.mod.json') { expand(map) }
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
it.options.release = 17
}
java {
withSourcesJar()
}
jar {
from("LICENSE.txt") {
rename { "${it}_${archivesBaseName}" }
}
}
loom {
accessWidenerPath = file("src/main/resources/starcaller.accesswidener")
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
if (System.getenv("MODRINTH_TOKEN") && file("CHANGELOG.md").exists() ) {
apply plugin: "com.modrinth.minotaur"
modrinth {
token = System.getenv("MODRINTH_TOKEN")
projectId = 'starcaller'
versionNumber = project.version
versionName = baseVersion
versionType = 'release'
uploadFile = remapJar
gameVersions = [libs.versions.mc.get()]
loaders = ['quilt', 'fabric']
detectLoaders = false
dependencies {
}
changelog = rootProject.file("CHANGELOG.md").text + "\n\nChangelog: https://github.com/sisby-folk/$project.name/releases/tag/v$baseVersion"
syncBodyFrom = rootProject.file("README.md").text
}
}
if (System.getenv("GITHUB_TOKEN") && file("CHANGELOG.md").exists()) {
apply plugin: "com.github.breadmoirai.github-release"
githubRelease {
token System.getenv("GITHUB_TOKEN")
owner "sisby-folk"
repo "starcaller"
tagName 'v' + baseVersion
releaseName baseVersion
targetCommitish defaultBranch
draft false
prerelease false
releaseAssets remapJar.archiveFile
allowUploadToExisting true
generateReleaseNotes true
body rootProject.file("CHANGELOG.md").text
}
tasks.githubRelease.dependsOn remapJar
}
if (System.getenv("MODRINTH_TOKEN") && System.getenv("GITHUB_TOKEN")) {
tasks.register("fullRelease") {
group "publishing"
dependsOn "githubRelease"
dependsOn "modrinth"
}
}