diff --git a/build.gradle b/build.gradle index 6c1b622..168d333 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,19 @@ +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.coders-kitchen:compileonlyplugin:1.0.0' + } +} plugins { id "com.ewerk.gradle.plugins.annotation-processor" version "1.0.2" + id "com.github.ben-manes.versions" version "0.12.0" } apply plugin: 'java' apply plugin: 'idea' apply plugin: 'application' +apply plugin: 'compileOnly' defaultTasks 'deploy' @@ -51,17 +61,18 @@ dependencies { compile 'commons-codec:commons-codec:1.10' compile 'commons-logging:commons-logging:1.2' - compile 'commons-net:commons-net:1.4.1' - compile 'commons-cli:commons-cli:1.2' + compile 'commons-net:commons-net:3.4' + compile 'commons-cli:commons-cli:1.3.1' compile 'commons-httpclient:commons-httpclient:3.1' compile 'oro:oro:2.0.8' compile 'org.jdom:jdom:1.1.3' + compile 'org.jdom:jdom2:2.0.6' compile 'org.jsoup:jsoup:1.8.3' compile 'rome:rome:1.0@jar' compile 'rome:rome-fetcher:1.0@jar' - compile 'org.json:json:20150729' + compile 'org.json:json:20151123' compile 'org.ostermiller:utils:1.07.00' compile 'net.sourceforge.jweather:jweather:0.3.0@jar' @@ -70,12 +81,12 @@ dependencies { compile 'org.twitter4j:twitter4j-core:4.0.4' compile 'net.sf.delicious-java:delicious:1.14' - compile 'net.thauvin.erik:semver:0.9.1-beta' + compileOnly 'net.thauvin.erik:semver:0.9.5-beta' } annotationProcessor { project.version = getVersion(isRelease) - library 'net.thauvin.erik:semver:0.9.1-beta' + library 'net.thauvin.erik:semver:0.9.5-beta' processor 'net.thauvin.erik.semver.VersionProcessor' } diff --git a/mobibot.iml b/mobibot.iml index 78a2fd9..58ff58e 100644 --- a/mobibot.iml +++ b/mobibot.iml @@ -1,5 +1,5 @@ - + @@ -18,8 +18,6 @@ - - @@ -31,13 +29,15 @@ - - - + + + + + - + - + - + @@ -454,13 +454,13 @@ - + - + - + @@ -499,13 +499,13 @@ - + - + - + @@ -517,22 +517,22 @@ - + - + - + - + - + - + diff --git a/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java b/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java index c2a290f..e3e8542 100644 --- a/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java +++ b/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java @@ -1,128 +1,129 @@ /* - * This file is automatically generated by the Semantic Version Annotation Processor. - * Do not modify this file -- YOUR CHANGES WILL BE ERASED! + * This file is automatically generated. + * Do not modify! -- ALL CHANGES WILL BE ERASED! */ package net.thauvin.erik.mobibot; import java.util.Date; /** - * This class provides semantic version information. + * Provides semantic version information. * - * @author Semantic Version Annotation Processor + * @author Semantic Version + * Annotation Processor */ public final class ReleaseInfo { - private final static String buildmeta = "002"; - private final static Date date = new Date(1453769004642L); + private final static String buildmeta = "003"; + private final static Date date = new Date(1454706693276L); private final static int major = 0; private final static int minor = 6; private final static int patch = 1; private final static String prerelease = "beta"; private final static String project = "mobibot"; - /** - * Returns the build date. - * - * @return The build date. - */ - public static Date getBuildDate() { - return date; - } + /** + * Disables the default constructor. + * + * @throws UnsupportedOperationException If the constructor is called. + */ + private ReleaseInfo() + throws UnsupportedOperationException { + throw new UnsupportedOperationException("Illegal constructor call."); + } - /** - * Returns the full version string. - *

- * Formatted as: - *

- * MAJOR.MINOR.PATCH[-PRERELEASE][+BUILDMETADATA] - *
- *

- * For example: - *

    - *
  • 1.0.0
  • - *
  • 1.0.0-beta
  • - *
  • 1.0.0+20160124144700
  • - *
  • 1.0.0-alpha+001
  • - *
- * - * @return The version string. - */ - public static String getVersion() { - return Integer.toString(getMajor()) + '.' - + Integer.toString(getMinor()) + '.' - + Integer.toString(getPatch()) - + getPreRelease() + getBuildMetadata(); - } + /** + * Returns the build date. + * + * @return The build date. + */ + public static Date getBuildDate() { + return date; + } - /** - * Returns the major version. - * - * @return The major version. - */ - public static int getMajor() { - return major; - } + /** + * Returns the project name. + * + * @return The project name, if any. + */ + public static String getProject() { + return project; + } - /** - * Returns the minor version. - * - * @return The minor version. - */ - public static int getMinor() { - return minor; - } + /** + * Returns the full version string. + *

+ * Formatted as: + *

+ * MAJOR.MINOR.PATCH[-PRERELEASE][+BUILDMETADATA] + *
+ *

+ * For example: + *

    + *
  • 1.0.0
  • + *
  • 1.0.0-beta
  • + *
  • 1.0.0+20160124144700
  • + *
  • 1.0.0-alpha+001
  • + *
+ * + * @return The version string. + */ + public static String getVersion() { + return Integer.toString(getMajor()) + '.' + + Integer.toString(getMinor()) + '.' + + Integer.toString(getPatch()) + + getPreRelease() + getBuildMetadata(); + } - /** - * Returns the patch version. - * - * @return The patch version. - */ - public static int getPatch() { - return patch; - } + /** + * Returns the major version. + * + * @return The major version. + */ + public static int getMajor() { + return major; + } - /** - * Returns the pre-release version. - * - * @return The pre-release version, if any. - */ - public static String getPreRelease() { - if (prerelease.length() > 0) { - return '-' + prerelease; - } + /** + * Returns the minor version. + * + * @return The minor version. + */ + public static int getMinor() { + return minor; + } - return ""; - } + /** + * Returns the patch version. + * + * @return The patch version. + */ + public static int getPatch() { + return patch; + } - /** - * Returns the project name. - * - * @return The project name, if any. - */ - public static String getProject() { - return project; - } + /** + * Returns the pre-release version. + * + * @return The pre-release version, if any. + */ + public static String getPreRelease() { + if (prerelease.length() > 0) { + return '-' + prerelease; + } - /** - * Returns the build metadata. - * - * @return The build metadata, if any. - */ - public static String getBuildMetadata() { - if (buildmeta.length() > 0) { - return '+' + buildmeta; - } + return ""; + } - return ""; - } - - /** - * Disables the default constructor. - * - * @throws UnsupportedOperationException if the constructor is called. - */ - private ReleaseInfo() - throws UnsupportedOperationException { - throw new UnsupportedOperationException("Illegal constructor call."); - } + /** + * Returns the build metadata. + * + * @return The build metadata, if any. + */ + public static String getBuildMetadata() { + if (buildmeta.length() > 0) { + return '+' + buildmeta; + } + + return ""; + } } \ No newline at end of file diff --git a/src/main/java/net/thauvin/erik/mobibot/CurrencyConverter.java b/src/main/java/net/thauvin/erik/mobibot/CurrencyConverter.java index 0cf5fbf..781edc4 100644 --- a/src/main/java/net/thauvin/erik/mobibot/CurrencyConverter.java +++ b/src/main/java/net/thauvin/erik/mobibot/CurrencyConverter.java @@ -31,11 +31,11 @@ */ package net.thauvin.erik.mobibot; -import org.jdom.Document; -import org.jdom.Element; -import org.jdom.JDOMException; -import org.jdom.Namespace; -import org.jdom.input.SAXBuilder; +import org.jdom2.Document; +import org.jdom2.Element; +import org.jdom2.JDOMException; +import org.jdom2.Namespace; +import org.jdom2.input.SAXBuilder; import java.io.IOException; import java.net.URL; diff --git a/src/main/java/net/thauvin/erik/mobibot/Lookup.java b/src/main/java/net/thauvin/erik/mobibot/Lookup.java index 560f90a..632184e 100644 --- a/src/main/java/net/thauvin/erik/mobibot/Lookup.java +++ b/src/main/java/net/thauvin/erik/mobibot/Lookup.java @@ -31,7 +31,7 @@ */ package net.thauvin.erik.mobibot; -import org.apache.commons.net.WhoisClient; +import org.apache.commons.net.whois.WhoisClient; import java.io.IOException; import java.net.InetAddress; @@ -155,4 +155,4 @@ final class Lookup return lines; } -} \ No newline at end of file +} diff --git a/src/main/java/net/thauvin/erik/mobibot/Mobibot.java b/src/main/java/net/thauvin/erik/mobibot/Mobibot.java index 2605827..9310a7f 100644 --- a/src/main/java/net/thauvin/erik/mobibot/Mobibot.java +++ b/src/main/java/net/thauvin/erik/mobibot/Mobibot.java @@ -394,13 +394,12 @@ public class Mobibot extends PircBot Commands.DEBUG_ARG, false, "print debug & logging data directly to the console"); - //noinspection AccessStaticViaInstance - options.addOption(OptionBuilder.withArgName("file").hasArg().withDescription("use alternate properties file") - .withLongOpt(Commands.PROPS_ARG).create(Commands.PROPS_ARG.substring(0, 1))); + options.addOption(Option.builder(Commands.PROPS_ARG.substring(0, 1)).hasArg().argName("file") + .desc("use alternate properties file").longOpt(Commands.PROPS_ARG).build()); options.addOption(Commands.VERSION_ARG.substring(0, 1), Commands.VERSION_ARG, false, "print version info"); // Parse the command line - final CommandLineParser parser = new PosixParser(); + final CommandLineParser parser = new DefaultParser(); CommandLine line = null; try diff --git a/version.properties b/version.properties index 3349c49..d986a57 100644 --- a/version.properties +++ b/version.properties @@ -5,4 +5,4 @@ version.major=0 version.minor=6 version.patch=1 version.prerelease=beta -version.buildmeta=002 +version.buildmeta=003