Skip to content

Commit d949427

Browse files
committed
Build script: added shaded jar
1 parent 6ef2124 commit d949427

3 files changed

Lines changed: 40 additions & 13 deletions

File tree

build.gradle

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ buildscript {
1717

1818
apply plugin: 'forge'
1919

20-
version = "1.0"
20+
version = "v1.2.0"
2121
group= "com.rabbit"
2222
archivesBaseName = "rabbit-gui"
2323

@@ -26,21 +26,48 @@ minecraft {
2626
runDir = "eclipse"
2727
}
2828

29+
configurations {
30+
shade
31+
compile.extendsFrom shade
32+
}
33+
34+
dependencies {
35+
shade 'net.objecthunter:exp4j:0.4.5'
36+
}
37+
38+
task shadedJar(type: Jar){
39+
from (sourceSets.main.output) {
40+
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
41+
}
42+
configurations.shade.each{ dep ->
43+
from(project.zipTree(dep)){
44+
exclude 'META-ING', 'META-INF/**'
45+
}
46+
}
47+
classifier = 'shaded'
48+
}
49+
2950
task sourceJar(type: Jar) {
3051
from sourceSets.main.allSource
3152
classifier = 'sources'
3253
}
3354

34-
tasks.build.dependsOn('sourceJar')
55+
def action = new Action<net.minecraftforge.gradle.tasks.user.reobf.ArtifactSpec>(){
56+
void execute(net.minecraftforge.gradle.tasks.user.reobf.ArtifactSpec artifactSpec) {
57+
artifactSpec.classpath = sourceSets.main.compileClasspath
58+
}
59+
}
60+
61+
reobf.reobf(shadedJar, action)
62+
63+
tasks.jar.dependsOn('sourceJar', 'shadedJar')
3564

3665
artifacts {
3766
archives jar
3867
archives sourceJar
68+
archives shadedJar
3969
}
4070

41-
dependencies {
42-
compile 'net.objecthunter:exp4j:0.4.5'
43-
}
4471

4572
compileJava {
4673
sourceCompatibility = 1.8

src/main/java/com/rabbit/gui/GuiFoundation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
88
import net.minecraft.client.Minecraft;
99

10-
@Mod(modid = "rabbit-gui", name = "Rabbit Gui Library")
10+
@Mod(modid = "rabbit-gui", name = "Rabbit Gui Library", version = "v1.2.0")
1111
public class GuiFoundation {
1212

1313
@Mod.EventHandler
1414
public void postLoad(FMLPostInitializationEvent event) {
15-
FMLLog.info("Rabbit Gui has been successfuly initialized");
15+
FMLLog.info("Rabbit Gui has been successfully initialized");
1616
}
1717

1818
/**

src/main/resources/mcmod.info

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[
22
{
3-
"modid": "examplemod",
4-
"name": "Example Mod",
5-
"description": "Example placeholder mod.",
3+
"modid": "rabbit-gui",
4+
"name": "Rabbit GUI library",
5+
"description": "Graphical framework built on top of Forge Mod Loader and designed to facilitate the creation of graphical user interfaces.",
66
"version": "${version}",
77
"mcversion": "${mcversion}",
8-
"url": "",
8+
"url": "https://github.com/FRedEnergy/rabbit-gui",
99
"updateUrl": "",
10-
"authorList": ["ExampleDude"],
11-
"credits": "The Forge and FML guys, for making this example",
10+
"authorList": ["RedEnergy"],
11+
"credits": "JavaFX and Android team for inspiration",
1212
"logoFile": "",
1313
"screenshots": [],
1414
"dependencies": []

0 commit comments

Comments
 (0)