forked from blahthebiste/AncientWarfare2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
211 lines (180 loc) · 6.6 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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
buildscript {
repositories {
maven {
name 'MinecraftForge'
url 'https://maven.minecraftforge.net/'
}
maven {
name 'Garden of Fancy'
url 'https://maven.gofancy.wtf/releases'
}
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:6.+'
classpath group: 'wtf.gofancy.fancygradle', name: 'wtf.gofancy.fancygradle.gradle.plugin', version: '1.1.3-0'
classpath("gradle.plugin.de.fuerstenau:BuildConfigPlugin:1.1.8")
}
}
// We apply the 'forge' plugin, so ForgeGradle can do it's stuff.
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'idea'
apply plugin: 'maven-publish'
apply plugin: 'wtf.gofancy.fancygradle'
apply plugin: 'de.fuerstenau.buildconfig'
fancyGradle {
patches {
mergetool
resources
codeChickenLib
coremods
asm
}
}
group = "shadowmage"
archivesBaseName = "ancientwarfare"
version = project.minecraft_version + "-" + project.major +"."+ project.minor +"."+ project.patch
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
minecraft{
// The mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD Snapshot are built nightly.
// stable_# Stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
//mappings channel: 'snapshot', version: '20171003-1.12'
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
mappings channel: project.mappings_channel, version: "${project.mappings_version}-${project.mappings_mc_version}"
accessTransformer = file('src/main/resources/ancientwarfare_at.cfg')
// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
client {
workingDirectory project.file('run\\client')
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'info'
jvmArg "-Dmixin.hotSwap=true"
jvmArg "-Dmixin.checks.interfaces=true"
}
server {
workingDirectory project.file('run\\server')
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'info'
jvmArg "-Dmixin.hotSwap=true"
jvmArg "-Dmixin.checks.interfaces=true"
}
}
}
sourceSets.all {
it.output.resourcesDir = it.output.classesDirs.getFiles().iterator().next()
}
repositories {
maven {
name = "CoFH Maven"
url = "https://maven.covers1624.net"
}
maven {
url = uri('https://www.cursemaven.com')
content {
includeGroup 'curse.maven'
}
}
maven {
url "https://chickenbones.net/maven/"
}
maven {
name = 'Modrinth'
url = uri('https://api.modrinth.com/maven')
content {
includeGroup 'maven.modrinth'
}
}
maven {
url = uri('https://maven.blamejared.com')
}
maven {
url = uri('https://m2.dv8tion.net/releases')
}
}
dependencies {
minecraft "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}"
implementation fg.deobf("cofh:RedstoneFlux:${rf_version}:universal")
implementation fg.deobf("mezz.jei:jei_${minecraft_version}:${jei_version}")
implementation fg.deobf("codechicken:CodeChickenLib:${minecraft_version}-${ccl_version}:universal")
implementation "curse.maven:FTBLib-237167:2832410"
implementation "curse.maven:ElectroblobsWizardry-265642:4284076"
implementation "curse.maven:infinitylib-251396:3317119"
implementation "curse.maven:agricraft-225635:3317747"
}
buildConfig {
appName = project.name // sets value of NAME field
version = project.version // sets value of VERSION field,
clsName = 'BuildConfig' // sets the name of the BuildConfig class
packageName = 'net.shadowmage.ancientwarfare' // sets the package of the BuildConfig class,
charset = 'UTF-8' // sets charset of the generated class,
buildConfigField 'boolean', 'UNSTABLE', {isUnstable()}
}
processResources{
duplicatesStrategy = DuplicatesStrategy.INCLUDE
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft_version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
rename '(.+_at.cfg)', 'META-INF/$1'
}
jar {
manifest {
attributes 'FMLAT': 'ancientwarfare_at.cfg'
}
}
static def getBuildNumber() {
if (System.getenv("GITHUB_RUN_NUMBER") != null) {
return Integer.valueOf(Integer.parseInt(System.getenv("GITHUB_RUN_NUMBER")) + 830).toString()
}
return ""
}
def getStable() {
if (isUnstable()) {
return "unstable"
}
return ""
}
def isUnstable() {
// return (System.getenv("GITHUB_REF") == null || System.getenv("GITHUB_REF").endsWith("-dev"));
return false; // I don't want to deal with people not trusting the build
}
task minifyStructureTemplates(type: MinifyStructuresTask) {
templateFolder = "$projectDir/src/main/resources/assets/ancientwarfare/template/"
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/P3pp3rF1y/AncientWarfare2")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GPR_USER")
password = project.findProperty("gpr.key") ?: System.getenv("GPR_API_KEY")
}
}
}
publications {
gpr(MavenPublication) {
artifactId 'ancientwarfare2'
from components.java
}
}
}
configurations {
create("compile")
}