forked from Wynntils/Wynntils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
135 lines (119 loc) · 4.69 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
123
124
125
126
127
128
129
130
131
132
133
134
135
plugins {
id "architectury-plugin" version "${architectury_plugin_version}"
id "dev.architectury.loom" version "${architectury_loom_version}" apply false
id "io.github.juuxel.loom-quiltflower" version "${loom_quiltflower_version}" apply false
id "com.diffplug.spotless" version "${spotless_version}"
}
architectury {
minecraft = minecraft_version
}
// Add "wynntils.hotswap=true" to your personal gradle properties file to use hotswap.
// By default, this is C:\Users\<your username>\.gradle\gradle.properties on Windows
// or ~/.gradle/gradle.properties on Linux/MacOS.
def usingHotswapAgent = project.hasProperty("wynntils.hotswap") ? project.getProperty("wynntils.hotswap") == "true" : false
// On the release branches, this string will be automatically updated by the bots
// Do not change this in the main branch!
version = "0.0.3-SNAPSHOT"
subprojects {
apply plugin: "dev.architectury.loom"
apply plugin: "io.github.juuxel.loom-quiltflower"
repositories {
maven { url = "https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1" }
maven {
name = "remote"
// Adapt the URL for your remote repository
url = uri("https://maven.pkg.github.com/Wynntils/Hades")
credentials {
// Use this if the repo requires auth
// see https://docs.gradle.org/6.4/userguide/declaring_repositories.html#sec:supported_transport_protocols
username = new String(Base64.getDecoder().decode("V3lubnRpbHNCb3Q="))
password = new String(Base64.getDecoder().decode("Z2hwX09rY0lXaUEwUEhvTXk2Nk1odkRuZ08wbWZBNFp3SzNJTkQ3dw=="))
}
}
}
loom {
silentMojangMappingsLicense()
accessWidenerPath = file("src/main/resources/wynntils.accessWidener")
runs {
client {
property("devauth.configDir", getRootProject().file(".devauth").absolutePath)
if (usingHotswapAgent) {
vmArgs "-XX:+AllowEnhancedClassRedefinition"
vmArgs "-XX:HotswapAgent=fatjar"
}
vmArgs "-ea" // run dev builds with asserts
client()
}
}
}
dependencies {
minecraft "com.mojang:minecraft:${minecraft_version}"
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${parchment_version}@zip")
}
}
}
allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "com.diffplug.spotless"
archivesBaseName = archives_base_name
version = rootProject.version
repositories {
maven { url "https://maven.parchmentmc.org/" }
maven { url "https://jitpack.io" }
}
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(java_version))
}
withSourcesJar()
}
spotless {
java {
// define the steps to apply to Java source code
importOrder()
removeUnusedImports()
palantirJavaFormat(spotless_palantir_version)
trimTrailingWhitespace()
endWithNewline()
// Custom rule from https://github.com/apache/geode
custom "Refuse wildcard imports", {
if (it =~ /\nimport .*\*;/) {
throw new AssertionError("Do not use wildcard imports. 'spotlessApply' cannot resolve this issue.")
}
}
custom "Refuse IntelliJ annotations", {
if (it =~ /\nimport org\.jetbrains\.annotations\./) {
throw new AssertionError("Do not use IntelliJ annotations. 'spotlessApply' cannot resolve this issue.")
}
}
licenseHeader "/*\n" +
" * Copyright © Wynntils \$YEAR.\n" +
" * This file is released under AGPLv3. See LICENSE for full license details.\n" +
" */"
}
json {
target "src/**/*.json"
gson()
.indentWithSpaces(2)
.sortByKeys()
.version(spotless_gson_version)
trimTrailingWhitespace()
endWithNewline()
}
format "misc", {
// define the files to apply `misc` to
target "*.gradle", "*.md", ".gitignore", "*.properties"
targetExclude("CHANGELOG.md")
// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
}
}
}