This repository has been archived by the owner on Jan 23, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
116 lines (94 loc) · 3.14 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
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import java.nio.charset.StandardCharsets
plugins {
id 'fabric-loom' version '1.4-SNAPSHOT'
id 'org.jetbrains.kotlin.jvm' version '2.0.10'
id 'net.kyori.indra' version '3.1.3'
id 'net.kyori.indra.licenser.spotless' version '3.1.2'
id 'net.kyori.indra.git' version '3.1.3'
id 'com.modrinth.minotaur' version '2.8.7'
id 'maven-publish'
}
group 'scpsharp'
version '1.13.1'
String fullVersion = "mc${project.minecraft_version}-$project.version"
repositories {
mavenCentral()
maven { url 'https://maven.terraformersmc.com/releases/' } // modmenu
maven { url 'https://maven.shedaniel.me' } // REI
}
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_version}"
modImplementation 'net.fabricmc:fabric-language-kotlin:1.10.17+kotlin.1.9.22'
modImplementation 'com.terraformersmc:modmenu:9.0.0'
modCompileOnly 'me.shedaniel:RoughlyEnoughItems-api-fabric:14.0.688'
modRuntimeOnly 'me.shedaniel:RoughlyEnoughItems-fabric:14.0.688'
// https://github.com/shedaniel/RoughlyEnoughItems/issues/1559
modCompileOnly "me.shedaniel.cloth:cloth-config:13.0.121"
// modRuntimeOnly 'dev.architectury:architectury-fabric:9.1.10' // for REI
}
indra {
github 'SCPSharp', 'scp-sharp'
javaVersions {
target 17
}
}
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
compileKotlin {
compilerOptions.jvmTarget.set(JvmTarget.JVM_17)
}
loom {
accessWidenerPath.set file("src/main/resources/scp-sharp.accesswidener")
}
processResources {
if(indraGit.describe() != null) {
inputs.property 'gitVersion', indraGit.describe()
}
inputs.property 'projectVersion', project.version
filesMatching('fabric.mod.json') {
expand 'version': project.version,
'fullVersion': "${indraGit.describe()}-$project.version"
}
}
jar {
from('LICENSE') {
rename { "${it}_${project.name}" }
}
indraGit.applyVcsInformationToManifest(manifest)
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
repositories {
mavenLocal()
}
}
afterEvaluate {
tasks.modrinth {
onlyIf {
System.getenv('MODRINTH_TOKEN') != null
}
dependsOn remapJar
}
}
modrinth {
projectId = 'p3O2a1Bc'
versionNumber = fullVersion
versionName = fullVersion
if(indraGit.headTag() == null) {
changelog = "See git for changelog. ${indraGit.describe()}"
} else {
changelog = "See [GitHub](https://github.com/SCPSharp/scp-sharp/releases/tag/${indraGit.headTag().name}) for changelog. ${indraGit.describe()}"
}
uploadFile = remapJar
gameVersions = [ project.minecraft_version ]
dependencies = []
syncBodyFrom = new String(rootProject.file('README.md').readBytes(), StandardCharsets.UTF_8)
}
tasks.modrinth.dependsOn(tasks.modrinthSyncBody)