forked from TeamTwilight/twilightforest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
184 lines (159 loc) · 5.35 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.109'
}
def secrets = new Properties()
def secretsFile = file('secrets.properties')
if (secretsFile.exists()) {
secretsFile.withInputStream {
stream -> secrets.load(stream)
}
fileTree("secrets").matching {
include "**/*.properties"
}.each {
File file ->
file.withInputStream {
stream -> secrets.load(stream)
}
}
}
version = (hasProperty("CIRevision") ? CIRevision : project.mod_version)
group = group_name
base {
archivesName = "${project.mod_id}-${project.minecraft_version}"
}
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
minecraft.accessTransformers.file rootProject.file('src/main/resources/META-INF/accesstransformer.cfg')
compileJava.options.compilerArgs << "-Xlint:all,-classfile,-processing,-deprecation,-this-escape" << "-Werror"
runs {
configureEach {
workingDirectory project.file('run')
systemProperty 'forge.logging.console.level', 'debug'
systemProperty 'fml.earlyprogresswindow', 'false'
systemProperty 'mixin.env.disableRefMap', 'true'
modSource project.sourceSets.main
}
client {
systemProperty 'forge.enabledGameTestNamespaces', mod_id
programArguments.addAll '--username', secrets.getProperty("username")?: 'Dev', secrets.getProperty("uuid") ? '--uuid' : '', secrets.getProperty("uuid")?: ''
}
server {
systemProperty 'forge.enabledGameTestNamespaces', mod_id
programArgument '--nogui'
}
gameTestServer {
systemProperty 'forge.enabledGameTestNamespaces', mod_id
}
data {
workingDirectory project.file('run-data')
programArguments.addAll '--mod', mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
}
jar {
exclude 'data/twilightforest/functions/**'
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories {
maven {
name 'Jared\'s Maven' // JEI
url 'https://maven.blamejared.com/'
}
maven {
name 'tterrag\'s Maven' // CTM
url 'https://maven.tterrag.com/'
}
maven {
name 'theillusivec4\'s Maven' // Curios
url 'https://maven.theillusivec4.top/'
}
maven {
name 'Tama\'s Maven' // Cross-Dim Commands
url "https://maven.tamaized.com/releases"
}
maven {
name 'Shedaniel\'s Maven' //REI
url "https://maven.shedaniel.me"
}
maven {
name = "TerraformersMC" //EMI
url = "https://maven.terraformersmc.com/"
}
maven {
name 'Curseforge Maven' // Jade
url "https://www.cursemaven.com"
content {
includeGroup "curse.maven"
}
}
}
dependencies {
//make sure to only pick one of these when testing (switch others to compileOnly)
// compileOnly "mezz.jei:jei-${project.minecraft_version}-neoforge:${project.jei_version}"
compileOnly "me.shedaniel:RoughlyEnoughItems-neoforge:${project.rei_version}"
implementation "dev.emi:emi-neoforge:${project.emi_version}+${project.minecraft_version}"
// theillusivec4
implementation "top.theillusivec4.curios:curios-neoforge:${project.curios_version}+${project.minecraft_version}"
//curse maven
// implementation "curse.maven:jade-324717:5288504"
// runtimeOnly "curse.maven:jeed-532286:4599236"
// runtimeOnly "curse.maven:museum-curator-859070:4629894"
// compileOnly "curse.maven:the-one-probe-245211:5084077"
//mods we dont have compat with but are nice to have
// runtimeOnly "team-twilight:crossdimcommands:${project.base_minecraft_version}-1.0"
//minecraft
implementation "net.neoforged:neoforge:${project.neo_version}"
}
tasks.named('jar', Jar).configure {
manifest {
archiveClassifier = 'universal'
attributes([
'Specification-Title' : mod_id,
'Specification-Vendor' : "TeamTwilight",
'Specification-Version' : "1",
'Implementation-Title' : project.name,
'Implementation-Version' : project.jar.archiveVersion,
'Implementation-Vendor' : "TeamTwilight",
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
publishing {
publications {
mavenJava(MavenPublication) {
afterEvaluate {
artifact project.jar
artifact project.sourceJar
}
setGroupId 'teamtwilight'
setArtifactId project.mod_id
}
}
repositories {
maven {
//url "file:///${project.projectDir}/mcmodsrepo"
url "https://modmaven.dev:443/artifactory/local-releases"
credentials {
username System.getenv('ARTIFACTORY_USER')
password System.getenv('ARTIFACTORY_PASS')
}
}
}
}
tasks.register('sourceJar', Jar) {
dependsOn 'classes'
from sourceSets.main.allSource
archiveClassifier = 'sources'
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
idea {
// Tell IDEA to always download sources/javadoc artifacts from maven.
module {
downloadJavadoc = true
downloadSources = true
}
}