-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
143 lines (127 loc) · 4.16 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
136
137
138
139
140
141
142
143
plugins {
id 'eclipse'
id 'maven-publish'
id 'java-library'
id 'org.quiltmc.gradle.licenser' version '2.0.1'
id 'com.diffplug.spotless' version '6.22.0'
}
version = "0.3.3-quilt"
group = 'net.pillowmc' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'pillow'
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
license {
rule project.rootProject.file("HEADER")
include '**/*.java'
exclude '**/copied/*.java'
}
java {
withSourcesJar()
}
spotless {
java {
importOrder()
endWithNewline()
removeUnusedImports()
cleanthat()
eclipse()
formatAnnotations()
}
}
repositories {
mavenLocal()
maven {
name = 'FabricMC'
url = 'https://maven.fabricmc.net/'
}
maven {
name = 'QuiltMC Release'
url = 'https://maven.quiltmc.org/repository/release/'
}
maven {
name = 'QuiltMC Snapshot'
url = 'https://maven.quiltmc.org/repository/snapshot/'
}
maven {
url "https://maven.neoforged.net/releases"
}
maven {
url "https://libraries.minecraft.net/"
}
}
configurations {
embed
implementation.extendsFrom(embed)
}
dependencies {
implementation "net.neoforged.fancymodloader:loader:4.0.31"
implementation "cpw.mods:modlauncher:11.0.4"
implementation "cpw.mods:securejarhandler:3.0.4"
implementation "org.jetbrains:annotations:24.1.0"
api "net.fabricmc:sponge-mixin:0.15.3+mixin.0.8.7"
api ("org.quiltmc:quilt-loader:0.27.0-beta.1") {
exclude group: "org.ow2.asm"
}
api "net.fabricmc:tiny-mappings-parser:0.3.0+build.17"
api ("net.fabricmc:tiny-remapper:0.10.1") {
exclude group: "org.ow2.asm"
}
}
processResources {
inputs.property "version", project.version
filesMatching("quilt.mod.json") {
expand "version": project.version
}
}
// Example for how to get properties into the manifest for reading at runtime.
jar {
duplicatesStrategy DuplicatesStrategy.EXCLUDE
manifest {
attributes([
"Specification-Title" : "pillow",
"Specification-Vendor" : "pillowmc",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : "pillowmc",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"MixinConnector": "net.pillowmc.pillow.asm.PillowConnector"
])
}
}
// Example configuration to allow publishing using the maven-publish plugin
// This is the preferred method to reobfuscate your jar file
// jar.finalizedBy('reobfJar')
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
// publish.dependsOn('reobfJar')
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
artifact sourcesJar
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
configurations.api.allDependencies.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
repositories {
mavenLocal()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/PillowMC/pillow")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}