diff --git a/.gitignore b/.gitignore index 9eb88be..24f188e 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,8 @@ /out /proguard-project.txt /project.properties +/target /test-output Thumbs.db -ehthumbs.db \ No newline at end of file +ehthumbs.db +kobaltBuild \ No newline at end of file diff --git a/.idea/modules/example.iml b/.idea/modules/example.iml deleted file mode 100644 index 87a4c89..0000000 --- a/.idea/modules/example.iml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules/semver.iml b/.idea/modules/semver.iml deleted file mode 100644 index 1615fa6..0000000 --- a/.idea/modules/semver.iml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/example/example.iml b/example/example.iml deleted file mode 100644 index 705f332..0000000 --- a/example/example.iml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/example/example.ipr b/example/example.ipr deleted file mode 100644 index 04173d5..0000000 --- a/example/example.ipr +++ /dev/null @@ -1,408 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Android Lint - - - Java - - - Portability issuesJava - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.8.x - - - - - - - - \ No newline at end of file diff --git a/example/kobalt/src/Build.kt b/example/kobalt/src/Build.kt index 2e2c0eb..2286f83 100644 --- a/example/kobalt/src/Build.kt +++ b/example/kobalt/src/Build.kt @@ -5,6 +5,8 @@ import com.beust.kobalt.project import java.io.FileInputStream import java.util.* +val repos = repos(localMaven()) + fun StringBuilder.prepend(s: String): StringBuilder { if (this.length > 0) { this.insert(0, s) @@ -12,7 +14,7 @@ fun StringBuilder.prepend(s: String): StringBuilder { return this } -val p = project { +val example = project { name = "example" @@ -53,6 +55,10 @@ val p = project { } + install { + libDir = "deploy" + } + assemble { jar { manifest { diff --git a/example/kobalt/Build.kt.iml b/kobalt/Build.kt.iml similarity index 86% rename from example/kobalt/Build.kt.iml rename to kobalt/Build.kt.iml index 7bc9dd6..00b83dc 100644 --- a/example/kobalt/Build.kt.iml +++ b/kobalt/Build.kt.iml @@ -8,5 +8,6 @@ + \ No newline at end of file diff --git a/kobalt/src/Build.kt b/kobalt/src/Build.kt new file mode 100644 index 0000000..9575571 --- /dev/null +++ b/kobalt/src/Build.kt @@ -0,0 +1,71 @@ +import com.beust.kobalt.localMaven +import com.beust.kobalt.plugin.application.application +import com.beust.kobalt.plugin.packaging.assemble +import com.beust.kobalt.plugin.packaging.install +import com.beust.kobalt.project +import com.beust.kobalt.repos +import java.io.FileInputStream +import java.util.* + +val repos = repos(localMaven()) + +fun StringBuilder.prepend(s: String): StringBuilder { + if (this.length > 0) { + this.insert(0, s) + } + return this +} + +val semver = project { + + name = "semver" + group = "net.thauvin.erik" + artifactId = name + + 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() + + sourceDirectories { + path("src/main/java") + } + + sourceDirectoriesTest { + path("src/test/java") + } + + dependencies { + compile("org.apache.velocity:velocity:1.7") + } + + dependenciesTest { + compile("org.testng:testng:6.9.12") + + } + + install { + libDir = "deploy" + } + + assemble { + jar {} + } + + application { + mainClass = "com.example.Main" + } + +} diff --git a/kobalt/wrapper/kobalt-wrapper.jar b/kobalt/wrapper/kobalt-wrapper.jar new file mode 100644 index 0000000..c178849 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..7018006 --- /dev/null +++ b/kobalt/wrapper/kobalt-wrapper.properties @@ -0,0 +1 @@ +kobalt.version=0.842 \ No newline at end of file diff --git a/kobaltw b/kobaltw new file mode 100644 index 0000000..b27b3d8 --- /dev/null +++ b/kobaltw @@ -0,0 +1 @@ +java -jar $(dirname $0)/kobalt/wrapper/kobalt-wrapper.jar $* diff --git a/semver.iml b/semver.iml new file mode 100644 index 0000000..6d651e8 --- /dev/null +++ b/semver.iml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/semver.ipr b/semver.ipr index 7ebe1fe..2ce7e7e 100644 --- a/semver.ipr +++ b/semver.ipr @@ -1,5 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - + + - - + + @@ -279,86 +304,17 @@ - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +