-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
127 lines (104 loc) · 3.55 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
plugins {
id 'architectury-plugin' version "${architect_plugin_version}"
id 'dev.architectury.loom' version "${architectury_loom_version}"
}
architectury {
minecraft = project.minecraft_version
common(project.enabled_platforms.split(','))
}
loom {
runConfigs.configureEach {
ideConfigGenerated = true
}
}
sourceSets.main.resources.srcDir 'src/main/generated'
allprojects {
apply plugin: 'architectury-plugin'
apply plugin: 'dev.architectury.loom'
apply plugin: 'maven-publish'
group = 'cuteneko'
version = "${project.mod_version}+mc${project.minecraft_version}"
architectury {
minecraft = project.minecraft_version
}
loom {
accessWidenerPath = file('src/main/resources/catsplus.accesswidener')
}
repositories {
repositories {
maven {
name = 'Mod Menu'
url = 'https://maven.terraformersmc.com/releases'
}
}
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.fabric_loader_version}"
modApi "dev.architectury:architectury:${project.architectury_version}"
}
configurations {
common
shadowCommon
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
developmentForge.extendsFrom common
developmentFabric.extendsFrom common
developmentNeoForge.extendsFrom common
developmentQuilt.extendsFrom common
}
def targetJavaVersion = 17
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
it.options.release = targetJavaVersion
}
}
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
withSourcesJar()
}
jar {
from('LICENSE') {
rename { "${it}_${project.archivesBaseName}" }
}
}
processResources {
var resourcesToReplace = ['build.properties', 'META-INF/mods.toml', 'pack.mcmeta', 'fabric.mod.json']
var replaceTokens = [
minecraft_version: minecraft_version,
mod_version: mod_version,
forge_loader_version: forge_loader_version,
forge_version: forge_version,
fabric_loader_version: fabric_loader_version,
fabric_api_version: fabric_api_version,
neoforge_version: neoforge_version,
architectury_version: architectury_version
]
inputs.properties replaceTokens
filteringCharset 'UTF-8'
filesMatching(resourcesToReplace) {
expand replaceTokens
}
}
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
}
}
}
}
}