forked from Wynntils/Wynntils-Legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
116 lines (91 loc) · 3.44 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
plugins {
id "java"
id "idea"
id "maven-publish"
id "net.minecraftforge.gradle" version "5.1.+"
id "com.github.johnrengelman.shadow" version "7.1.0"
}
def versionObj = new Version(major: 1, minor: 15, revision: 1)
version = versionObj.toString()
group = mod_base_package
archivesBaseName = mod_id
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
compileJava.options.encoding = "UTF-8"
minecraft {
mappings channel: mappings_channel, version: mappings_version
runs {
client {
workingDirectory project.file('run')
property("devauth.configDir", project.file(".devauth").absolutePath)
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
// These arguments allow for optional authentication with Mojang servers.
// If you want to authenticate, put these properties in GRADLE_HOME/gradle.properties.
// By default, this is C:\Users\<your username>\.gradle\gradle.properties on Windows or ~/.gradle/gradle.properties on Linux/MacOS.
if (project.hasProperty('mc_uuid') && project.hasProperty('mc_username') && project.hasProperty('mc_accessToken')) {
// Your UUID, trimmed / without the dashes
args '--uuid', project.getProperty('mc_uuid')
// Your Minecraft in-game username, not email
args '--username', project.getProperty('mc_username')
// Your current access token. When it expires, you need to retrieve a new one and regenerate your run configurations.
// You may be able to find it in your .minecraft folder in launcher_accounts.json or launcher_profiles.json.
args '--accessToken', project.getProperty('mc_accessToken')
}
}
}
}
// allow local forge version override
if (!project.hasProperty("wynntilsForgeVersion")) {
ext.wynntilsForgeVersion=forge_version
}
sourceSets {
main {
output.resourcesDir = output.classesDirs.singleFile
}
}
configurations {
include
implementation.extendsFrom(include)
}
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${wynntilsForgeVersion}"
include "javazoom:jlayer:1.0.1"
}
jar {
enabled = false
}
shadowJar {
archiveFileName = jar.archiveFileName
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
configurations = [project.configurations.include]
}
processResources {
inputs.property "description", "The best Wynncraft mod you'll probably find!\nBuild " + versionObj.getBuild()
inputs.property "version", versionObj.toVersion()
filesMatching("mcmod.info") {
expand "version": versionObj.toVersion(), "description": "The best Wynncraft mod you'll probably find!\nBuild " + versionObj.getBuild()
}
}
reobf {
shadowJar {}
}
class Version {
int major, minor, revision
static String getBuild() {
System.getenv("BUILD_NUMBER") ?: System.getProperty("BUILD_NUMBER") ?: "DEV"
}
String toVersion() {
"${major}.${minor}.${revision}"
}
String toString() {
"${major}.${minor}.${revision}_$build-MC1.12.2"
}
}
jar.dependsOn("shadowJar")
task installLocalGitHook(type: Copy) {
from new File(rootProject.rootDir, '.github/hooks/commit-msg')
into { new File(rootProject.rootDir, '.git/hooks') }
fileMode 0775
}
prepareKotlinBuildScriptModel.dependsOn installLocalGitHook
build.dependsOn installLocalGitHook