generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
146 lines (126 loc) · 4.11 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
plugins {
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'maven-publish'
id "com.matthewprenger.cursegradle" version "1.4.0"
id "com.modrinth.minotaur" version "2.+"
id 'io.github.juuxel.loom-quiltflower' version '1.7.2'
id 'idea'
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
repositories {
mavenCentral()
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.terraformersmc.com/releases/" }
}
quiltflower {
preferences {
useJadVarnaming 1
}
quiltflowerVersion = '1.8.1'
}
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}"
include "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modImplementation("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {exclude(group: "net.fabricmc.fabric-api")}
include("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {exclude(group: "net.fabricmc.fabric-api")}
implementation 'org.codehaus.groovy:groovy-all:3.+'
include 'org.codehaus.groovy:groovy-all:3.+'
modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
tasks.withType(JavaCompile).configureEach {
// Minecraft 1.18 upwards uses Java 17.
it.options.release = 17
}
// https://www.curseforge.com/minecraft/mc-mods/kajava
curseforge {
if (project.hasProperty('curseForgeApiKeyKajava')) apiKey = project.findProperty("curseForgeApiKeyKajava")
else apiKey = "DUMMY"
project {
id = '548112'
changelogType = "markdown"
changelog = "Changelog can be founded at [Commits](https://github.com/kadir1243/kajava/commits)"
releaseType = 'alpha'
addGameVersion project.minecraft_version
addGameVersion "Fabric"
mainArtifact(remapJar) {
displayName = "${project.archives_base_name} ${project.version}-${project.minecraft_version}"
}
relations {
embeddedLibrary 'fabric-api'
embeddedLibrary 'cloth-config'
}
options {
forgeGradleIntegration = false
}
}
}
import com.modrinth.minotaur.dependencies.ModDependency
// https://modrinth.com/mod/kajava
modrinth {
if (project.hasProperty('modrinthTokenKajava')) token = project.findProperty("modrinthTokenKajava")
else token = "DUMMY"
projectId = '3frGeH2B'
versionNumber = project.version
versionType = "alpha"
uploadFile = remapJar
changelog = "Changelog can be founded at [Commits](https://github.com/kadir1243/kajava/commits)"
gameVersions = [project.minecraft_version] // An array of game versions the version supports
loaders = ['fabric'] // Self-explanatory.
dependencies = [
new ModDependency('P7dR8mSH', 'required') // Creates a new required dependency on Fabric API
]
}
javadoc {
source = sourceSets.main.allJava
classpath = sourceSets.main.compileClasspath + sourceSets.main.output
options.addStringOption('Xdoclint:none', '-quiet')
options.encoding = 'UTF-8'
options.charSet = 'UTF-8'
}
task javadocJar(type: Jar, dependsOn: javadoc, group: "build") {
archiveClassifier = "javadoc"
from javadoc.destinationDir
}
java {
withJavadocJar()
withSourcesJar()
}
task publishToPlatforms {
dependsOn(publish,tasks.getByName('modrinth'),tasks.getByName('curseforge'))
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
}
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
// maven published at : https://mymavenrepo.com/repo/y9bmQiqluv2BrIIsqiol/
repositories {
maven {
if (project.hasProperty("myMavenRepoWriteUrl")) url = project.findProperty("myMavenRepoWriteUrl")
credentials {
username 'myMavenRepo'
if (project.hasProperty("myMavenRepoWritePassword")) password project.findProperty("myMavenRepoWritePassword")
}
}
}
}