forked from DJtheRedstoner/LWJGLTwoPointFive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
123 lines (101 loc) · 3.08 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
buildscript {
repositories {
mavenCentral()
gradlePluginPortal()
maven {
name = "jitpack"
url = "https://jitpack.io/"
}
maven {
name = "forge"
url = "https://files.minecraftforge.net/maven"
}
}
dependencies {
classpath "com.github.asbyth:ForgeGradle:ddb1eb01af"
classpath "com.github.jengelman.gradle.plugins:shadow:6.1.0"
}
}
apply plugin: "net.minecraftforge.gradle.forge"
apply plugin: "com.github.johnrengelman.shadow"
version = "1.0-SNAPSHOT"
group= "me.djtheredstoner"
archivesBaseName = "LWJGLTwoPointFive"
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceSets {
main {
output.resourcesDir = java.outputDir
}
}
configurations {
lwjgl
lwjglNative {
transitive = false
}
}
sourceSets.main.runtimeClasspath += configurations.lwjglNative
minecraft {
version = "1.8.9-11.15.1.2318-1.8.9"
runDir = "run"
mappings = "stable_22"
makeObfSourceJar = false
clientJvmArgs += "-Dfml.coreMods.load=me.djtheredstoner.lwjgl.plugin.LoadingPlugin"
}
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
task lwjglJar(type: ShadowJar) {
group = "shadow"
archiveClassifier.set("lwjgl")
configurations = [project.configurations.lwjgl]
exclude "META-INF/versions/**"
exclude "**/module-info.class"
exclude "**/package-info.class"
relocate("org.lwjgl", "org.lwjgl3") {
include "org.lwjgl.PointerBuffer"
include "org.lwjgl.BufferUtils"
}
}
dependencies {
lwjgl "org.lwjgl:lwjgl:3.3.0"
lwjgl "org.lwjgl:lwjgl-tinyfd:3.3.0"
lwjgl "org.lwjgl:lwjgl-nanovg:3.3.0"
lwjglNative "org.lwjgl:lwjgl:3.3.0:natives-windows"
lwjglNative "org.lwjgl:lwjgl-tinyfd:3.3.0:natives-windows"
lwjglNative "org.lwjgl:lwjgl-nanovg:3.3.0:natives-windows"
implementation lwjglJar.outputs.files
}
jar { enabled = false }
reobfJar { enabled = false }
shadowJar {
archiveClassifier.set("")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest.attributes(
"FMLCorePlugin": "me.djtheredstoner.lwjgl.plugin.LoadingPlugin",
"FMLCorePluginContainsFMLMod": "No (but actually yes)"
)
configurations += [project.configurations.lwjglNative]
}
reobf {
shadowJar {}
}
build.dependsOn shadowJar
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'
}
}