-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
109 lines (96 loc) · 3.06 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
plugins {
id 'fabric-loom' version '1.1-SNAPSHOT'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'com.palantir.git-version' version '3.0.0'
id 'com.modrinth.minotaur' version '2.+'
id 'io.github.themrmilchmann.curseforge-publish' version '0.4.0'
}
def git = versionDetails()
def prefix = 'v'
def tag
if (git.lastTag.startsWith(prefix)) {
tag = git.lastTag.substring(prefix.length())
} else {
tag = git.lastTag
}
if (hasProperty('ci')) {
switch (property('ci')) {
case 'release':
if (git.commitDistance != 0) {
throw new InvalidUserDataException('Not on a tag')
}
if (!git.lastTag.startsWith('v')) {
throw new InvalidUserDataException('Last tag was not a version tag')
}
version = "${tag}"
break
case 'snapshot':
version = "${tag}${tag.contains('-') ? '.' : '-'}SNAPSHOT.${git.commitDistance}.${git.branchName}.${git.gitHash}"
break
default:
throw new InvalidUserDataException("Invalid ci argument: ${property("ci")}")
}
} else {
version = "${tag}${tag.contains('-') ? '.' : '-'}SNAPSHOT.${git.commitDistance}.${git.branchName}.${git.gitHash}+local"
}
group = 'io.github.thesupergamer20578'
repositories {
maven {
url 'https://maven.terraformersmc.com/'
}
maven {
url 'https://maven.shedaniel.me/'
}
maven {
url 'https://maven.pkg.github.com/thesupergamer20578/chroma/'
credentials {
username = project.findProperty('gpr.user') ?: System.getenv('GITHUB_ACTOR')
password = project.findProperty('gpr.key') ?: System.getenv('GITHUB_TOKEN')
}
}
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"
modApi("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {
exclude(group: 'net.fabricmc.fabric-api')
}
implementation project(":lib:JChroma")
include project(":lib:JChroma")
}
processResources {
inputs.property 'version', project.version
filesMatching('fabric.mod.json') {
expand 'version': project.version
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding 'UTF-8'
}
java {
withSourcesJar()
}
jar {
from('LICENSE') {
rename { "${it}_${project.archivesBaseName}" }
}
}
shadowJar {
archiveClassifier = 'unmapped'
configurations = [project.configurations.shadow]
exclude 'META-INF'
exclude 'org/apache/commons/lang3/**'
}
remapJar {
dependsOn shadowJar
mustRunAfter shadowJar
inputFile = file(shadowJar.archiveFile)
}
modrinth {
projectId = 'gB2OPOxC'
token = System.getenv('MODRINTH_TOKEN')
syncBodyFrom = rootProject.file('README.md').text
}