Skip to content

Commit

Permalink
Build script: added shaded jar
Browse files Browse the repository at this point in the history
  • Loading branch information
abvadabra committed Dec 8, 2015
1 parent 6ef2124 commit d949427
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 13 deletions.
37 changes: 32 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildscript {

apply plugin: 'forge'

version = "1.0"
version = "v1.2.0"
group= "com.rabbit"
archivesBaseName = "rabbit-gui"

Expand All @@ -26,21 +26,48 @@ minecraft {
runDir = "eclipse"
}

configurations {
shade
compile.extendsFrom shade
}

dependencies {
shade 'net.objecthunter:exp4j:0.4.5'
}

task shadedJar(type: Jar){
from (sourceSets.main.output) {
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
}
configurations.shade.each{ dep ->
from(project.zipTree(dep)){
exclude 'META-ING', 'META-INF/**'
}
}
classifier = 'shaded'
}

task sourceJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}

tasks.build.dependsOn('sourceJar')
def action = new Action<net.minecraftforge.gradle.tasks.user.reobf.ArtifactSpec>(){
void execute(net.minecraftforge.gradle.tasks.user.reobf.ArtifactSpec artifactSpec) {
artifactSpec.classpath = sourceSets.main.compileClasspath
}
}

reobf.reobf(shadedJar, action)

tasks.jar.dependsOn('sourceJar', 'shadedJar')

artifacts {
archives jar
archives sourceJar
archives shadedJar
}

dependencies {
compile 'net.objecthunter:exp4j:0.4.5'
}

compileJava {
sourceCompatibility = 1.8
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/rabbit/gui/GuiFoundation.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import net.minecraft.client.Minecraft;

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

@Mod.EventHandler
public void postLoad(FMLPostInitializationEvent event) {
FMLLog.info("Rabbit Gui has been successfuly initialized");
FMLLog.info("Rabbit Gui has been successfully initialized");
}

/**
Expand Down
12 changes: 6 additions & 6 deletions src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[
{
"modid": "examplemod",
"name": "Example Mod",
"description": "Example placeholder mod.",
"modid": "rabbit-gui",
"name": "Rabbit GUI library",
"description": "Graphical framework built on top of Forge Mod Loader and designed to facilitate the creation of graphical user interfaces.",
"version": "${version}",
"mcversion": "${mcversion}",
"url": "",
"url": "https://github.com/FRedEnergy/rabbit-gui",
"updateUrl": "",
"authorList": ["ExampleDude"],
"credits": "The Forge and FML guys, for making this example",
"authorList": ["RedEnergy"],
"credits": "JavaFX and Android team for inspiration",
"logoFile": "",
"screenshots": [],
"dependencies": []
Expand Down

0 comments on commit d949427

Please sign in to comment.