This repository has been archived by the owner on Jun 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
141 lines (131 loc) · 4.55 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
buildscript {
repositories {
jcenter()
maven { url = "http://files.minecraftforge.net/maven" }
maven { url 'https://jitpack.io' }
}
dependencies {
classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT"
classpath "com.github.jengelman.gradle.plugins:shadow:4.0.4"
}
}
plugins {
id "com.matthewprenger.cursegradle" version "1.1.0"
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
version = modVersion
group = "de.erdbeerbaerlp.worldManager" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "worldmanager"
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
options.encoding = 'UTF-8'
}
mainClassName = "de.erdbeerbaerlp.worldManager.Main"
minecraft {
version = project.forgeVersion
runDir = "run"
// 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 = project.mcpVersion
makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
}
repositories {
jcenter()
maven { url 'https://jitpack.io' }
mavenCentral()
}
configurations {
shade
compile.extendsFrom shade
}
reobf {
shadowJar { mappingType = 'SEARGE' }
}
shadowJar {
classifier = ''
configurations = [project.configurations.shade]
relocate "org.apache", "wmshadow.org.apache"
relocate "org.slf4j", "wmshadow.org.slf4j"
relocate "org.jsoup", "wmshadow.org.jsoup"
relocate "org.json", "wmshadow.org.json"
relocate "com.google.gson", "wmshadow.com.google.gson"
}
dependencies {
shade group: 'org.json', name: 'json', version: '20180813'
shade 'com.github.ErdbeerbaerLP:CurseAPI:2a6ce93777'
shade group: 'commons-io', name: 'commons-io', version: '2.5'
shade 'com.github.neilwightman:jnbt:master-SNAPSHOT'
shade 'com.github.zeroturnaround:zt-zip:master'
}
tasks.build.dependsOn reobfShadowJar
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// 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"
}
}
jar {
manifest {
attributes(
'Maven-Artifact': "${project.group}:${project.archivesBaseName}:${project.version}",
'Timestamp': System.currentTimeMillis(),
'Class-Path': configurations.compile.collect { it.getName() }.join(' '),
'Main-Class': 'de.erdbeerbaerlp.worldManager.Main'
)
}
}
curseforge {
// $GRADLE_USER_HOME/gradle.properties
if (project.hasProperty('curseforge.apikey')) {
apiKey = getProperty("curseforge.apikey")
project {
id = '305393'
changelog = project.changelog
releaseType = 'beta'
addGameVersion '1.12.2'
addGameVersion '1.12.1'
addGameVersion '1.12'
addGameVersion '1.11.2'
addGameVersion '1.11.1'
addGameVersion '1.11'
addGameVersion '1.10.2'
addGameVersion '1.10.1'
addGameVersion '1.10'
addGameVersion '1.9.4'
addGameVersion '1.9.3'
addGameVersion '1.9.2'
addGameVersion '1.9.1'
addGameVersion '1.9'
addGameVersion '1.8.9'
addGameVersion '1.8.8'
addGameVersion '1.8.7'
addGameVersion '1.8.6'
addGameVersion '1.8.5'
addGameVersion '1.8.4'
addGameVersion '1.8.3'
addGameVersion '1.8.2'
addGameVersion '1.8.1'
addGameVersion '1.8'
mainArtifact(jar) {
displayName = "EasyWorldManager-$project.version (MC 1.8-1.12)"
}
}
}
}
tasks.curseforge.dependsOn(build)