commit 45ca328c915a820f9dfe8b089158c323ff0470a8 Author: Erik C. Thauvin Date: Wed Aug 10 20:18:37 2016 -0700 Initial commit. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..80a944b --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +**/.idea/dictionaries +**/.idea/gradle.xml +**/.idea/libraries +**/.idea/tasks.xml +**/.idea/workspace.xml +*.iws +.DS_Store +.classpath +.gradle +.kobalt +.nb-gradle +.project +.settings +/bin +/build +/deploy +/dist +/example/libs +/gen +/gradle.properties +/out +/proguard-project.txt +/project.properties +/target +/test-output +Thumbs.db +ehthumbs.db +kobaltBuild +local.properties diff --git a/kobalt/src/Build.kt b/kobalt/src/Build.kt new file mode 100644 index 0000000..a9ea50e --- /dev/null +++ b/kobalt/src/Build.kt @@ -0,0 +1,40 @@ +import com.beust.kobalt.* +import com.beust.kobalt.plugin.packaging.* +import com.beust.kobalt.plugin.application.* +import com.beust.kobalt.plugin.kotlin.* + +val repos = repos() + + +val p = project { + + name = "kalxon-test" + group = "com.example" + artifactId = name + version = "0.1" + + sourceDirectories { + path("src/main/kotlin") + } + + sourceDirectoriesTest { + path("src/test/kotlin") + } + + dependencies { + compile("com.beust:klaxon:") + } + + dependenciesTest { + compile("org.testng:testng:") + } + + assemble { + jar { + } + } + + application { + mainClass = "com.example.MainKt" + } +} diff --git a/kobalt/wrapper/kobalt-wrapper.jar b/kobalt/wrapper/kobalt-wrapper.jar new file mode 100644 index 0000000..cb531b9 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..a4a0d68 --- /dev/null +++ b/kobalt/wrapper/kobalt-wrapper.properties @@ -0,0 +1 @@ +kobalt.version=0.891 \ No newline at end of file diff --git a/kobaltw b/kobaltw new file mode 100755 index 0000000..287d453 --- /dev/null +++ b/kobaltw @@ -0,0 +1,2 @@ +#!/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" %* diff --git a/src/main/kotlin/com/example/Main.kt b/src/main/kotlin/com/example/Main.kt new file mode 100644 index 0000000..b7f49ba --- /dev/null +++ b/src/main/kotlin/com/example/Main.kt @@ -0,0 +1,13 @@ +package com.example + +import com.beust.klaxon.* + +fun parse(name: String) : Any { + val cls = javaClass() + val inputStream = cls.getResourceAsStream(name)!! + return Parser().parse(inputStream)!! +} + +fun main(args: Array) { + val obj = parse("test..json") as JsonObject +} diff --git a/src/test/kotlin/com/example/MainTest.kt b/src/test/kotlin/com/example/MainTest.kt new file mode 100644 index 0000000..96458e9 --- /dev/null +++ b/src/test/kotlin/com/example/MainTest.kt @@ -0,0 +1,8 @@ +package com.example + +import org.testng.annotations.Test + +class ExampleTest { + @Test + fun f() = println("Running test") +} \ No newline at end of file diff --git a/test.json b/test.json new file mode 100644 index 0000000..65151a8 --- /dev/null +++ b/test.json @@ -0,0 +1,62 @@ +{ + "config": { + "name": "DKS 1802-EPD", + "star": "*", + "opts": [ + { + "title": "Delete 4-Digit Entry Code", + "fields": [ + { + "hint": "Entry code", + "alpha": false, + "size": 4 + } + ], + "cmd": "*14[MASTER],[FIELD:1]*" + }, + { + "title": "Add 4-Digit Entry Code", + "fields": [ + { + "hint": "Entry Code", + "alpha": false, + "size": 4 + } + ], + "cmd": "*02[MASTER],[FIELD:1]*" + }, + { + "title": "Add Name", + "fields": [ + { + "hint": "Directory Code", + "alpha": false, + "size": 3 + }, + { + "hint": "Name", + "alpha": true, + "size": 11 + } + ], + "cmd": "*66[MASTER],[FIELD:1]*,[FIELD:2]*" + }, + { + "title": "Add 7-digit Phone Number", + "fields": [ + { + "hint": "Directory Code", + "alpha": false, + "size": 3 + }, + { + "hint": "Phone Number", + "alpha": true, + "size": 7 + } + ], + "cmd": "*01[MASTER],[FIELD:1]*,[FIELD:2]*" + } + ] + } +}