forked from FTBTeam/FTB-StoneBlock-Companion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
160 lines (135 loc) · 3.69 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
plugins {
id "dev.architectury.loom" version "0.12.0-SNAPSHOT"
id "maven-publish"
id "com.matthewprenger.cursegradle" version "1.4.0"
}
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
def ENV = System.getenv()
archivesBaseName = project.archives_base_name
version = "${project.mod_version}+mc${project.minecraft_version}"
group = project.maven_group
loom {
silentMojangMappingsLicense()
forge {
mixinConfigs = [
"ftbsbc.mixins.json"
]
dataGen {
mod project.mod_id
}
}
launches {
data {
arg "--existing", file("src/main/resources").absolutePath
}
}
}
repositories {
maven { url "https://www.cursemaven.com" }
maven { url "https://maven.saps.dev/minecraft" }
maven { url "https://maven.shedaniel.me/" }
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.officialMojangMappings()
forge "net.minecraftforge:forge:${project.forge_version}"
modImplementation "curse.maven:jei-238222:${jei_file}"
modImplementation "dev.latvian.mods:kubejs-forge:${kubejs_version}"
modImplementation "dev.latvian.mods:rhino-forge:${rhino_version}"
modImplementation "dev.ftb.mods:ftb-teams-forge:${teams_version}"
modImplementation "dev.ftb.mods:ftb-chunks-forge:${chunks_version}"
modImplementation ("curse.maven:jade-324717:${jade_version}")
modImplementation ("curse.maven:ctm-267602:3933537")
modRuntimeOnly "dev.ftb.mods:ftb-essentials:${essentials_version}"
}
processResources {
inputs.property "version", project.version
filesMatching("META-INF/mods.toml") {
expand "version": project.version
}
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = 17
}
java {
withSourcesJar()
}
jar {
manifest {
attributes([
"Specification-Title" : project.mod_id,
"Specification-Vendor" : project.mod_author,
"Specification-Version" : "1",
"Implementation-Title" : project.name,
"Implementation-Version" : version,
"Implementation-Vendor" : project.mod_author,
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
def relType = "release"
if (ENV.TAG != null) {
if (ENV.TAG.contains("alpha")) {
relType = "alpha"
} else if (ENV.TAG.contains("beta")) {
relType = "beta"
}
}
if (ENV.CURSEFORGE_KEY) {
curseforge {
apiKey = ENV.CURSEFORGE_KEY
project {
id = project.curseforge_id
releaseType = relType
addGameVersion "Forge"
addGameVersion project.minecraft_version
mainArtifact(remapJar.archiveFile)
relations {
requiredDependency 'ftb-library-forge'
optionalDependency 'jade'
}
changelog = ENV.CHANGELOG // expected to exist if ENV.CURSEFORGE does
changelogType = 'markdown'
}
}
}
def ftbURL = "https://maven.ftb.dev/release"
def sapsURL = "https://maven.saps.dev/minecraft"
def mavenVersion = project.version
if (ENV.SNAPSHOT != null && ENV.SNAPSHOT == "true") {
ftbURL = "https://maven.ftb.dev/snapshot"
mavenVersion += "-SNAPSHOT"
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = project.group
artifactId = project.archivesBaseName
version = mavenVersion
artifact(remapJar) {
builtBy remapJar
}
}
}
repositories {
if (ENV.FTB_MAVEN_TOKEN) {
maven {
url ftbURL
credentials {
username = "ftb"
password = "${ENV.FTB_MAVEN_TOKEN}"
}
}
}
if (ENV.SAPS_TOKEN) {
maven {
url sapsURL
credentials {
username = "ftb"
password = "${ENV.SAPS_TOKEN}"
}
}
}
}
}