forked from ErdbeerbaerLP/DiscordIntegration-Forge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
122 lines (99 loc) · 3.95 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
plugins {
id "com.matthewprenger.cursegradle" version "1.4.0"
id 'java'
id 'eclipse'
id 'idea'
id "com.modrinth.minotaur" version "2.+"
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.+'
id 'net.neoforged.gradle.mixin' version '7.0.+'
}
configurations {
shade
}
shadowJar {
archiveClassifier.set('')
configurations = [project.configurations.shade]
relocate 'org.slf4j', 'dcshadow.org.slf4j'
}
//Build variables
version = "3.0.5"
group = "de.erdbeerbaerlp.dcintegration"
archivesBaseName = "dcintegration-neoforge"
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
//Gradle Repositories
repositories {
maven { url 'https://jitpack.io' }
maven { url "https://repo.erdbeerbaerlp.de/repository/maven-public/" }
}
mixin {
// add sourceSets.main, 'mixins.dcintegration.refmap.json' Neoforged no longer needs refmapping
config 'mixins.dcintegration.json'
}
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
artifacts {
archives tasks.shadowJar
}
runs {
// applies to all the run configs below
configureEach {
// Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
systemProperty 'forge.logging.markers', 'REGISTRIES'
// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
systemProperty 'forge.logging.console.level', 'debug'
modSource project.sourceSets.main
}
client {
workingDirectory project.file('run/client')
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
systemProperty 'forge.enabledGameTestNamespaces', 'dcintegration'
}
server {
workingDirectory project.file('run/server')
systemProperty 'forge.enabledGameTestNamespaces', 'dcintegration'
programArgument '--nogui'
}
// This run config launches GameTestServer and runs all registered gametests, then exits.
// By default, the server will crash when no gametests are provided.
// The gametest system is also enabled by default for other run configs under the /test command.
gameTestServer {
workingDirectory project.file('run/gamedata')
systemProperty 'forge.enabledGameTestNamespaces', 'dcintegration'
}
data {
// example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
workingDirectory project.file('run/data')
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
programArguments.addAll '--mod', 'dcintegration', '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
//Dependencies
dependencies {
// ========= Minecraft Forge =============
implementation "net.neoforged:neoforge:20.4.146-beta"
//Dynmap-API
compileOnly('com.github.webbukkit:DynmapCoreAPI:2.5')
// ========= Common =====================
def dciCommon = 'de.erdbeerbaerlp:dcintegration.common:3.0.5'
implementation(dciCommon) {
transitive = false
}
shade dciCommon
}
tasks.register('sourceJar', Jar) {
dependsOn 'classes'
from sourceSets.main.allSource
archiveClassifier = 'sources'
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
build.dependsOn shadowJar