-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
110 lines (93 loc) · 2.93 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 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version "7.0.+"
}
version = "${mod_version}"
group = "net.commoble.${modid}" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
base {
archivesName = "${modid}-${mc_version}"
}
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
jarJar.enable()
sourceSets {
main
}
runs {
configureEach {
systemProperty 'forge.logging.console.level', 'debug'
modSource project.sourceSets.main
}
client {
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
systemProperty 'forge.enabledGameTestNamespaces', project.modid
}
server {
systemProperty 'forge.enabledGameTestNamespaces', project.modid
}
gameTestServer {
systemProperty 'forge.enabledGameTestNamespaces', project.modid
}
data {
programArguments.addAll '--mod', project.modid, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
}
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
minecraft {
accessTransformers {
file('src/main/resources/META-INF/accesstransformer.cfg')
}
}
repositories {
mavenCentral()
maven {url = "https://maven.blamejared.com/"}
maven {url = "https://dvs1.progwml6.com/files/maven/"}
maven {url = "https://modmaven.dev"}
maven {url = "https://cursemaven.com"}
maven {url = "https://commoble.net/maven/"}
}
dependencies {
implementation "net.neoforged:neoforge:${neo_version}"
implementation "net.commoble.infiniverse:${infiniverse_mc_version}:${infiniverse_version}"
jarJar(group: "net.commoble.infiniverse", name: "${infiniverse_mc_version}", version: "[${infiniverse_min_version}, ${infiniverse_max_version})")
}
tasks.jarJar.configure {
archiveClassifier = ''
}
// Example for how to get properties into the manifest for reading by the runtime..
jar {
archiveClassifier = 'slim'
manifest {
attributes([
"Specification-Title": "${modid}",
"Specification-Vendor": "Commoble",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"Commoble",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
tasks.build.dependsOn tasks.jarJar
// run "gradlew build publish" to build jars and generate a maven repo for them
// run "gradlew build" to build the jars without mavening them
publishing {
publications {
mavenJava(MavenPublication) {
artifactId project.archivesBaseName
artifact tasks.jarJar
//artifact sourcesJar
//artifact javadocJar
}
}
repositories {
maven {
name="localMaven"
url "file:///${project.projectDir}/maven"
}
}
}