-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.gradle
130 lines (106 loc) · 3.5 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
import org.apache.tools.ant.filters.ReplaceTokens
import java.nio.file.Paths
plugins {
id 'net.minecraftforge.gradle' version '5.1.+'
}
apply plugin: 'idea'
version = mod_version
group = 'com.teamwizardry'
def tokens = [VERSION: mod_version]
def included = ['com/teamwizardry/wizardry/Wizardry.java']
def expandedSrc = new File(project.buildDir, 'expandedSrc')
def srcMainJava = project.file('src/main/java').toPath()
def includedPaths = included.collect { Paths.get(it) }
task javaReplaceTokens(type: Copy) {
inputs.property 'tokens', tokens
from(srcMainJava) {
include included
}
into expandedSrc
filter(ReplaceTokens, beginToken: '@', endToken: '@', tokens: tokens)
}
compileJava {
dependsOn javaReplaceTokens
exclude {
srcMainJava.relativize(it.file.toPath()) in includedPaths
}
source expandedSrc
}
java {
archivesBaseName = 'wizardry'
toolchain.languageVersion = JavaLanguageVersion.of(8)
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
minecraft {
mappings channel: 'stable', version: '39-1.12'
accessTransformer = file('src/main/resources/dev_ats.cfg')
runs {
client {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'fml.coreMods.load', 'com.teamwizardry.librarianlib.asm.LibLibCorePlugin'
mods {
wizardry {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'fml.coreMods.load', 'com.teamwizardry.librarianlib.asm.LibLibCorePlugin'
mods {
wizardry {
source sourceSets.main
}
}
}
}
}
repositories {
mavenCentral()
maven { url = "https://jitpack.io" }
maven { url = "https://cursemaven.com" }
maven { url = "https://dvs1.progwml6.com/files/maven" }
maven { url = "https://maven.tterrag.com/" }
maven { url = "https://maven.shadowfacts.net/" }
maven { url = "https://maven.thiakil.com" }
maven { url = 'https://files.minecraftforge.net/maven' }
}
dependencies {
minecraft "net.minecraftforge:forge:$mc_version-$forge_version"
compileOnly fg.deobf('mezz.jei:jei_1.12.2:4.16.1.302:api')
runtimeOnly fg.deobf('mezz.jei:jei_1.12.2:4.16.1.302')
runtimeOnly "team.chisel.ctm:CTM:$ctm_version"
implementation 'net.shadowfacts:Forgelin:1.8.4'
implementation fg.deobf('curse.maven:librarianlib-252910:2989926')
implementation fg.deobf('com.azanor.baubles:Baubles:1.12-1.5.2')
}
jar {
manifest {
attributes(
"FMLCorePluginContainsFMLMod": "true",
"FMLCorePlugin": "$core_plugin"
)
}
exclude 'dev_ats.cfg'
}
processResources {
inputs.property 'mod_version', project.version
inputs.property 'mc_version', mc_version
setDuplicatesStrategy(DuplicatesStrategy.WARN)
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info', 'pack.mcmeta'
expand 'mod_version': project.version,
'mc_version': mc_version
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info', 'pack.mcmeta'
}
}
jar.finalizedBy('reobfJar')
idea { module { inheritOutputDirs = true } }