Skip to content

Commit

Permalink
Fix the shading
Browse files Browse the repository at this point in the history
  • Loading branch information
derimagia committed Jun 8, 2017
1 parent d614773 commit 2605cfa
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 35 deletions.
38 changes: 25 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@ buildscript {
maven { url = "http://files.minecraftforge.net/maven" }
}
dependencies {
classpath "net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT"
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.0'
}
}

plugins {
id "com.github.johnrengelman.shadow" version "1.2.3" // shading
}

apply plugin: "net.minecraftforge.gradle.forge" // adds the forge dependency
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'java'

targetCompatibility = sourceCompatibility = JavaVersion.VERSION_1_8

version = "1.10.2-0.2.0"
group= "com.derimagia.forgeslack" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
group= "com.derimagia.forgeslack"
archivesBaseName = "forgeslack"

repositories {
Expand All @@ -35,6 +34,10 @@ minecraft {

dependencies {
compile group: 'com.github.allbegray', name: 'slack-api', version: 'v1.4.0.RELEASE'

// Manually include `org.slf4j` for slack-api
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
}

processResources {
Expand All @@ -58,11 +61,20 @@ processResources {

shadowJar {
classifier = ""
relocate "com.github.allbegray", "com.derimagia.forgeslack.com.github.allbegray"
relocate "com.fasterxml.jackson.core", "com.derimagia.forgeslack.com.fasterxml.jackson.core"
relocate "org.apache.http", "com.derimagia.forgeslack.org.apache.http"
relocate "org.asynchttpclient", "com.derimagia.forgeslack.org.asynchttpclient"
// Can't relocate this because of something with AsyncHttpClientConfigDefaults:ASYNC_CLIENT_CONFIG_ROOT
// but most likely this won't matter because these libraries aren't probably used elsewhere.
// relocate "allbegray.slack", "com.derimagia.lib.com.github.allbegray"
// relocate "org.asynchttpclient", "com.derimagia.lib.org.asynchttpclient"
relocate "com.fasterxml.jackson.core", "com.derimagia.lib.com.fasterxml.jackson.core"
relocate "org.apache.http", "com.derimagia.lib.org.apache.http"
relocate "org.apache.commons", "com.derimagia.lib.org.apache.commons"
relocate "org.slf4j", "com.derimagia.lib.org.slf4j"
relocate "io.netty", "com.derimagia.lib.io.netty"
relocate "com.typesafe", "com.derimagia.lib.com.typesafe"
relocate "com.fasterxml", "com.derimagia.lib.com.fasterxml"
relocate "javassist", "com.derimagia.lib.javassist"
}

reobf { shadowJar { mappingType = "SEARGE" } }
tasks.reobfShadowJar.mustRunAfter shadowJar
reobf {
shadowJar { mappingType = 'SEARGE' }
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-all.zip
distributionUrl=https://services.gradle.org/distributions/gradle-3.5-all.zip
6 changes: 0 additions & 6 deletions src/main/java/com/derimagia/forgeslack/ForgeSlack.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,13 @@
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;

import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.event.FMLServerStoppedEvent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
* @author derimagia
*/
@Mod(modid = ForgeSlack.modId, name = ForgeSlack.modId, version = ForgeSlack.version, acceptableRemoteVersions = "*")
public class ForgeSlack {

public static final String modId = "forgeslack";
public static final String version = "0.2.0";

Expand Down Expand Up @@ -49,5 +44,4 @@ public void serverStopped(FMLServerStoppedEvent event) {
slackRelay.shutdown();
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

import java.io.File;

/**
* @author derimagia
*/
public class ConfigurationHandler
{
private static Configuration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent;

/**
* @author derimagia
*/
public class FMLEventHandler {
@SubscribeEvent
public void onJoin(PlayerEvent.PlayerLoggedInEvent event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.event.ServerChatEvent;


/**
* @author derimagia
*/
public class ForgeEventHandler {

@SubscribeEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
import com.fasterxml.jackson.databind.JsonNode;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.fml.common.FMLCommonHandler;

import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class SlackMessageHandler implements EventListener {
// Mainly Copied from ForgeHooks
static final Pattern URL_PATTERN = Pattern.compile(
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/com/derimagia/forgeslack/slack/SlackRelay.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
import java.util.HashMap;
import java.util.List;

/**
* @author derimagia
*/
public class SlackRelay {
private static SlackRelay instance;
private SlackWebApiClient api;
Expand Down

0 comments on commit 2605cfa

Please sign in to comment.