-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
119 lines (97 loc) · 2.71 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
plugins {
id 'eclipse'
id 'idea'
id 'java-library'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.145'
id 'io.github.goooler.shadow' version '8.1.8'
}
group = 'com.lovetropics.lib'
base {
archivesName = 'LTLib'
}
ext.buildnumber = 0
project.buildnumber = System.getenv('BUILD_NUMBER')
version = "${mod_version}" + (buildnumber ? ".${buildnumber}" : ".0-SNAPSHOT")
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
runs {
configureEach {
workingDirectory project.file('run')
systemProperty 'forge.logging.markers', 'REGISTRIES'
systemProperty 'forge.logging.console.level', 'debug'
modSource project.sourceSets.main
}
client {
programArguments.addAll '--username', 'Dev###'
}
server {
programArgument '--nogui'
}
data {
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
}
subsystems {
parchment {
minecraftVersion = minecraft_version
mappingsVersion = parchment_version
}
}
sourceSets.main.resources {
srcDir 'src/generated/resources'
}
repositories {
mavenLocal()
}
dependencies {
implementation "net.neoforged:neoforge:${neo_version}"
shadow ('io.netty:netty-codec-http:4.1.82.Final') {
transitive = false
}
}
tasks.named('jar', Jar).configure {
manifest {
attributes([
"FMLModType": "GAMELIBRARY",
"Specification-Title": "ltlib",
"Specification-Vendor": "lovetropics",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"lovetropics",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
archiveClassifier = 'slim'
}
tasks.register('sourceJar', Jar) {
dependsOn classes
archiveClassifier = 'sources'
from sourceSets.main.java
}
configurations {
shadow
implementation.extendsFrom shadow
}
shadowJar {
configurations = [project.configurations.shadow]
archiveClassifier = ''
['http', 'rtsp', 'spdy'].forEach {
relocate "io.netty.handler.codec.$it", "com.lovetropics.lib.repack.io.netty.handler.codec.$it"
}
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact shadowJar
artifact sourceJar
}
}
repositories {
if (project.hasProperty('mavendir')) {
maven { url mavendir }
} else {
mavenLocal()
}
}
}