-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
112 lines (94 loc) · 3.04 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
plugins {
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.9'
id 'com.gradleup.shadow' version '8.3.0' apply false
id 'com.diffplug.eclipse.apt' version '4.1.0' apply false
}
subprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'com.gradleup.shadow'
apply plugin: 'com.diffplug.eclipse.apt'
base {
archivesName = 'Patched'
}
version = '7.3.3+1.21.1'
group = 'net.enderturret'
if (it == project(':PatchedModCommon')) {
version += '-common'
}
else if (it == project(':PatchedModForge')) {
version += '-neoforge'
}
else if (it == project(':PatchedModFabric')) {
version += '-fabric'
}
else if (it == project(':PatchedModQuilt')) {
version += '-quilt'
}
ext {
patchedVersion = '1.5.0'
}
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
java.withSourcesJar()
repositories {
maven {
url = 'https://jitpack.io'
content {
includeGroup 'com.github.EnderTurret'
}
}
}
configurations {
sourceShadow
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
tasks.withType(GenerateModuleMetadata).configureEach {
enabled = false
}
tasks.withType(AbstractArchiveTask).configureEach {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
tasks.named('processResources', ProcessResources).configure {
doLast {
fileTree(dir: outputs.files.asPath, include: '**/*.json').each {
File file -> file.text = groovy.json.JsonOutput.toJson(new groovy.json.JsonSlurper().parse(file))
}
}
}
tasks.named('jar', Jar).configure {
manifest {
attributes([
'Specification-Title': 'Patched',
'Specification-Vendor': 'EnderTurret',
'Specification-Version': '1',
'Implementation-Title': 'Patched',
'Implementation-Version': "${version}",
'Implementation-Vendor': 'EnderTurret'
])
}
}
tasks.named('sourcesJar', Jar).configure {
// Add the Patched library sources to the built jars' sources.
dependsOn configurations.sourceShadow
from {
configurations.sourceShadow.findAll { it.name.endsWith('jar') }.collect { zipTree(it) }
}
from (rootDir) {
include 'LICENSE.txt'
}
}
if (it != project(':PatchedModCommon')) {
tasks.named('compileJava', JavaCompile).configure {
source project(':PatchedModCommon').sourceSets.main.allSource
}
tasks.named('sourcesJar', Jar).configure {
from project(':PatchedModCommon').sourceSets.main.allJava
}
tasks.named('processResources', ProcessResources).configure {
from project(':PatchedModCommon').sourceSets.main.resources
}
}
}