diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6ec2ae2 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto + +# batch files are specific to windows and always crlf +*.bat eol=crlf diff --git a/.gitignore b/.gitignore index 065b527..6549aef 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,10 @@ **/.idea/tasks.xml **/.idea/workspace.xml *.iws -.DS_Store .classpath +.DS_Store .gradle +.kobalt .nb-gradle .project .settings @@ -16,6 +17,7 @@ /dist /fetcher.properties /gen +/gradle.properties /local.properties /log4j.properties /logs @@ -23,8 +25,10 @@ /out /proguard-project.txt /project.properties +/target /test-output /weather.log CVS -Thumbs.db -ehthumbs.db \ No newline at end of file +ehthumbs.db +kobaltBuild +Thumbs.db \ No newline at end of file diff --git a/.idea/modules/mobibot.iml b/.idea/modules/mobibot.iml index c0dcd8b..7651f0b 100644 --- a/.idea/modules/mobibot.iml +++ b/.idea/modules/mobibot.iml @@ -1,6 +1,6 @@ - - + + @@ -16,29 +16,96 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kobalt/src/Build.kt b/kobalt/src/Build.kt new file mode 100644 index 0000000..b054d5e --- /dev/null +++ b/kobalt/src/Build.kt @@ -0,0 +1,97 @@ +import com.beust.kobalt.* +import com.beust.kobalt.plugin.apt.* +import com.beust.kobalt.plugin.packaging.* +import com.beust.kobalt.plugin.application.* +import com.beust.kobalt.plugin.java.* +import java.io.File +import java.io.FileInputStream +import java.util.* + +val bs = buildScript { + repos() +} + +val mainClassName = "net.thauvin.erik.mobibot.Mobibot" + +fun StringBuilder.prepend(s: String): StringBuilder { + if (this.isNotEmpty()) { + this.insert(0, s) + } + return this +} + +val p = project { + + name = "mobibot" + + fun versionFor(): String { + val propsFile = "version.properties" + val majorKey = "version.major" + val minorKey = "version.minor" + val patchKey = "version.patch" + val metaKey = "version.buildmeta" + val preKey = "version.prerelease" + + val p = Properties().apply { FileInputStream(propsFile).use { fis -> load(fis) } } + + return (p.getProperty(majorKey, "1") + "." + p.getProperty(minorKey, "0") + "." + p.getProperty(patchKey, "0") + + StringBuilder(p.getProperty(preKey, "")).prepend("-") + + StringBuilder(p.getProperty(metaKey, "")).prepend("+")) + } + + version = versionFor() + + val processorJar = "net.thauvin.erik:semver:" + + dependencies { + compile("log4j:log4j:jar:1.2.17") + + compile("pircbot:pircbot:1.5.0") + + compile("commons-codec:commons-codec:1.10") + compile("commons-logging:commons-logging:1.2") + compile("commons-net:commons-net:3.5") + compile("commons-cli:commons-cli:1.3.1") + compile("commons-httpclient:commons-httpclient:3.1") + + compile("oro:oro:2.0.8") + + compile("org.jsoup:jsoup:1.9.2") + compile("com.rometools:rome:1.6.1") + compile("org.slf4j:slf4j-log4j12:1.7.21") + compile("org.json:json:20160212") + compile("org.ostermiller:utils:1.07.00") + + compile("net.sourceforge.jweather:jweather:jar:0.3.0") + compile("net.objecthunter:exp4j:0.4.7") + + compile("org.twitter4j:twitter4j-core:4.0.4") + compile("net.sf.delicious-java:delicious:1.14") + + apt(processorJar) + compile(processorJar) + } + + apt { + outputDir = "/src/generated/java/" + } + + assemble { + jar { + name = "${project.name}.jar" + fatJar = true + manifest { + attributes("Main-Class", mainClassName) + } + } + } + + application { + mainClass = mainClassName + args("-v") + } + + install { + libDir = "deploy" + } +} diff --git a/kobalt/wrapper/kobalt-wrapper.jar b/kobalt/wrapper/kobalt-wrapper.jar new file mode 100644 index 0000000..696ac55 Binary files /dev/null and b/kobalt/wrapper/kobalt-wrapper.jar differ diff --git a/kobalt/wrapper/kobalt-wrapper.properties b/kobalt/wrapper/kobalt-wrapper.properties new file mode 100644 index 0000000..708f458 --- /dev/null +++ b/kobalt/wrapper/kobalt-wrapper.properties @@ -0,0 +1 @@ +kobalt.version=1.0.45 \ No newline at end of file diff --git a/kobaltw b/kobaltw new file mode 100644 index 0000000..c5186d5 --- /dev/null +++ b/kobaltw @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +java -jar "`dirname "$0"`/kobalt/wrapper/kobalt-wrapper.jar" $* diff --git a/kobaltw.bat b/kobaltw.bat new file mode 100644 index 0000000..d578071 --- /dev/null +++ b/kobaltw.bat @@ -0,0 +1,4 @@ +@echo off +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +java -jar "%DIRNAME%/kobalt/wrapper/kobalt-wrapper.jar" %*