-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
108 lines (90 loc) · 3.23 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
plugins {
id 'java'
id "xyz.wagyourtail.unimined" version "1.2.9" apply false
}
// Edit in gradle.properties
group = project_group
version = "${version_major}.${version_minor}.${version_patch}"
subprojects {
apply plugin: "xyz.wagyourtail.unimined"
apply plugin: "java"
apply plugin: 'maven-publish'
group = rootProject.group
version = rootProject.version
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
// Add your maven repositories here
repositories {
mavenCentral()
// First Dark Dev Maven. Can be removed
maven {
url "https://maven.firstdark.dev/releases"
}
// First Dark Dev Mirror maven. Do not remove.
// It's required by this project to pull in dependencies for the modloaders
maven {
url "https://mcentral.firstdark.dev/releases"
}
}
dependencies {
// Add global dependencies here
// Dependencies added here will be applied to every module (Common/Fabric/Forge/NeoForge etc)
}
jar {
manifest {
attributes([
'Specification-Title' : project.archivesBaseName,
'Specification-Vendor' : mod_author,
'Specification-Version' : project.version,
'Implementation-Title' : project.name,
'Implementation-Version' : project.version,
'Implementation-Vendor' : mod_author,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Timestamp' : System.currentTimeMillis(),
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
'Built-On-Minecraft' : minecraft_version
])
}
}
/**
* ===============================================================================
* = DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING =
* ===============================================================================
*/
unimined.minecraft(sourceSets.main, true) {
version minecraft_version
mappings {
mojmap()
devNamespace "mojmap"
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.release = 21
}
tasks.withType(GenerateModuleMetadata).configureEach {
enabled = false
}
clean {
delete "$rootDir/artifacts"
}
if (project.name !== 'Common') {
tasks.register('delDevJar') {
doLast {
def tree = fileTree('build/libs')
tree.include '**/*-dev-shadow.jar'
tree.include '**/*-dev.jar'
tree.include '**/*-all.jar'
tree.include '**/*-slim.jar'
tree.each { it.delete() }
}
}
build.finalizedBy delDevJar
tasks.register('copyAllArtifacts', Copy) {
from "$buildDir/libs"
into "$rootDir/artifacts"
include("*.jar")
}
build.finalizedBy(copyAllArtifacts)
}
}