forked from kyrptonaught/DiggusMaximus
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
135 lines (113 loc) · 3.8 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
126
127
128
129
130
131
132
133
134
135
plugins {
id 'fabric-loom' version '1.8-SNAPSHOT'
id 'maven-publish'
id 'me.shedaniel.unified-publishing' version '0.1.+'
}
archivesBaseName = project.archives_base_name
version = "${project.mod_version}+mc${project.minecraft_version}"
group = project.maven_group
fabricApi {
configureDataGeneration()
}
repositories {
mavenLocal()
maven { url 'https://maven.fabricmc.net' }
maven { url 'https://maven.yuluo.dev/repository/maven-public' }
maven { url "https://maven.shedaniel.me/" }
maven { url 'https://maven.terraformersmc.com/releases' }
mavenCentral()
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${project.parchment_minecraft_version}:${project.parchment_version}@zip")
}
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modApi(include("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}")) {
exclude(group: 'net.fabricmc.fabric-api')
}
modImplementation("com.terraformersmc:modmenu:${project.mod_menu_version}") {
transitive false
}
}
processResources {
var replaceTokens = [
'mod_version' : rootProject.mod_version,
'minecraft_version_range' : rootProject.minecraft_version_range,
'fabric_loader_version_range': rootProject.fabric_loader_version_range,
'fabric_api_version_range' : rootProject.fabric_api_version_range,
'cloth_config_version_range' : rootProject.cloth_config_version_range
]
inputs.properties replaceTokens
filteringCharset 'UTF-8'
filesMatching('fabric.mod.json') {
expand replaceTokens
}
}
tasks.withType(JavaCompile).configureEach {
it.options.release = 21
}
jar {
from('LICENSE') {
rename { "${it}_${project.archives_base_name}" }
}
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
withSourcesJar()
}
publishing {
repositories {
mavenLocal()
maven {
name = 'YuluoMaven'
def ENV = System.getenv()
def releaseUrl = 'https://maven.yuluo.dev/repository/maven-releases/'
def snapshotUrl = 'https://maven.yuluo.dev/repository/maven-snapshots/'
url = ENV.MOD_RELEASE ? releaseUrl : snapshotUrl
credentials {
username ENV.MOD_MAVEN_USER
password ENV.MOD_MAVEN_PASS
}
}
}
publications {
mavenFabric(MavenPublication) {
artifactId = project.name
version = 'true'.equalsIgnoreCase(System.getenv('MOD_RELEASE')) ? version : "${version}-SNAPSHOT"
from components.java
}
}
}
unifiedPublishing {
project {
displayName = "Diggus Maximus Reborn ${project.mod_version} for ${project.minecraft_version}"
version = project.version
gameVersions = ['1.21.2', '1.21.3']
gameLoaders = ['fabric']
releaseType = 'release'
changelog = 'Bug fixes.'
mainPublication tasks.remapJar
relations {
depends {
curseforge = 'fabric-api'
modrinth = 'fabric-api'
}
includes {
curseforge = 'cloth-config'
modrinth = 'cloth-config'
}
}
curseforge {
token = Objects.requireNonNullElse(System.getenv('CURSEFORGE_TOKEN'), '')
id = '977886'
}
modrinth {
token = Objects.requireNonNullElse(System.getenv('MODRINTH_TOKEN'), '')
id = 'tVeR4oKO'
}
}
}