diff --git a/.idea/modules/mobibot.iml b/.idea/modules/mobibot.iml new file mode 100644 index 0000000..ca3a54c --- /dev/null +++ b/.idea/modules/mobibot.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/mobibot_annotationProcessor.iml b/.idea/modules/mobibot_annotationProcessor.iml new file mode 100644 index 0000000..599f09a --- /dev/null +++ b/.idea/modules/mobibot_annotationProcessor.iml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/mobibot_main.iml b/.idea/modules/mobibot_main.iml new file mode 100644 index 0000000..7d47b66 --- /dev/null +++ b/.idea/modules/mobibot_main.iml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/mobibot_test.iml b/.idea/modules/mobibot_test.iml new file mode 100644 index 0000000..2f8372f --- /dev/null +++ b/.idea/modules/mobibot_test.iml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 7e06eaf..128d696 100644 --- a/build.gradle +++ b/build.gradle @@ -1,15 +1,17 @@ buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.coders-kitchen:compileonlyplugin:1.0.0' - } + 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' @@ -21,14 +23,16 @@ def packageName = 'net.thauvin.erik.mobibot' def deployDir = 'deploy' def isRelease = 'release' in gradle.startParameter.taskNames -def getVersion(isIncrement = false) { +def getVersion(isIncrement = false) +{ def propsFile = 'version.properties' def majorKey = 'version.major' def minorKey = 'version.minor' def patchKey = 'version.patch' def metaKey = 'version.buildmeta' def preKey = 'version.prerelease' - if (isIncrement) { + if (isIncrement) + { ant.propertyfile(file: propsFile) { entry(key: patchKey, type: 'int', @@ -67,11 +71,8 @@ dependencies { 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.9.2' - compile 'rome:rome:1.0@jar' - compile 'rome:rome-fetcher:1.0@jar' + compile 'com.rometools:rome:1.6.1' compile 'org.json:json:20160212' compile 'org.ostermiller:utils:1.07.00' @@ -109,6 +110,10 @@ clean { delete deployDir } +run { + args '--v' +} + task wrapper(type: Wrapper) { gradleVersion = gradle.gradleVersion } @@ -138,6 +143,7 @@ task deploy(dependsOn: ['build']) { mustRunAfter clean } + task release(dependsOn: ['deploy', 'wrapper']) << { group = 'Publishing' description = 'Releases new version.' diff --git a/mobibot.iml b/mobibot.iml deleted file mode 100644 index f60ef91..0000000 --- a/mobibot.iml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/mobibot.ipr b/mobibot.ipr index e9e1bc1..c8fa3e0 100644 --- a/mobibot.ipr +++ b/mobibot.ipr @@ -69,6 +69,11 @@ + + + + + @@ -121,9 +126,14 @@ @@ -364,10 +374,13 @@ - + + + + - + @@ -392,4 +405,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java b/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java index 5bc23df..2637a05 100644 --- a/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java +++ b/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java @@ -13,8 +13,8 @@ import java.util.Date; * Annotation Processor */ public final class ReleaseInfo { - private final static String buildmeta = "004"; - private final static Date date = new Date(1466883211201L); + private final static String buildmeta = "005"; + private final static Date date = new Date(1466989732969L); private final static int major = 0; private final static int minor = 6; private final static int patch = 1; diff --git a/src/main/java/net/thauvin/erik/mobibot/EntriesMgr.java b/src/main/java/net/thauvin/erik/mobibot/EntriesMgr.java index 141f761..2396358 100644 --- a/src/main/java/net/thauvin/erik/mobibot/EntriesMgr.java +++ b/src/main/java/net/thauvin/erik/mobibot/EntriesMgr.java @@ -31,10 +31,10 @@ */ package net.thauvin.erik.mobibot; -import com.sun.syndication.feed.synd.*; -import com.sun.syndication.io.FeedException; -import com.sun.syndication.io.SyndFeedInput; -import com.sun.syndication.io.SyndFeedOutput; +import com.rometools.rome.feed.synd.*; +import com.rometools.rome.io.FeedException; +import com.rometools.rome.io.SyndFeedInput; +import com.rometools.rome.io.SyndFeedOutput; import java.io.*; import java.util.ArrayList; @@ -139,8 +139,8 @@ final class EntriesMgr * * @return The feed's last published date. * - * @throws java.io.FileNotFoundException If the file was not found. - * @throws com.sun.syndication.io.FeedException If an error occurred while reading the feed. + * @throws FileNotFoundException If the file was not found. + * @throws FeedException If an error occurred while reading the feed. */ @SuppressWarnings("unchecked") public static String loadEntries(final String file, final String channel, final List entries) @@ -222,7 +222,8 @@ final class EntriesMgr * @param history The history array. * @param isDayBackup Set the true if the daily backup file should also be created. */ - public static void saveEntries(final Mobibot bot, final List entries, final List history, final boolean isDayBackup) + public static void saveEntries(final Mobibot bot, final List entries, final List history, + final boolean isDayBackup) { if (bot.getLogger().isDebugEnabled()) { diff --git a/src/main/java/net/thauvin/erik/mobibot/EntryLink.java b/src/main/java/net/thauvin/erik/mobibot/EntryLink.java index 881f960..0cc3b52 100644 --- a/src/main/java/net/thauvin/erik/mobibot/EntryLink.java +++ b/src/main/java/net/thauvin/erik/mobibot/EntryLink.java @@ -31,7 +31,8 @@ */ package net.thauvin.erik.mobibot; -import com.sun.syndication.feed.synd.SyndCategoryImpl; +import com.rometools.rome.feed.synd.SyndCategory; +import com.rometools.rome.feed.synd.SyndCategoryImpl; import java.io.Serializable; import java.util.Calendar; @@ -57,7 +58,7 @@ public class EntryLink implements Serializable private final List comments = new CopyOnWriteArrayList(); // The tags/categories - private final List tags = new CopyOnWriteArrayList(); + private final List tags = new CopyOnWriteArrayList(); // The channel private String channel = ""; @@ -87,7 +88,8 @@ public class EntryLink implements Serializable * @param channel The channel. * @param tags The entry's tags/categories. */ - public EntryLink(final String link, final String title, final String nick, final String login, final String channel, final String tags) + public EntryLink(final String link, final String title, final String nick, final String login, final String channel, + final String tags) { this.link = link; this.title = title; @@ -163,7 +165,8 @@ public class EntryLink implements Serializable * @param date The entry date. * @param tags The entry's tags/categories. */ - public EntryLink(final String link, final String title, final String nick, final String channel, final Date date, final List tags) + public EntryLink(final String link, final String title, final String nick, final String channel, final Date date, + final List tags) { this.link = link; this.title = title; @@ -349,7 +352,7 @@ public class EntryLink implements Serializable * * @return The tags. */ - public final List getTags() + public final List getTags() { return tags; } @@ -359,7 +362,7 @@ public class EntryLink implements Serializable * * @param tags The tags. */ - private void setTags(final List tags) + private void setTags(final List tags) { this.tags.addAll(tags); } diff --git a/src/main/java/net/thauvin/erik/mobibot/FeedReader.java b/src/main/java/net/thauvin/erik/mobibot/FeedReader.java index 8640f37..791e574 100644 --- a/src/main/java/net/thauvin/erik/mobibot/FeedReader.java +++ b/src/main/java/net/thauvin/erik/mobibot/FeedReader.java @@ -31,11 +31,11 @@ */ package net.thauvin.erik.mobibot; -import com.sun.syndication.feed.synd.SyndEntry; -import com.sun.syndication.feed.synd.SyndEntryImpl; -import com.sun.syndication.feed.synd.SyndFeed; -import com.sun.syndication.fetcher.FeedFetcher; -import com.sun.syndication.fetcher.impl.HttpURLFeedFetcher; +import com.rometools.rome.feed.synd.SyndEntry; +import com.rometools.rome.feed.synd.SyndEntryImpl; +import com.rometools.rome.feed.synd.SyndFeed; +import com.rometools.rome.io.SyndFeedInput; +import com.rometools.rome.io.XmlReader; import java.net.MalformedURLException; import java.net.URL; @@ -94,11 +94,11 @@ class FeedReader implements Runnable */ public final void run() { - final FeedFetcher fetcher = new HttpURLFeedFetcher(bot.getFeedInfoCache()); - try { - final SyndFeed feed = fetcher.retrieveFeed(new URL(url)); + final SyndFeedInput input = new SyndFeedInput(); + final SyndFeed feed = input.build(new XmlReader(new URL(url))); + SyndEntry item; final List items = feed.getEntries(); diff --git a/src/main/java/net/thauvin/erik/mobibot/Mobibot.java b/src/main/java/net/thauvin/erik/mobibot/Mobibot.java index 9310a7f..4240665 100644 --- a/src/main/java/net/thauvin/erik/mobibot/Mobibot.java +++ b/src/main/java/net/thauvin/erik/mobibot/Mobibot.java @@ -31,9 +31,7 @@ */ package net.thauvin.erik.mobibot; -import com.sun.syndication.fetcher.impl.FeedFetcherCache; -import com.sun.syndication.fetcher.impl.HashMapFeedInfoCache; -import com.sun.syndication.io.FeedException; +import com.rometools.rome.io.FeedException; import net.objecthunter.exp4j.Expression; import net.objecthunter.exp4j.ExpressionBuilder; import net.thauvin.erik.semver.Version; @@ -174,10 +172,6 @@ public class Mobibot extends PircBot */ private final List entries = new ArrayList(0); - /** - * The feed info cache. - */ - private final FeedFetcherCache feedInfoCache = HashMapFeedInfoCache.getInstance(); /** * The history/backlogs array. @@ -943,15 +937,6 @@ public class Mobibot extends PircBot return channel; } - /** - * Returns the {@link FeedFetcherCache feed info cache}. - * - * @return The feed info cache. - */ - public final FeedFetcherCache getFeedInfoCache() - { - return this.feedInfoCache; - } /** * Returns the irc server. diff --git a/version.properties b/version.properties index 27d832c..392747d 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=004 +version.buildmeta=005