This repository has been archived by the owner on Nov 12, 2020. It is now read-only.
forked from RobertSkalko/Old-Mine-and-Slash
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
164 lines (117 loc) · 4.2 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
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
maven { url 'https://plugins.gradle.org/m2/' }
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
classpath 'com.google.code.gson:gson:2.8.5'
}
}
plugins {
id 'com.github.johnrengelman.shadow' version '4.0.2'
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
version = "${version_minecraft}-${mod_version}"
group = "${mod_group}"
archivesBaseName = "${mod_name}"
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
minecraft {
mappings channel: 'snapshot', version: "${version_mcp}".toString()
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
client {
workingDirectory project.file('run')
ideaModule = "${project.name}.main"
//property 'forge.logging.console.level', 'debug'
mods {
mmorpg {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
ideaModule = "${project.name}.main"
//property 'forge.logging.console.level', 'debug'
mods {
mmorpg {
source sourceSets.main
}
}
}
intellijClient { // run this in debug so hotswap doesnt randomly fail
parent runs.client
ideaModule "${project.name}.main"
environment 'MOD_CLASSES', "${project.file("out/production/resources").canonicalPath};${project.file("out/production/classes").canonicalPath}"
}
data {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
//property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP,CORE,PULSARCONFIG'
// Recommended logging level for the console
//property 'forge.logging.console.level', 'debug'
mods {
mmorpg {
source sourceSets.main
}
}
args '--mod', 'mmorpg', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources')
}
}
}
sourceSets {
main {
resources {
srcDirs += project.file("src/generated/resources")
}
}
}
repositories {
jcenter()
maven {
name = "jitpack"
url "https://jitpack.io"
}
maven { url "https://maven.tterrag.com/" }
//maven { url = "https://maven2.tterrag.com" } // AutoSave
maven { url = "https://maven.theillusivec4.top/" } // curios
maven {
name = "CurseForge"
url = "https://minecraft.curseforge.com/api/maven/"
}
}
configurations {
// configuration that holds jars to embed inside the jar
embed
compile.extendsFrom(embed)
}
dependencies {
minecraft "net.minecraftforge:forge:${version_forge}"
compile fg.deobf("top.theillusivec4.curios:curios:${version_curios}") // Trinkets, REQUIRED
compile 'com.google.code.gson:gson:2.8.5' // Serialize More Difficult Configs, REQUIRED
}
jar {
from configurations.embed.collect {
it.isDirectory() ? it : zipTree(it).matching {
exclude 'META-INF', 'META-INF/**'
}
}
manifest {
attributes(["Specification-Title" : "${mod_name}",
"Specification-Vendor" : "${mod_author}",
"Specification-Version" : "${version}",
"Implementation-Title" : "${mod_name}",
"Implementation-Version" : "${version}",
"Implementation-Vendor" : "${mod_author}",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],)
}
}
task deobfJar(type: Jar) {
classifier = 'deobf'
from sourceSets.main.output
}