forked from natanfudge/artifice
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
110 lines (93 loc) · 2.75 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
plugins {
id 'fabric-loom' version '1.2-SNAPSHOT'
id 'maven-publish'
id "io.github.juuxel.loom-quiltflower" version "1.7.+"
id 'org.quiltmc.quilt-mappings-on-loom' version '4.+'
}
archivesBaseName = project.archives_base_name
version = "$mod_version+build.$build_number-${libs.versions.minecraft.get()}-EXPERIMENTAL"
group = maven_group
repositories {
mavenCentral()
maven { url = "https://maven.parchmentmc.org" }
}
sourceSets {
testmod {
compileClasspath += main.compileClasspath
runtimeClasspath += main.runtimeClasspath
}
}
loom {
accessWidenerPath = file("src/main/resources/artifice.accesswidener")
}
dependencies {
minecraft libs.minecraft
mappings loom.layered {
// it.mappings("org.quiltmc:quilt-mappings:${libs.versions.quilt.mappings.get()}:intermediary-v2")
// it.mappings("net.fabricmc:yarn:${libs.versions.fabric.mappings.get()}:v2")
it.parchment("org.parchmentmc.data:parchment-1.19.3:${libs.versions.parchment.get()}@zip")
it.officialMojangMappings()
}
modImplementation libs.fabric.loader
modApi (libs.bundles.fabric)
testmodImplementation sourceSets.main.output
}
Properties properties = new Properties()
properties.put("total_version", version)
task updateTemplate(type: Copy) {
group = "template"
description = "Switches out variables like \$project.version in .template.md files, and copies the results into .md files."
from(rootDir)
include("**/*.template.md")
filesMatching("**/*.template.md") {
def extensionLength = ".template.md".length()
name = sourceName.substring(0, sourceName.length() - extensionLength) + ".md"
expand(properties)
}
destinationDir = rootDir
}
publish.dependsOn updateTemplate
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
java {
withSourcesJar()
withJavadocJar()
toolchain.languageVersion = JavaLanguageVersion.of(17)
}
tasks.withType(JavaCompile).configureEach {
it.options.release = 17
it.options.encoding = 'UTF-8'
}
compileJava {
options.compilerArgs += '--enable-preview'
}
jar {
from('LICENSE') {
rename {
"${it}_$archivesBaseName"
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
repositories {
if (project.hasProperty("siphalorMavenUser")) {
maven {
name = "Siphalor"
url = "https://maven.siphalor.de/upload.php"
credentials {
username = siphalorMavenUser
password = siphalorMavenPassword
}
}
}
}
}