Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
Merge pull request #51 from JoshCode/dev
Browse files Browse the repository at this point in the history
Release 1.1.1
  • Loading branch information
JoshCode committed Dec 10, 2017
2 parents becd68e + 3601a09 commit 0369936
Show file tree
Hide file tree
Showing 57 changed files with 3,046 additions and 2,864 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ conf
/dist/

/gource/

# Ignore !history command output
*.history
15 changes: 9 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
language: java
jdk:
- oraclejdk8
- oraclejdk9

script:
- sh ./src/travis/serenity.sh
- mvn test -B

after_success:
- mvn clean cobertura:cobertura coveralls:report -DrepoToken=$COVERALLS_TOKEN

before_deploy:
- mvn package
Expand All @@ -9,10 +16,6 @@ before_deploy:
- ls
- cd ..

script:
- sh ./src/travis/serenity.sh
- mvn test -B

deploy:
provider: releases
api-key: "$GITHUB_TOKEN"
Expand All @@ -21,7 +24,7 @@ deploy:
on:
tags: true
all_branches: true
jdk: oraclejdk8
jdk: oraclejdk9

notifications:
email:
Expand Down
196 changes: 100 additions & 96 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,103 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>nl.codefox</groupId>
<artifactId>gilmore</artifactId>
<version>1.0.3</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>nl.codefox.gilmore.Launcher</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

</plugins>
</build>
<groupId>nl.codefox</groupId>
<artifactId>gilmore</artifactId>
<version>1.1.1</version>

<repositories>
<repository>
<id>jcenter</id>
<name>jcenter-bintray</name>
<url>http://jcenter.bintray.com</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.9</source>
<target>1.9</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>nl.codefox.gilmore.Launcher</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>4.3.0</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
<configuration>
<format>xml</format>
<maxmem>256m</maxmem>
<!-- aggregated reports for multi-module projects -->
<aggregate>true</aggregate>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>

<dependencies>
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>3.0.BETA2_108</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.53</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.6.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.39</version>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.22.0</version>
</dependency>
<dependency>
<groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client-jetty</artifactId>
<version>1.22.0</version>
</dependency>
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-sheets</artifactId>
<version>v4-rev2-1.22.0</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.5</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>jcenter</id>
<name>jcenter-bintray</name>
<url>http://jcenter.bintray.com</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>3.3.0_260</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId> <!-- Maven says it's unused. It's not -->
<artifactId>mysql-connector-java</artifactId>
<version>5.1.39</version>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.22.0</version>
</dependency>
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-sheets</artifactId>
<version>v4-rev2-1.22.0</version>
</dependency>
</dependencies>
</project>
100 changes: 46 additions & 54 deletions src/main/java/nl/codefox/gilmore/Gilmore.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,82 +5,74 @@
import net.dv8tion.jda.core.JDABuilder;
import net.dv8tion.jda.core.entities.Game;
import net.dv8tion.jda.core.exceptions.RateLimitedException;
import nl.codefox.gilmore.command.AboutCommand;
import nl.codefox.gilmore.command.CriticalRoleCommand;
import nl.codefox.gilmore.command.CustomCommand;
import nl.codefox.gilmore.command.DiceCommand;
import nl.codefox.gilmore.command.GameCommand;
import nl.codefox.gilmore.command.HelpCommand;
import nl.codefox.gilmore.command.MuteCommand;
import nl.codefox.gilmore.command.UnmuteCommand;
import nl.codefox.gilmore.command.*;
import nl.codefox.gilmore.config.GilmoreConfiguration;
import nl.codefox.gilmore.listener.ChannelListener;
import nl.codefox.gilmore.listener.ConnectionListener;
import nl.codefox.gilmore.util.Logging;

import javax.security.auth.login.LoginException;
import java.io.File;
import java.io.IOException;

import javax.security.auth.login.LoginException;

public class Gilmore {

private static JDA JDA_INSTANCE;
private static ChannelListener commandListener;
private static ConnectionListener connectionListener;
private static JDA JDA_INSTANCE;
private static ChannelListener commandListener;
private static ConnectionListener connectionListener;

public static void main(String[] args) {

public static void main(String[] args) {
try {
Logging.info("Gilmore starting up!");
GilmoreConfiguration config = GilmoreConfiguration.getInstance();

try {
Logging.info("Gilmore starting up!");
GilmoreConfiguration config = GilmoreConfiguration.getInstance();
File logLocation = config.getLogLocation();
new File(logLocation.getParent()).mkdirs();
try {
logLocation.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}

File logLocation = config.getLogLocation();
new File(logLocation.getParent()).mkdirs();
try {
logLocation.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
JDABuilder builder = new JDABuilder(AccountType.BOT);

JDABuilder builder = new JDABuilder(AccountType.BOT);
builder.setToken(config.getBotToken());

builder.setToken(config.getBotToken());
commandListener = new ChannelListener()
.registerCommand(new AboutCommand())
.registerCommand(new HelpCommand())
.registerCommand(new GameCommand())
.registerCommand(new DiceCommand())
.registerCommand(new MuteCommand())
.registerCommand(new UnmuteCommand())
.registerCommand(new CustomCommand());

commandListener = new ChannelListener()
.registerCommand(new AboutCommand())
.registerCommand(new HelpCommand())
.registerCommand(new GameCommand())
.registerCommand(new DiceCommand())
.registerCommand(new MuteCommand())
.registerCommand(new UnmuteCommand())
.registerCommand(new CustomCommand())
.registerCommand(new CriticalRoleCommand());
connectionListener = new ConnectionListener();

connectionListener = new ConnectionListener();
builder.addEventListener(commandListener);
builder.addEventListener(connectionListener);

builder.addListener(commandListener);
builder.addListener(connectionListener);
JDA_INSTANCE = builder.buildBlocking();

JDA_INSTANCE = builder.buildBlocking();
JDA_INSTANCE.getPresence().setGame(Game.of("with your hearts"));

JDA_INSTANCE.getPresence().setGame(Game.of("with your hearts"));
} catch (LoginException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (RateLimitedException e) {
e.printStackTrace();
}

} catch (LoginException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (RateLimitedException e) {
e.printStackTrace();
}
}

}
public static JDA getJDA() {
return JDA_INSTANCE;
}

public static JDA getJDA() {
return JDA_INSTANCE;
}
public static ChannelListener getCommandListener() {
return commandListener;
}

public static ChannelListener getCommandListener() {
return commandListener;
}
}
Loading

0 comments on commit 0369936

Please sign in to comment.