forked from Blueberryy/CharmForge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
157 lines (134 loc) · 4.63 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
import groovy.json.JsonBuilder
import groovy.json.JsonSlurper
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
maven { url = 'https://repo.spongepowered.org/maven' }
jcenter()
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7-SNAPSHOT'
}
}
plugins {
id "com.wynprice.cursemaven" version "2.1.1"
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.spongepowered.mixin'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
archivesBaseName = project.archives_base_name
version = project.mod_version
group = "${project.maven_group}.${project.mod_id}"
minecraft {
mappings channel: "${project.mapping_channel}", version: "${project.mapping_version}"
accessTransformer = file("src/main/resources/META-INF/accesstransformer.cfg")
runs {
client {
properties 'forge.logging.console.level': 'debug'
properties 'fml.earlyprogresswindow': 'false'
properties 'mixin.env.disableRefMap': 'true'
workingDirectory project.file('run')
arg "-mixin.config=charm.mixins.json"
source sourceSets.main
jvmArgs "-Xmx1500M"
}
server {
properties 'forge.logging.console.level': 'debug'
properties 'mixin.env.disableRefMap': 'true'
workingDirectory project.file('run')
arg "-mixin.config=charm.mixins.json"
source sourceSets.main
}
}
}
dependencies {
minecraft "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}"
// third party
compile fg.deobf("vazkii.quark:Quark:${project.quark_version}")
compile fg.deobf("vazkii.autoreglib:AutoRegLib:${project.arl_version}")
compileOnly fg.deobf("mezz.jei:jei-${project.minecraft_version}:${project.jei_version}:api")
runtimeOnly fg.deobf("mezz.jei:jei-${project.minecraft_version}:${project.jei_version}")
// for testing apotheosis
//compile fg.deobf("curse.maven:apotheosis:3095843")
//compile fg.deobf("curse.maven:placebo:3092113")
// for testing buzzier bees
//compile fg.deobf("curse.maven:abnormals-core:3154969")
//compile fg.deobf("curse.maven:buzzier-bees:3154937")
//compile fg.deobf("enchantedwolves:enchantedwolves:1.1.0.1")
//compile fg.deobf("CraftingTweaks:CraftingTweaks:1.16.3-12.2.0")
}
repositories {
maven {
// for AutoRegLib
name "blamejared"
url "https://maven.blamejared.com/"
}
maven {
// for JEI
name "progwml6"
url "https://dvs1.progwml6.com/files/maven"
}
maven {
// for Mappings
name "gigaherz"
url "https://dogforce-games.com/maven/"
}
flatDir {
// for including local jar files
dirs "libs"
}
}
mixin {
add sourceSets.main, 'charm.mixins.refmap.json'
}
processResources {
// replace stuff in mcmod.info, nothing else
filesMatching("META-INF/mods.toml") {
expand 'mod_version': project.version
}
exclude("META-INF/*.variants")
//expand resource templates
filesMatching("**/*.template.json") {
JsonBuilder json = new JsonBuilder(new JsonSlurper().parseText(it.file.text))
String template = new JsonBuilder(json.content.template).toPrettyString()
def v = json.content.variants
Iterable<String> variants
if (v instanceof String) variants = file("${sourceSets.main.resources.srcDirs[0]}/META-INF/${v}.variants").readLines().findAll { !it.isEmpty() }
else variants = v
File dir = it.relativePath.parent.getFile(file("$buildDir/resources/main"))
dir.mkdirs()
String name = it.name.replace(".template.json", ".json")
for (variant in variants) {
def file = new File(dir, name.replace("VARIANT", variant))
file.createNewFile()
file.text = template.replace("VARIANT", variant)
}
it.exclude()
}
}
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}
jar {
archiveName = "${project.archives_base_name}-${project.mod_version}.${extension}"
manifest {
attributes([
"Specification-Title": "${project.mod_id}",
"Specification-Vendor": "svenhjol",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": "${project.mod_id}",
"Implementation-Version": "${project.mod_version}",
"Implementation-Vendor": "svenhjol",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"MixinConfigs": "charm.mixins.json"
])
}
exclude "**/*.bat"
exclude "**/*.psd"
exclude "**/*.exe"
exclude "**/unused"
}