-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbuild.gradle
More file actions
155 lines (136 loc) · 4.13 KB
/
build.gradle
File metadata and controls
155 lines (136 loc) · 4.13 KB
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
147
148
149
150
151
152
153
154
155
plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.moddev' version '2.0.+'
id "org.moddedmc.wiki.toolkit" version "0.3.2"
}
tasks.named('wrapper', Wrapper).configure {
// Define wrapper values here so as to not have to always do so when updating gradlew.properties.
// Switching this to Wrapper.DistributionType.ALL will download the full gradle sources that comes with
// documentation attached on cursor hover of gradle classes and methods. However, this comes with increased
// file size for Gradle. If you do switch this to ALL, run the Gradle wrapper task twice afterwards.
// (Verify by checking gradle/wrapper/gradle-wrapper.properties to see if distributionUrl now points to `-all`)
distributionType = Wrapper.DistributionType.BIN
}
group = "net.commoble.${modid}"
base { archivesName="${modid}" }
version = "${mod_version}"
java.toolchain.languageVersion = JavaLanguageVersion.of("${java_version}")
sourceSets
{
main
gametest
datagen
}
// include resources generated from datagen in main
sourceSets.main.resources { srcDir 'src/generated/resources' }
neoForge {
version = "${neo_version}"
mods {
"${modid}" {
sourceSet(sourceSets.main)
sourceSet(sourceSets.datagen)
}
}
runs {
client {
client()
}
server {
server()
}
gameTestServer {
type = "gameTestServer"
}
clientData {
clientData()
programArguments.addAll '--mod', "morered", '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
exportClient {
client()
systemProperty 'wiki_exporter.enabled', 'true'
systemProperty "wiki_exporter.config.path", file('wiki_exporter.config.json').getAbsolutePath()
}
exportServer {
server()
programArgument 'nogui'
systemProperty 'wiki_exporter.enabled', 'true'
systemProperty "wiki_exporter.config.path", file('wiki_exporter.config.json').getAbsolutePath()
}
configureEach {
}
}
}
repositories {
mavenLocal()
mavenCentral()
maven {url = "https://maven.blamejared.com/"}
maven {url = "https://maven.commoble.net"}
maven {url = "https://maven.terraformersmc.com"}
maven { url = 'https://maven.sinytra.org/' }
}
// Sets up a dependency configuration called 'localRuntime'.
// This configuration should be used instead of 'runtimeOnly' to declare
// a dependency that will be present for runtime testing but that is
// "optional", meaning it will not be pulled by dependents of this mod.
configurations {
runtimeClasspath.extendsFrom localRuntime
}
dependencies {
jarJar(implementation("net.commoble.exmachina:exmachina:${exmachina_version}"))
jarJar(implementation("net.commoble.preview_placement:preview_placement:${preview_placement_version}"))
compileOnly "mezz.jei:jei-${jei_mc_version}-common-api:${jei_version}"
compileOnly "mezz.jei:jei-${jei_mc_version}-neoforge-api:${jei_version}"
// at runtime, use the full JEI jar for NeoForge
localRuntime "mezz.jei:jei-${jei_mc_version}-neoforge:${jei_version}"
localRuntime "net.commoble.jumbofurnace:jumbofurnace:${jumbofurnace_version}"
//localRuntime "org.sinytra:wiki-exporter-neoforge:${wiki_exporter_version}"
}
jar {
manifest {
attributes([
"Specification-Title": "${modid}",
"Specification-Vendor": "Commoble",
"Specification-Version": "${version}",
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"Commoble"
])
}
}
java
{
withSourcesJar()
withJavadocJar()
}
artifacts {
archives javadocJar
archives sourcesJar
}
// 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 {
register('mavenJava', MavenPublication) {
from components.java
}
}
repositories {
maven {
name="localMaven"
url = "./maven"
}
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
wiki {
docs {
morered {
root = file('docs')
}
}
}