diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..be6b01c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2html \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..be6b01c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2html \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..be6b01c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2html \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..be6b01c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2html \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..be6b01c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2html \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a28fa13 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..be6b01c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2html \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a28fa13 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml new file mode 100644 index 0000000..dc26b34 --- /dev/null +++ b/.idea/libraries/Gradle__junit_junit_4_11.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..be6b01c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2html \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a28fa13 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml new file mode 100644 index 0000000..dc26b34 --- /dev/null +++ b/.idea/libraries/Gradle__junit_junit_4_11.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..8262f72 --- /dev/null +++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..be6b01c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2html \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a28fa13 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml new file mode 100644 index 0000000..dc26b34 --- /dev/null +++ b/.idea/libraries/Gradle__junit_junit_4_11.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..8262f72 --- /dev/null +++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml new file mode 100644 index 0000000..6c5b3aa --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..be6b01c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2html \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a28fa13 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml new file mode 100644 index 0000000..dc26b34 --- /dev/null +++ b/.idea/libraries/Gradle__junit_junit_4_11.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..8262f72 --- /dev/null +++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml new file mode 100644 index 0000000..6c5b3aa --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml new file mode 100644 index 0000000..4353b0e --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..be6b01c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2html \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a28fa13 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml new file mode 100644 index 0000000..dc26b34 --- /dev/null +++ b/.idea/libraries/Gradle__junit_junit_4_11.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..8262f72 --- /dev/null +++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml new file mode 100644 index 0000000..6c5b3aa --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml new file mode 100644 index 0000000..4353b0e --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..2557151 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + 1.7 + + + + + + + + \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..be6b01c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2html \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a28fa13 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml new file mode 100644 index 0000000..dc26b34 --- /dev/null +++ b/.idea/libraries/Gradle__junit_junit_4_11.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..8262f72 --- /dev/null +++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml new file mode 100644 index 0000000..6c5b3aa --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml new file mode 100644 index 0000000..4353b0e --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..2557151 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + 1.7 + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..da23a03 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..be6b01c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2html \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a28fa13 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml new file mode 100644 index 0000000..dc26b34 --- /dev/null +++ b/.idea/libraries/Gradle__junit_junit_4_11.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..8262f72 --- /dev/null +++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml new file mode 100644 index 0000000..6c5b3aa --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml new file mode 100644 index 0000000..4353b0e --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..2557151 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + 1.7 + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..da23a03 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..be6b01c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2html \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a28fa13 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml new file mode 100644 index 0000000..dc26b34 --- /dev/null +++ b/.idea/libraries/Gradle__junit_junit_4_11.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..8262f72 --- /dev/null +++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml new file mode 100644 index 0000000..6c5b3aa --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml new file mode 100644 index 0000000..4353b0e --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..2557151 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + 1.7 + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..da23a03 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..290f0d2 --- /dev/null +++ b/build.gradle @@ -0,0 +1,57 @@ +group 'nl.astraeus.tag' +version '1.1-SNAPSHOT' + +apply plugin: 'kotlin' +apply plugin: 'idea' +apply plugin: 'maven' +apply plugin: 'findbugs' + +sourceSets { + main.java.srcDirs += 'src' + test.java.srcDirs += 'test' +} + +repositories { + maven { + url "http://nexus.astraeus.nl/nexus/content/groups/public" + } +} + +buildscript { + ext.kotlin_version = '0.14.451' + repositories { + maven { + url "http://nexus.astraeus.nl/nexus/content/groups/public" + } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +dependencies { + testCompile group: 'junit', name: 'junit', version: '4.11' + + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" +} + +uploadArchives { + repositories { + mavenDeployer { + repository(url: "http://nexus.astraeus.nl/nexus/content/repositories/releases") { + authentication(userName: nexusUsername, password: nexusPassword) + } + snapshotRepository(url: "http://nexus.astraeus.nl/nexus/content/repositories/snapshots") { + authentication(userName: nexusUsername, password: nexusPassword) + } + } + } +} + +findbugs { + ignoreFailures = true +} + +javadoc { + failOnError = false +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..be6b01c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2html \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a28fa13 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml new file mode 100644 index 0000000..dc26b34 --- /dev/null +++ b/.idea/libraries/Gradle__junit_junit_4_11.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..8262f72 --- /dev/null +++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml new file mode 100644 index 0000000..6c5b3aa --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml new file mode 100644 index 0000000..4353b0e --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..2557151 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + 1.7 + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..da23a03 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..290f0d2 --- /dev/null +++ b/build.gradle @@ -0,0 +1,57 @@ +group 'nl.astraeus.tag' +version '1.1-SNAPSHOT' + +apply plugin: 'kotlin' +apply plugin: 'idea' +apply plugin: 'maven' +apply plugin: 'findbugs' + +sourceSets { + main.java.srcDirs += 'src' + test.java.srcDirs += 'test' +} + +repositories { + maven { + url "http://nexus.astraeus.nl/nexus/content/groups/public" + } +} + +buildscript { + ext.kotlin_version = '0.14.451' + repositories { + maven { + url "http://nexus.astraeus.nl/nexus/content/groups/public" + } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +dependencies { + testCompile group: 'junit', name: 'junit', version: '4.11' + + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" +} + +uploadArchives { + repositories { + mavenDeployer { + repository(url: "http://nexus.astraeus.nl/nexus/content/repositories/releases") { + authentication(userName: nexusUsername, password: nexusPassword) + } + snapshotRepository(url: "http://nexus.astraeus.nl/nexus/content/repositories/snapshots") { + authentication(userName: nexusUsername, password: nexusPassword) + } + } + } +} + +findbugs { + ignoreFailures = true +} + +javadoc { + failOnError = false +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..30d399d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.jar Binary files differ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..be6b01c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2html \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a28fa13 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml new file mode 100644 index 0000000..dc26b34 --- /dev/null +++ b/.idea/libraries/Gradle__junit_junit_4_11.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..8262f72 --- /dev/null +++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml new file mode 100644 index 0000000..6c5b3aa --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml new file mode 100644 index 0000000..4353b0e --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..2557151 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + 1.7 + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..da23a03 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..290f0d2 --- /dev/null +++ b/build.gradle @@ -0,0 +1,57 @@ +group 'nl.astraeus.tag' +version '1.1-SNAPSHOT' + +apply plugin: 'kotlin' +apply plugin: 'idea' +apply plugin: 'maven' +apply plugin: 'findbugs' + +sourceSets { + main.java.srcDirs += 'src' + test.java.srcDirs += 'test' +} + +repositories { + maven { + url "http://nexus.astraeus.nl/nexus/content/groups/public" + } +} + +buildscript { + ext.kotlin_version = '0.14.451' + repositories { + maven { + url "http://nexus.astraeus.nl/nexus/content/groups/public" + } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +dependencies { + testCompile group: 'junit', name: 'junit', version: '4.11' + + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" +} + +uploadArchives { + repositories { + mavenDeployer { + repository(url: "http://nexus.astraeus.nl/nexus/content/repositories/releases") { + authentication(userName: nexusUsername, password: nexusPassword) + } + snapshotRepository(url: "http://nexus.astraeus.nl/nexus/content/repositories/snapshots") { + authentication(userName: nexusUsername, password: nexusPassword) + } + } + } +} + +findbugs { + ignoreFailures = true +} + +javadoc { + failOnError = false +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..30d399d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.jar Binary files differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..597a17d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue Oct 20 21:33:25 CEST 2015 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..be6b01c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2html \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a28fa13 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml new file mode 100644 index 0000000..dc26b34 --- /dev/null +++ b/.idea/libraries/Gradle__junit_junit_4_11.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..8262f72 --- /dev/null +++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml new file mode 100644 index 0000000..6c5b3aa --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml new file mode 100644 index 0000000..4353b0e --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..2557151 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + 1.7 + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..da23a03 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..290f0d2 --- /dev/null +++ b/build.gradle @@ -0,0 +1,57 @@ +group 'nl.astraeus.tag' +version '1.1-SNAPSHOT' + +apply plugin: 'kotlin' +apply plugin: 'idea' +apply plugin: 'maven' +apply plugin: 'findbugs' + +sourceSets { + main.java.srcDirs += 'src' + test.java.srcDirs += 'test' +} + +repositories { + maven { + url "http://nexus.astraeus.nl/nexus/content/groups/public" + } +} + +buildscript { + ext.kotlin_version = '0.14.451' + repositories { + maven { + url "http://nexus.astraeus.nl/nexus/content/groups/public" + } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +dependencies { + testCompile group: 'junit', name: 'junit', version: '4.11' + + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" +} + +uploadArchives { + repositories { + mavenDeployer { + repository(url: "http://nexus.astraeus.nl/nexus/content/repositories/releases") { + authentication(userName: nexusUsername, password: nexusPassword) + } + snapshotRepository(url: "http://nexus.astraeus.nl/nexus/content/repositories/snapshots") { + authentication(userName: nexusUsername, password: nexusPassword) + } + } + } +} + +findbugs { + ignoreFailures = true +} + +javadoc { + failOnError = false +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..30d399d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.jar Binary files differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..597a17d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue Oct 20 21:33:25 CEST 2015 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..91a7e26 --- /dev/null +++ b/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..be6b01c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2html \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a28fa13 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml new file mode 100644 index 0000000..dc26b34 --- /dev/null +++ b/.idea/libraries/Gradle__junit_junit_4_11.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..8262f72 --- /dev/null +++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml new file mode 100644 index 0000000..6c5b3aa --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml new file mode 100644 index 0000000..4353b0e --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..2557151 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + 1.7 + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..da23a03 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..290f0d2 --- /dev/null +++ b/build.gradle @@ -0,0 +1,57 @@ +group 'nl.astraeus.tag' +version '1.1-SNAPSHOT' + +apply plugin: 'kotlin' +apply plugin: 'idea' +apply plugin: 'maven' +apply plugin: 'findbugs' + +sourceSets { + main.java.srcDirs += 'src' + test.java.srcDirs += 'test' +} + +repositories { + maven { + url "http://nexus.astraeus.nl/nexus/content/groups/public" + } +} + +buildscript { + ext.kotlin_version = '0.14.451' + repositories { + maven { + url "http://nexus.astraeus.nl/nexus/content/groups/public" + } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +dependencies { + testCompile group: 'junit', name: 'junit', version: '4.11' + + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" +} + +uploadArchives { + repositories { + mavenDeployer { + repository(url: "http://nexus.astraeus.nl/nexus/content/repositories/releases") { + authentication(userName: nexusUsername, password: nexusPassword) + } + snapshotRepository(url: "http://nexus.astraeus.nl/nexus/content/repositories/snapshots") { + authentication(userName: nexusUsername, password: nexusPassword) + } + } + } +} + +findbugs { + ignoreFailures = true +} + +javadoc { + failOnError = false +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..30d399d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.jar Binary files differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..597a17d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue Oct 20 21:33:25 CEST 2015 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..91a7e26 --- /dev/null +++ b/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..8a0b282 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..be6b01c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2html \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a28fa13 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml new file mode 100644 index 0000000..dc26b34 --- /dev/null +++ b/.idea/libraries/Gradle__junit_junit_4_11.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..8262f72 --- /dev/null +++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml new file mode 100644 index 0000000..6c5b3aa --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml new file mode 100644 index 0000000..4353b0e --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..2557151 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + 1.7 + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..da23a03 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..290f0d2 --- /dev/null +++ b/build.gradle @@ -0,0 +1,57 @@ +group 'nl.astraeus.tag' +version '1.1-SNAPSHOT' + +apply plugin: 'kotlin' +apply plugin: 'idea' +apply plugin: 'maven' +apply plugin: 'findbugs' + +sourceSets { + main.java.srcDirs += 'src' + test.java.srcDirs += 'test' +} + +repositories { + maven { + url "http://nexus.astraeus.nl/nexus/content/groups/public" + } +} + +buildscript { + ext.kotlin_version = '0.14.451' + repositories { + maven { + url "http://nexus.astraeus.nl/nexus/content/groups/public" + } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +dependencies { + testCompile group: 'junit', name: 'junit', version: '4.11' + + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" +} + +uploadArchives { + repositories { + mavenDeployer { + repository(url: "http://nexus.astraeus.nl/nexus/content/repositories/releases") { + authentication(userName: nexusUsername, password: nexusPassword) + } + snapshotRepository(url: "http://nexus.astraeus.nl/nexus/content/repositories/snapshots") { + authentication(userName: nexusUsername, password: nexusPassword) + } + } + } +} + +findbugs { + ignoreFailures = true +} + +javadoc { + failOnError = false +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..30d399d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.jar Binary files differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..597a17d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue Oct 20 21:33:25 CEST 2015 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..91a7e26 --- /dev/null +++ b/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..8a0b282 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/k2html.iml b/k2html.iml new file mode 100644 index 0000000..e7f869f --- /dev/null +++ b/k2html.iml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..be6b01c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2html \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a28fa13 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml new file mode 100644 index 0000000..dc26b34 --- /dev/null +++ b/.idea/libraries/Gradle__junit_junit_4_11.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..8262f72 --- /dev/null +++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml new file mode 100644 index 0000000..6c5b3aa --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml new file mode 100644 index 0000000..4353b0e --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..2557151 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + 1.7 + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..da23a03 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..290f0d2 --- /dev/null +++ b/build.gradle @@ -0,0 +1,57 @@ +group 'nl.astraeus.tag' +version '1.1-SNAPSHOT' + +apply plugin: 'kotlin' +apply plugin: 'idea' +apply plugin: 'maven' +apply plugin: 'findbugs' + +sourceSets { + main.java.srcDirs += 'src' + test.java.srcDirs += 'test' +} + +repositories { + maven { + url "http://nexus.astraeus.nl/nexus/content/groups/public" + } +} + +buildscript { + ext.kotlin_version = '0.14.451' + repositories { + maven { + url "http://nexus.astraeus.nl/nexus/content/groups/public" + } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +dependencies { + testCompile group: 'junit', name: 'junit', version: '4.11' + + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" +} + +uploadArchives { + repositories { + mavenDeployer { + repository(url: "http://nexus.astraeus.nl/nexus/content/repositories/releases") { + authentication(userName: nexusUsername, password: nexusPassword) + } + snapshotRepository(url: "http://nexus.astraeus.nl/nexus/content/repositories/snapshots") { + authentication(userName: nexusUsername, password: nexusPassword) + } + } + } +} + +findbugs { + ignoreFailures = true +} + +javadoc { + failOnError = false +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..30d399d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.jar Binary files differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..597a17d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue Oct 20 21:33:25 CEST 2015 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..91a7e26 --- /dev/null +++ b/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..8a0b282 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/k2html.iml b/k2html.iml new file mode 100644 index 0000000..e7f869f --- /dev/null +++ b/k2html.iml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..cbaccac --- /dev/null +++ b/settings.gradle @@ -0,0 +1,2 @@ +rootProject.name = 'k2html' + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..be6b01c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2html \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a28fa13 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml new file mode 100644 index 0000000..dc26b34 --- /dev/null +++ b/.idea/libraries/Gradle__junit_junit_4_11.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..8262f72 --- /dev/null +++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml new file mode 100644 index 0000000..6c5b3aa --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml new file mode 100644 index 0000000..4353b0e --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..2557151 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + 1.7 + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..da23a03 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..290f0d2 --- /dev/null +++ b/build.gradle @@ -0,0 +1,57 @@ +group 'nl.astraeus.tag' +version '1.1-SNAPSHOT' + +apply plugin: 'kotlin' +apply plugin: 'idea' +apply plugin: 'maven' +apply plugin: 'findbugs' + +sourceSets { + main.java.srcDirs += 'src' + test.java.srcDirs += 'test' +} + +repositories { + maven { + url "http://nexus.astraeus.nl/nexus/content/groups/public" + } +} + +buildscript { + ext.kotlin_version = '0.14.451' + repositories { + maven { + url "http://nexus.astraeus.nl/nexus/content/groups/public" + } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +dependencies { + testCompile group: 'junit', name: 'junit', version: '4.11' + + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" +} + +uploadArchives { + repositories { + mavenDeployer { + repository(url: "http://nexus.astraeus.nl/nexus/content/repositories/releases") { + authentication(userName: nexusUsername, password: nexusPassword) + } + snapshotRepository(url: "http://nexus.astraeus.nl/nexus/content/repositories/snapshots") { + authentication(userName: nexusUsername, password: nexusPassword) + } + } + } +} + +findbugs { + ignoreFailures = true +} + +javadoc { + failOnError = false +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..30d399d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.jar Binary files differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..597a17d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue Oct 20 21:33:25 CEST 2015 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..91a7e26 --- /dev/null +++ b/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..8a0b282 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/k2html.iml b/k2html.iml new file mode 100644 index 0000000..e7f869f --- /dev/null +++ b/k2html.iml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..cbaccac --- /dev/null +++ b/settings.gradle @@ -0,0 +1,2 @@ +rootProject.name = 'k2html' + diff --git a/src/nl/astraeus/tag/TagCreator.kt b/src/nl/astraeus/tag/TagCreator.kt new file mode 100644 index 0000000..80f30ce --- /dev/null +++ b/src/nl/astraeus/tag/TagCreator.kt @@ -0,0 +1,715 @@ +package nl.astraeus.web.tag + +import java.util.* + +/** + * Created by rnentjes on 15-9-15. + */ +public fun escape(s: String): String { + if ("" == s) { + return "" + } + + val out = StringBuilder(Math.max(16, s.length())) + for (i in 0..s.length() - 1) { + val c = s.charAt(i) + if (c.toInt() > 127 || c == '"' || c == '<' || c == '>' || c == '&') { + out.append("&#") + out.append(c.toInt()) + out.append(';') + } else { + out.append(c) + } + } + + return out.toString() +} + +public object Attr { + public val HIDDEN: String = "hidden" + public val HIGH: String = "high" + public val HREF: String = "href" + public val HREFLANG: String = "hreflang" + public val HTTP_EQUIV: String = "http-equiv" + public val ICON: String = "icon" + public val ID: String = "id" + public val ISMAP: String = "ismap" + public val ITEMPROP: String = "itemprop" + public val KEYTYPE: String = "keytype" + public val KIND: String = "kind" + public val LABEL: String = "label" + public val LANG: String = "lang" + public val LANGUAGE: String = "language" + public val LIST: String = "list" + public val LOOP: String = "loop" + public val LOW: String = "low" + public val MANIFEST: String = "manifest" + public val MAX: String = "max" + public val MAXLENGTH: String = "maxlength" + public val MEDIA: String = "media" + public val METHOD: String = "method" + public val MIN: String = "min" + public val MULTIPLE: String = "multiple" + public val NAME: String = "name" + public val NOVALIDATE: String = "novalidate" + public val OPEN: String = "open" + public val OPTIMUM: String = "optimum" + public val PATTERN: String = "pattern" + public val PING: String = "ping" + public val PLACEHOLDER: String = "placeholder" + public val POSTER: String = "poster" + public val PRELOAD: String = "preload" + public val PUBDATE: String = "pubdate" + public val RADIOGROUP: String = "radiogroup" + public val READONLY: String = "readonly" + public val REL: String = "rel" + public val REQUIRED: String = "required" + public val REVERSED: String = "reversed" + public val ROWS: String = "rows" + public val ROWSPAN: String = "rowspan" + public val SANDBOX: String = "sandbox" + public val SPELLCHECK: String = "spellcheck" + public val SCOPE: String = "scope" + public val SCOPED: String = "scoped" + public val SEAMLESS: String = "seamless" + public val SELECTED: String = "selected" + public val SHAPE: String = "shape" + public val SIZE: String = "size" + public val SIZES: String = "sizes" + public val SPAN: String = "span" + public val SRC: String = "src" + public val SRCDOC: String = "srcdoc" + public val SRCLANG: String = "srclang" + public val SRCSET: String = "srcset" + public val START: String = "start" + public val STEP: String = "step" + public val STYLE: String = "style" + public val SUMMARY: String = "summary" + public val TABINDEX: String = "tabindex" + public val TARGET: String = "target" + public val TITLE: String = "title" + public val TYPE: String = "type" + public val USEMAP: String = "usemap" + public val VALUE: String = "value" + public val WIDTH: String = "width" + public val WRAP: String = "wrap" + public val BORDER: String = "border" + public val BUFFERED: String = "buffered" + public val CHALLENGE: String = "challenge" + public val CHARSET: String = "charset" + public val CHECKED: String = "checked" + public val CITE: String = "cite" + public val CLASS: String = "class" + public val COLOR: String = "color" + public val COLS: String = "cols" + public val COLSPAN: String = "colspan" + public val CONTENT: String = "content" + public val CONTENTEDITABLE: String = "contenteditable" + public val CONTEXTMENU: String = "contextmenu" + public val CONTROLS: String = "controls" + public val COORDS: String = "coords" + public val DATA: String = "data" + public val DATETIME: String = "datetime" + public val DEFAULT: String = "default" + public val DEFER: String = "defer" + public val DIR: String = "dir" + public val DIRNAME: String = "dirname" + public val DISABLED: String = "disabled" + public val DOWNLOAD: String = "download" + public val DRAGGABLE: String = "draggable" + public val DROPZONE: String = "dropzone" + public val ENCTYPE: String = "enctype" + public val FOR: String = "for" + public val FORM: String = "form" + public val FORMACTION: String = "formaction" + public val HEADERS: String = "headers" + public val HEIGHT: String = "height" + public val ACCEPT: String = "accept" + public val ACCEPT_CHARSET: String = "accept-charset" + public val ACCESSKEY: String = "accesskey" + public val ACTION: String = "action" + public val ALIGN: String = "align" + public val ALT: String = "alt" + public val ASYNC: String = "async" + public val AUTOCOMPLETE: String = "autocomplete" + public val AUTOFOCUS: String = "autofocus" + public val AUTOPLAY: String = "autoplay" + public val AUTOSAVE: String = "autosave" +} + +public class Attribute { + public var name: String + private set + private var value: String? = null + + public constructor(name: String, value: String) { + this.name = name + this.value = escape(value) + } + + public constructor(name: String) { + this.name = name + this.value = null + } + + public fun render(): String { + if (value == null) { + return " " + name + } + return (" $name=\"$value\"") + } + + override fun toString() = this.render() + + public fun setValue(value: String) { + this.value = value + } +} + +public abstract class Tag protected constructor(protected var tag: String) { + protected var attributes: ArrayList = ArrayList() + protected var parent: Tag? = null + + /** + * Sets an attribute on an element + + * @param name the attribute + * * + * @param value the attribute value + */ + public fun setAttribute(name: String, value: String?): Boolean { + if (value == null) { + return attributes.add(Attribute(name)) + } + for (attribute in attributes) { + if (attribute.name == name) { + attribute.setValue(value) //update with new value + return true + } + } + return attributes.add(Attribute(name, value)) + } + + fun indent(indent: Int): String { + var result = StringBuilder() + + for(i in 1..indent) { + result.append(" ") + } + + return result.toString() + } + + open public fun render(indent: Int = 0, pretty: Boolean = false): String { + var result = StringBuilder() + + if (pretty) { + result.append(indent(indent)) + } + + result.append(renderOpenTag()) + result.append(renderCloseTag()) + + return result.toString() + } + + override fun toString() = this.render() + + public fun renderOpenTag(): String { + var tagAttributes = "" + for (attribute in attributes) { + tagAttributes += attribute.render() + } + return "<$tag$tagAttributes>" + } + + public fun renderCloseTag() = "" +} + +public class EmptyTag(tagType: String) : Tag(tagType) { + /** + * Sets a custom attribute + + * @param attribute the attribute name + * * + * @param value the attribute value + * * + * @return itself for easy chaining + */ + public fun attr(attribute: String, value: String?): EmptyTag { + setAttribute(attribute, value) + return this + } + + /** + * Call attr-method based on condition + * [.attr] + */ + public fun condAttr(condition: Boolean, attribute: String, value: String?): EmptyTag { + return if (condition) attr(attribute, value) else this + } + + override fun render(indent: Int, pretty: Boolean): String { + var tagAttributes = "" + for (attribute in attributes) { + tagAttributes += attribute + } + + if (pretty) { + return indent(indent) + "<$tag$tagAttributes>" + } else { + return "<$tag$tagAttributes>" + } + } + + override fun toString() = this.render() + + /** + * Methods below this point are convenience methods + * that call attr with a predefined attribute. + */ + + //TODO: TEST ? + public fun isAutoComplete() = attr(Attr.AUTOCOMPLETE, null) + public fun isAutoFocus() = attr(Attr.AUTOFOCUS, null) + public fun isHidden() = attr(Attr.HIDDEN, null) + public fun isRequired() = attr(Attr.REQUIRED, null) + public fun withAlt(alt: String) = attr(Attr.ALT, alt) + public fun withAction(action: String) = attr(Attr.ACTION, action) + public fun withCharset(charset: String) = attr(Attr.CHARSET, charset) + public fun withClass(className: String) = attr(Attr.CLASS, className) + public fun withContent(content: String) = attr(Attr.CONTENT, content) + public fun withHref(href: String) = attr(Attr.HREF, href) + public fun withId(id: String) = attr(Attr.ID, id) + public fun withData(dataAttr: String, value: String) = attr(Attr.DATA + "-" + dataAttr, value) + public fun withMethod(method: String) = attr(Attr.METHOD, method) + public fun withName(name: String) = attr(Attr.NAME, name) + public fun withPlaceholder(placeholder: String) = attr(Attr.PLACEHOLDER, placeholder) + public fun withTarget(target: String) = attr(Attr.TARGET, target) + public fun withType(type: String) = attr(Attr.TYPE, type) + public fun withRel(rel: String) = attr(Attr.REL, rel) + public fun withSrc(src: String) = attr(Attr.SRC, src) + public fun withValue(value: String) = attr(Attr.VALUE, value) + public fun withCondAutoComplete(condition: Boolean) = condAttr(condition, Attr.AUTOCOMPLETE, null) + public fun withCondAutoFocus(condition: Boolean) = condAttr(condition, Attr.AUTOFOCUS, null) + public fun withCondHidden(condition: Boolean) = condAttr(condition, Attr.HIDDEN, null) + public fun withCondRequired(condition: Boolean) = condAttr(condition, Attr.REQUIRED, null) + public fun withCondAlt(condition: Boolean, alt: String) = condAttr(condition, Attr.ALT, alt) + public fun withCondAction(condition: Boolean, action: String) = condAttr(condition, Attr.ACTION, action) + public fun withCharset(condition: Boolean, charset: String) = condAttr(condition, Attr.CHARSET, charset) + public fun withCondClass(condition: Boolean, className: String) = condAttr(condition, Attr.CLASS, className) + public fun withCondContent(condition: Boolean, content: String) = condAttr(condition, Attr.CONTENT, content) + public fun withCondHref(condition: Boolean, href: String) = condAttr(condition, Attr.HREF, href) + public fun withCondId(condition: Boolean, id: String) = condAttr(condition, Attr.ID, id) + public fun withCondData(condition: Boolean, dataAttr: String, value: String) = condAttr(condition, Attr.DATA + "-" + dataAttr, value) + public fun withCondMethod(condition: Boolean, method: String) = condAttr(condition, Attr.METHOD, method) + public fun withCondName(condition: Boolean, name: String) = condAttr(condition, Attr.NAME, name) + public fun withCondPlaceholder(condition: Boolean, placeholder: String) = condAttr(condition, Attr.PLACEHOLDER, placeholder) + public fun withCondTarget(condition: Boolean, target: String) = condAttr(condition, Attr.TARGET, target) + public fun withCondType(condition: Boolean, type: String) = condAttr(condition, Attr.TYPE, type) + public fun withCondRel(condition: Boolean, rel: String) = condAttr(condition, Attr.REL, rel) + public fun withCondSrc(condition: Boolean, src: String) = condAttr(condition, Attr.SRC, src) + public fun withCondValue(condition: Boolean, value: String) = condAttr(condition, Attr.VALUE, value) +} + +class Text(text: String) : Tag(text) { + override fun render(indent: Int, pretty: Boolean): String { + if (pretty) { + return indent(indent) + escape(super.tag) + } else { + return escape(super.tag) + } + } +} + +public class UnescapedText(text: String) : Tag(text) { + override fun render(indent: Int, pretty: Boolean): String { + if (pretty ) { + return indent(indent) + tag + } else { + return indent(indent) + tag + } + } + + override fun toString() = this.render() +} + +public class ContainerTag(tagType: String) : Tag(tagType), Cloneable { + + public var children: MutableList = ArrayList() + + /** + * Appends a tag to the end of this element + + * @param child tag to be appended + * * + * @return itself for easy chaining + */ + public fun with(child: Tag): ContainerTag { + if (this === child) { + throw Error("Cannot append a tag to itself.") + } + child.parent = this + children.add(child) + return this + } + + public operator fun plus(child: Tag): ContainerTag { + if (this === child) { + throw Error("Cannot append a tag to itself.") + } + var result = copy() + + child.parent = this + result.children.add(child) + + return result + } + + public operator fun mod(child: Tag): ContainerTag { + return with(child) + } + + public fun copy(): ContainerTag { + var result = ContainerTag(tag) + result.children = ArrayList(children) + return result; + } + + /** + * Call with-method based on condition + * [.with] + */ + public fun condWith(condition: Boolean, child: Tag) = if (condition) this.with(child) else this + + /** + * Appends a list of tags to the end of this element + + * @param children tags to be appended + * * + * @return itself for easy chaining + */ + public fun with(children: List?): ContainerTag { + children?.forEach { this.with(it) } + + return this + } + + /** + * Call with-method based on condition + * [.with] + */ + public fun condWith(condition: Boolean, children: List) = if (condition) this.with(children) else this + + /** + * Appends the tags to the end of this element + + * @param children tags to be appended + * * + * @return itself for easy chaining + */ + public fun with(vararg children: Tag): ContainerTag { + for (aChildren in children) { + with(aChildren) + } + return this + } + + /** + * Call with-method based on condition + * [.with] + */ + public fun condWith(condition: Boolean, vararg children: Tag) = if (condition) this.with(*children) else this + + /** + * Appends a text tag to this element + + * @param text the text to be appended + * * + * @return itself for easy chaining + */ + public fun withText(text: String) = with(Text(text)) + + /** + * Sets a custom attribute + + * @param attribute the attribute name + * * + * @param value the attribute value + * * + * @return itself for easy chaining + */ + public fun attr(attribute: String, value: String?): ContainerTag { + setAttribute(attribute, value) + return this + } + + /** + * Call attr-method based on condition + * [.attr] + */ + public fun condAttr(condition: Boolean, attribute: String, value: String?) = if (condition) attr(attribute, value) else this + + /** + * Render the tag and its children + */ + override fun render(indent: Int, pretty: Boolean): String { + //very slow + // return renderOpenTag() + children.stream().map(Tag::render).collect(Collectors.joining()) + renderCloseTag(); + + //pretty fast + // StringBuilder rendered = new StringBuilder(renderOpenTag()); + // children.forEach(rendered::append); + // rendered.append(renderCloseTag()); + // return rendered.toString(); + + + //fastest + val rendered = StringBuilder() + + if (pretty) { rendered.append(indent(indent)) } + rendered.append(renderOpenTag()) + if (pretty) { rendered.append("\n") } + + for (child in children) { + rendered.append(child.render(indent + 2, pretty)) + if (pretty) { rendered.append("\n") } + } + + if (pretty) { rendered.append(indent(indent)) } + rendered.append(renderCloseTag()) + + return rendered.toString() + } + + override fun toString(): String { + return this.render() + } + + /** + * Methods below this point are convenience methods + * that call attr with a predefined attribute. + */ + + fun isAutoComplete() = attr(Attr.AUTOCOMPLETE, null) + fun isAutoFocus() = attr(Attr.AUTOFOCUS, null) + fun isHidden() = attr(Attr.HIDDEN, null) + fun isRequired() = attr(Attr.REQUIRED, null) + fun withAlt(alt: String) = attr(Attr.ALT, alt) + fun withAction(action: String) = attr(Attr.ACTION, action) + fun withCharset(charset: String) = attr(Attr.CHARSET, charset) + fun withClass(className: String) = attr(Attr.CLASS, className) + fun withContent(content: String) = attr(Attr.CONTENT, content) + fun withHref(href: String) = attr(Attr.HREF, href) + fun withId(id: String) = attr(Attr.ID, id) + fun withData(dataAttr: String, value: String) = attr(Attr.DATA + "-" + dataAttr, value) + fun withMethod(method: String) = attr(Attr.METHOD, method) + fun withName(name: String) = attr(Attr.NAME, name) + fun withPlaceholder(placeholder: String) = attr(Attr.PLACEHOLDER, placeholder) + fun withTarget(target: String) = attr(Attr.TARGET, target) + fun withType(type: String) = attr(Attr.TYPE, type) + fun withRel(rel: String) = attr(Attr.REL, rel) + fun withSrc(src: String) = attr(Attr.SRC, src) + fun withValue(value: String) = attr(Attr.VALUE, value) + fun withCondAutoComplete(condition: Boolean) = condAttr(condition, Attr.AUTOCOMPLETE, null) + fun withCondAutoFocus(condition: Boolean) = condAttr(condition, Attr.AUTOFOCUS, null) + fun withCondHidden(condition: Boolean) = condAttr(condition, Attr.HIDDEN, null) + fun withCondRequired(condition: Boolean) = condAttr(condition, Attr.REQUIRED, null) + fun withCondAlt(condition: Boolean, alt: String) = condAttr(condition, Attr.ALT, alt) + fun withCondAction(condition: Boolean, action: String) = condAttr(condition, Attr.ACTION, action) + fun withCharset(condition: Boolean, charset: String) = condAttr(condition, Attr.CHARSET, charset) + fun withCondClass(condition: Boolean, className: String) = condAttr(condition, Attr.CLASS, className) + fun withCondContent(condition: Boolean, content: String) = condAttr(condition, Attr.CONTENT, content) + fun withCondHref(condition: Boolean, href: String) = condAttr(condition, Attr.HREF, href) + fun withCondId(condition: Boolean, id: String) = condAttr(condition, Attr.ID, id) + fun withCondData(condition: Boolean, dataAttr: String, value: String) = condAttr(condition, Attr.DATA + "-" + dataAttr, value) + fun withCondMethod(condition: Boolean, method: String) = condAttr(condition, Attr.METHOD, method) + fun withCondName(condition: Boolean, name: String) = condAttr(condition, Attr.NAME, name) + fun withCondPlaceholder(condition: Boolean, placeholder: String) = condAttr(condition, Attr.PLACEHOLDER, placeholder) + fun withCondTarget(condition: Boolean, target: String) = condAttr(condition, Attr.TARGET, target) + fun withCondType(condition: Boolean, type: String) = condAttr(condition, Attr.TYPE, type) + fun withCondRel(condition: Boolean, rel: String) = condAttr(condition, Attr.REL, rel) + fun withCondSrc(condition: Boolean, src: String) = condAttr(condition, Attr.SRC, src) + fun withCondValue(condition: Boolean, value: String) = condAttr(condition, Attr.VALUE, value) +} + +fun tag(tagName: String) = ContainerTag(tagName) +fun emptyTag(tagName: String) = EmptyTag(tagName) +fun text(text: String) = Text(text) +fun unsafeHtml(html: String) = UnescapedText(html) + +//EmptyTags +fun area() = EmptyTag("area") +fun base() = EmptyTag("base") +fun br() = EmptyTag("br") +fun col() = EmptyTag("col") +fun document() = EmptyTag("!DOCTYPE html") +fun embed() = EmptyTag("embed") +fun hr() = EmptyTag("hr") +fun img() = EmptyTag("img") +fun input() = EmptyTag("input") +fun keygen() = EmptyTag("keygen") +fun link() = EmptyTag("link") +fun meta() = EmptyTag("meta") +fun param() = EmptyTag("param") +fun source() = EmptyTag("source") +fun track() = EmptyTag("track") +fun wbr() = EmptyTag("wbr") + +// ContainerTags +fun a() = tag("a") +fun a(text: String) = tag("a").withText(text) +fun a(text: String, href: String) = tag("a").withText(text).withHref(href) +fun abbr() = ContainerTag("abbr") +fun address() = ContainerTag("address") +fun article() = ContainerTag("article") +fun aside() = ContainerTag("aside") +fun audio() = ContainerTag("audio") +fun b() = ContainerTag("b") +fun b(text: String) = ContainerTag("b").withText(text) +fun bdi() = ContainerTag("bdi") +fun bdi(text: String) = ContainerTag("bdi").withText(text) +fun bdo() = ContainerTag("bdo") +fun bdo(text: String) = ContainerTag("bdo").withText(text) +fun blockquote() = ContainerTag("blockquote") +fun blockquote(text: String) = ContainerTag("blockquote").withText(text) +fun body() = ContainerTag("body") +fun button() = ContainerTag("button") +fun button(text: String) = ContainerTag("button").withText(text) +fun canvas() = ContainerTag("canvas") +fun caption() = ContainerTag("caption") +fun caption(text: String) = ContainerTag("caption").withText(text) +fun cite() = ContainerTag("cite") +fun cite(text: String) = ContainerTag("cite").withText(text) +fun code() = ContainerTag("code") +fun colgroup() = ContainerTag("colgroup") +fun datalist() = ContainerTag("datalist") +fun dd() = ContainerTag("dd") +fun dd(text: String) = ContainerTag("dd").withText(text) +fun del() = ContainerTag("del") +fun del(text: String) = ContainerTag("del").withText(text) +fun details() = ContainerTag("details") +fun dfn() = ContainerTag("dfn") +fun dfn(text: String) = ContainerTag("dfn").withText(text) +fun dialog() = ContainerTag("dialog") +fun dialog(text: String) = ContainerTag("dialog").withText(text) +fun div() = ContainerTag("div") +fun dl() = ContainerTag("dl") +fun dt() = ContainerTag("dt") +fun dt(text: String) = ContainerTag("dt").withText(text) +fun em() = ContainerTag("em") +fun em(text: String) = ContainerTag("em").withText(text) +fun fieldset() = ContainerTag("fieldset") +fun figcaption() = ContainerTag("figcaption") +fun figcaption(text: String) = ContainerTag("figcaption").withText(text) +fun figure() = ContainerTag("figure") +fun footer() = ContainerTag("footer") +fun form() = ContainerTag("form") +fun h1() = ContainerTag("h1") +fun h1(text: String) = ContainerTag("h1").withText(text) +fun h2() = ContainerTag("h2") +fun h2(text: String) = ContainerTag("h2").withText(text) +fun h3() = ContainerTag("h3") +fun h3(text: String) = ContainerTag("h3").withText(text) +fun h4() = ContainerTag("h4") +fun h4(text: String) = ContainerTag("h4").withText(text) +fun h5() = ContainerTag("h5") +fun h5(text: String) = ContainerTag("h5").withText(text) +fun h6() = ContainerTag("h6") +fun h6(text: String) = ContainerTag("h6").withText(text) +fun head() = ContainerTag("head") +fun header() = ContainerTag("header") +fun html() = ContainerTag("html") +fun i() = ContainerTag("i") +fun i(text: String) = ContainerTag("i").withText(text) +fun iframe() = ContainerTag("iframe") +fun ins() = ContainerTag("ins") +fun ins(text: String) = ContainerTag("ins").withText(text) +fun kbd() = ContainerTag("kbd") +fun label() = ContainerTag("label") +fun label(text: String) = ContainerTag("label").withText(text) +fun legend() = ContainerTag("legend") +fun legend(text: String) = ContainerTag("legend").withText(text) +fun li() = ContainerTag("li") +fun li(text: String) = ContainerTag("li").withText(text) +fun main() = ContainerTag("main") +fun map() = ContainerTag("map") +fun mark() = ContainerTag("mark") +fun menu() = ContainerTag("menu") +fun menuitem() = ContainerTag("menuitem") +fun meter() = ContainerTag("meter") +fun nav() = ContainerTag("nav") +fun noscript() = ContainerTag("noscript") +fun object_() = ContainerTag("object") +fun ol() = ContainerTag("ol") +fun optgroup() = ContainerTag("optgroup") +fun option() = ContainerTag("option") +fun option(text: String) = ContainerTag("option").withText(text) +fun output() = ContainerTag("output") +fun p() = ContainerTag("p") +fun p(text: String) = ContainerTag("p").withText(text) +fun pre() = ContainerTag("pre") +fun progress() = ContainerTag("progress") +fun q() = ContainerTag("q") +fun q(text: String) = ContainerTag("q").withText(text) +fun rp() = ContainerTag("rp") +fun rt() = ContainerTag("rt") +fun ruby() = ContainerTag("ruby") +fun s() = ContainerTag("s") +fun s(text: String) = ContainerTag("s").withText(text) +fun samp() = ContainerTag("samp") +fun script() = ContainerTag("script") +fun section() = ContainerTag("section") +fun select() = ContainerTag("select") +fun small() = ContainerTag("small") +fun small(text: String) = ContainerTag("small").withText(text) +fun span() = ContainerTag("span") +fun span(text: String) = ContainerTag("span").withText(text) +fun strong() = ContainerTag("strong") +fun strong(text: String) = ContainerTag("strong").withText(text) +fun style() = ContainerTag("style") +fun sub() = ContainerTag("sub") +fun sub(text: String) = ContainerTag("sub").withText(text) +fun summary() = ContainerTag("summary") +fun summary(text: String) = ContainerTag("summary").withText(text) +fun sup() = ContainerTag("sup") +fun sup(text: String) = ContainerTag("sup").withText(text) +fun table() = ContainerTag("table") +fun tbody() = ContainerTag("tbody") +fun td() = ContainerTag("td") +fun td(text: String) = ContainerTag("td").withText(text) +fun textarea() = ContainerTag("textarea") +fun tfoot() = ContainerTag("tfoot") +fun th() = ContainerTag("th") +fun th(text: String) = ContainerTag("th").withText(text) +fun thead() = ContainerTag("thead") +fun time() = ContainerTag("time") +fun title() = ContainerTag("title") +fun title(text: String) = ContainerTag("title").withText(text) +fun tr() = ContainerTag("tr") +fun u() = ContainerTag("u") +fun u(text: String) = ContainerTag("u").withText(text) +fun ul() = ContainerTag("ul") +fun var_() = ContainerTag("var") +fun videa() = ContainerTag("video") + +fun main(args: Array) { + var tag = div().with(h1().with(a("Text"))) + var tag1 = div() + + (h1("Title ") + a("Nu!", "http://www.nu.nl/")) + var tag2 = div() + (h1() + a("Text")) + var tag3 = tag2 + Text("Boehoe!") + + var tag4 = tag + tag1 + tag2 + tag3 + + println(tag) + println(tag1) + println(tag2) + println(tag3) + println(tag4) + + var tag5 = tag % tag1 % tag2 % tag3 + + println(tag) + println(tag5) +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aeeb256 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Created by .ignore support plugin (hsz.mobi) +local.properties +gradle.properties diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..be6b01c --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +k2html \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a28fa13 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__junit_junit_4_11.xml b/.idea/libraries/Gradle__junit_junit_4_11.xml new file mode 100644 index 0000000..dc26b34 --- /dev/null +++ b/.idea/libraries/Gradle__junit_junit_4_11.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..8262f72 --- /dev/null +++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml new file mode 100644 index 0000000..6c5b3aa --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml new file mode 100644 index 0000000..4353b0e --- /dev/null +++ b/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_0_14_451.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..2557151 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + 1.7 + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..da23a03 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..290f0d2 --- /dev/null +++ b/build.gradle @@ -0,0 +1,57 @@ +group 'nl.astraeus.tag' +version '1.1-SNAPSHOT' + +apply plugin: 'kotlin' +apply plugin: 'idea' +apply plugin: 'maven' +apply plugin: 'findbugs' + +sourceSets { + main.java.srcDirs += 'src' + test.java.srcDirs += 'test' +} + +repositories { + maven { + url "http://nexus.astraeus.nl/nexus/content/groups/public" + } +} + +buildscript { + ext.kotlin_version = '0.14.451' + repositories { + maven { + url "http://nexus.astraeus.nl/nexus/content/groups/public" + } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +dependencies { + testCompile group: 'junit', name: 'junit', version: '4.11' + + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" +} + +uploadArchives { + repositories { + mavenDeployer { + repository(url: "http://nexus.astraeus.nl/nexus/content/repositories/releases") { + authentication(userName: nexusUsername, password: nexusPassword) + } + snapshotRepository(url: "http://nexus.astraeus.nl/nexus/content/repositories/snapshots") { + authentication(userName: nexusUsername, password: nexusPassword) + } + } + } +} + +findbugs { + ignoreFailures = true +} + +javadoc { + failOnError = false +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..30d399d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.jar Binary files differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..597a17d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue Oct 20 21:33:25 CEST 2015 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..91a7e26 --- /dev/null +++ b/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..8a0b282 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/k2html.iml b/k2html.iml new file mode 100644 index 0000000..e7f869f --- /dev/null +++ b/k2html.iml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..cbaccac --- /dev/null +++ b/settings.gradle @@ -0,0 +1,2 @@ +rootProject.name = 'k2html' + diff --git a/src/nl/astraeus/tag/TagCreator.kt b/src/nl/astraeus/tag/TagCreator.kt new file mode 100644 index 0000000..80f30ce --- /dev/null +++ b/src/nl/astraeus/tag/TagCreator.kt @@ -0,0 +1,715 @@ +package nl.astraeus.web.tag + +import java.util.* + +/** + * Created by rnentjes on 15-9-15. + */ +public fun escape(s: String): String { + if ("" == s) { + return "" + } + + val out = StringBuilder(Math.max(16, s.length())) + for (i in 0..s.length() - 1) { + val c = s.charAt(i) + if (c.toInt() > 127 || c == '"' || c == '<' || c == '>' || c == '&') { + out.append("&#") + out.append(c.toInt()) + out.append(';') + } else { + out.append(c) + } + } + + return out.toString() +} + +public object Attr { + public val HIDDEN: String = "hidden" + public val HIGH: String = "high" + public val HREF: String = "href" + public val HREFLANG: String = "hreflang" + public val HTTP_EQUIV: String = "http-equiv" + public val ICON: String = "icon" + public val ID: String = "id" + public val ISMAP: String = "ismap" + public val ITEMPROP: String = "itemprop" + public val KEYTYPE: String = "keytype" + public val KIND: String = "kind" + public val LABEL: String = "label" + public val LANG: String = "lang" + public val LANGUAGE: String = "language" + public val LIST: String = "list" + public val LOOP: String = "loop" + public val LOW: String = "low" + public val MANIFEST: String = "manifest" + public val MAX: String = "max" + public val MAXLENGTH: String = "maxlength" + public val MEDIA: String = "media" + public val METHOD: String = "method" + public val MIN: String = "min" + public val MULTIPLE: String = "multiple" + public val NAME: String = "name" + public val NOVALIDATE: String = "novalidate" + public val OPEN: String = "open" + public val OPTIMUM: String = "optimum" + public val PATTERN: String = "pattern" + public val PING: String = "ping" + public val PLACEHOLDER: String = "placeholder" + public val POSTER: String = "poster" + public val PRELOAD: String = "preload" + public val PUBDATE: String = "pubdate" + public val RADIOGROUP: String = "radiogroup" + public val READONLY: String = "readonly" + public val REL: String = "rel" + public val REQUIRED: String = "required" + public val REVERSED: String = "reversed" + public val ROWS: String = "rows" + public val ROWSPAN: String = "rowspan" + public val SANDBOX: String = "sandbox" + public val SPELLCHECK: String = "spellcheck" + public val SCOPE: String = "scope" + public val SCOPED: String = "scoped" + public val SEAMLESS: String = "seamless" + public val SELECTED: String = "selected" + public val SHAPE: String = "shape" + public val SIZE: String = "size" + public val SIZES: String = "sizes" + public val SPAN: String = "span" + public val SRC: String = "src" + public val SRCDOC: String = "srcdoc" + public val SRCLANG: String = "srclang" + public val SRCSET: String = "srcset" + public val START: String = "start" + public val STEP: String = "step" + public val STYLE: String = "style" + public val SUMMARY: String = "summary" + public val TABINDEX: String = "tabindex" + public val TARGET: String = "target" + public val TITLE: String = "title" + public val TYPE: String = "type" + public val USEMAP: String = "usemap" + public val VALUE: String = "value" + public val WIDTH: String = "width" + public val WRAP: String = "wrap" + public val BORDER: String = "border" + public val BUFFERED: String = "buffered" + public val CHALLENGE: String = "challenge" + public val CHARSET: String = "charset" + public val CHECKED: String = "checked" + public val CITE: String = "cite" + public val CLASS: String = "class" + public val COLOR: String = "color" + public val COLS: String = "cols" + public val COLSPAN: String = "colspan" + public val CONTENT: String = "content" + public val CONTENTEDITABLE: String = "contenteditable" + public val CONTEXTMENU: String = "contextmenu" + public val CONTROLS: String = "controls" + public val COORDS: String = "coords" + public val DATA: String = "data" + public val DATETIME: String = "datetime" + public val DEFAULT: String = "default" + public val DEFER: String = "defer" + public val DIR: String = "dir" + public val DIRNAME: String = "dirname" + public val DISABLED: String = "disabled" + public val DOWNLOAD: String = "download" + public val DRAGGABLE: String = "draggable" + public val DROPZONE: String = "dropzone" + public val ENCTYPE: String = "enctype" + public val FOR: String = "for" + public val FORM: String = "form" + public val FORMACTION: String = "formaction" + public val HEADERS: String = "headers" + public val HEIGHT: String = "height" + public val ACCEPT: String = "accept" + public val ACCEPT_CHARSET: String = "accept-charset" + public val ACCESSKEY: String = "accesskey" + public val ACTION: String = "action" + public val ALIGN: String = "align" + public val ALT: String = "alt" + public val ASYNC: String = "async" + public val AUTOCOMPLETE: String = "autocomplete" + public val AUTOFOCUS: String = "autofocus" + public val AUTOPLAY: String = "autoplay" + public val AUTOSAVE: String = "autosave" +} + +public class Attribute { + public var name: String + private set + private var value: String? = null + + public constructor(name: String, value: String) { + this.name = name + this.value = escape(value) + } + + public constructor(name: String) { + this.name = name + this.value = null + } + + public fun render(): String { + if (value == null) { + return " " + name + } + return (" $name=\"$value\"") + } + + override fun toString() = this.render() + + public fun setValue(value: String) { + this.value = value + } +} + +public abstract class Tag protected constructor(protected var tag: String) { + protected var attributes: ArrayList = ArrayList() + protected var parent: Tag? = null + + /** + * Sets an attribute on an element + + * @param name the attribute + * * + * @param value the attribute value + */ + public fun setAttribute(name: String, value: String?): Boolean { + if (value == null) { + return attributes.add(Attribute(name)) + } + for (attribute in attributes) { + if (attribute.name == name) { + attribute.setValue(value) //update with new value + return true + } + } + return attributes.add(Attribute(name, value)) + } + + fun indent(indent: Int): String { + var result = StringBuilder() + + for(i in 1..indent) { + result.append(" ") + } + + return result.toString() + } + + open public fun render(indent: Int = 0, pretty: Boolean = false): String { + var result = StringBuilder() + + if (pretty) { + result.append(indent(indent)) + } + + result.append(renderOpenTag()) + result.append(renderCloseTag()) + + return result.toString() + } + + override fun toString() = this.render() + + public fun renderOpenTag(): String { + var tagAttributes = "" + for (attribute in attributes) { + tagAttributes += attribute.render() + } + return "<$tag$tagAttributes>" + } + + public fun renderCloseTag() = "" +} + +public class EmptyTag(tagType: String) : Tag(tagType) { + /** + * Sets a custom attribute + + * @param attribute the attribute name + * * + * @param value the attribute value + * * + * @return itself for easy chaining + */ + public fun attr(attribute: String, value: String?): EmptyTag { + setAttribute(attribute, value) + return this + } + + /** + * Call attr-method based on condition + * [.attr] + */ + public fun condAttr(condition: Boolean, attribute: String, value: String?): EmptyTag { + return if (condition) attr(attribute, value) else this + } + + override fun render(indent: Int, pretty: Boolean): String { + var tagAttributes = "" + for (attribute in attributes) { + tagAttributes += attribute + } + + if (pretty) { + return indent(indent) + "<$tag$tagAttributes>" + } else { + return "<$tag$tagAttributes>" + } + } + + override fun toString() = this.render() + + /** + * Methods below this point are convenience methods + * that call attr with a predefined attribute. + */ + + //TODO: TEST ? + public fun isAutoComplete() = attr(Attr.AUTOCOMPLETE, null) + public fun isAutoFocus() = attr(Attr.AUTOFOCUS, null) + public fun isHidden() = attr(Attr.HIDDEN, null) + public fun isRequired() = attr(Attr.REQUIRED, null) + public fun withAlt(alt: String) = attr(Attr.ALT, alt) + public fun withAction(action: String) = attr(Attr.ACTION, action) + public fun withCharset(charset: String) = attr(Attr.CHARSET, charset) + public fun withClass(className: String) = attr(Attr.CLASS, className) + public fun withContent(content: String) = attr(Attr.CONTENT, content) + public fun withHref(href: String) = attr(Attr.HREF, href) + public fun withId(id: String) = attr(Attr.ID, id) + public fun withData(dataAttr: String, value: String) = attr(Attr.DATA + "-" + dataAttr, value) + public fun withMethod(method: String) = attr(Attr.METHOD, method) + public fun withName(name: String) = attr(Attr.NAME, name) + public fun withPlaceholder(placeholder: String) = attr(Attr.PLACEHOLDER, placeholder) + public fun withTarget(target: String) = attr(Attr.TARGET, target) + public fun withType(type: String) = attr(Attr.TYPE, type) + public fun withRel(rel: String) = attr(Attr.REL, rel) + public fun withSrc(src: String) = attr(Attr.SRC, src) + public fun withValue(value: String) = attr(Attr.VALUE, value) + public fun withCondAutoComplete(condition: Boolean) = condAttr(condition, Attr.AUTOCOMPLETE, null) + public fun withCondAutoFocus(condition: Boolean) = condAttr(condition, Attr.AUTOFOCUS, null) + public fun withCondHidden(condition: Boolean) = condAttr(condition, Attr.HIDDEN, null) + public fun withCondRequired(condition: Boolean) = condAttr(condition, Attr.REQUIRED, null) + public fun withCondAlt(condition: Boolean, alt: String) = condAttr(condition, Attr.ALT, alt) + public fun withCondAction(condition: Boolean, action: String) = condAttr(condition, Attr.ACTION, action) + public fun withCharset(condition: Boolean, charset: String) = condAttr(condition, Attr.CHARSET, charset) + public fun withCondClass(condition: Boolean, className: String) = condAttr(condition, Attr.CLASS, className) + public fun withCondContent(condition: Boolean, content: String) = condAttr(condition, Attr.CONTENT, content) + public fun withCondHref(condition: Boolean, href: String) = condAttr(condition, Attr.HREF, href) + public fun withCondId(condition: Boolean, id: String) = condAttr(condition, Attr.ID, id) + public fun withCondData(condition: Boolean, dataAttr: String, value: String) = condAttr(condition, Attr.DATA + "-" + dataAttr, value) + public fun withCondMethod(condition: Boolean, method: String) = condAttr(condition, Attr.METHOD, method) + public fun withCondName(condition: Boolean, name: String) = condAttr(condition, Attr.NAME, name) + public fun withCondPlaceholder(condition: Boolean, placeholder: String) = condAttr(condition, Attr.PLACEHOLDER, placeholder) + public fun withCondTarget(condition: Boolean, target: String) = condAttr(condition, Attr.TARGET, target) + public fun withCondType(condition: Boolean, type: String) = condAttr(condition, Attr.TYPE, type) + public fun withCondRel(condition: Boolean, rel: String) = condAttr(condition, Attr.REL, rel) + public fun withCondSrc(condition: Boolean, src: String) = condAttr(condition, Attr.SRC, src) + public fun withCondValue(condition: Boolean, value: String) = condAttr(condition, Attr.VALUE, value) +} + +class Text(text: String) : Tag(text) { + override fun render(indent: Int, pretty: Boolean): String { + if (pretty) { + return indent(indent) + escape(super.tag) + } else { + return escape(super.tag) + } + } +} + +public class UnescapedText(text: String) : Tag(text) { + override fun render(indent: Int, pretty: Boolean): String { + if (pretty ) { + return indent(indent) + tag + } else { + return indent(indent) + tag + } + } + + override fun toString() = this.render() +} + +public class ContainerTag(tagType: String) : Tag(tagType), Cloneable { + + public var children: MutableList = ArrayList() + + /** + * Appends a tag to the end of this element + + * @param child tag to be appended + * * + * @return itself for easy chaining + */ + public fun with(child: Tag): ContainerTag { + if (this === child) { + throw Error("Cannot append a tag to itself.") + } + child.parent = this + children.add(child) + return this + } + + public operator fun plus(child: Tag): ContainerTag { + if (this === child) { + throw Error("Cannot append a tag to itself.") + } + var result = copy() + + child.parent = this + result.children.add(child) + + return result + } + + public operator fun mod(child: Tag): ContainerTag { + return with(child) + } + + public fun copy(): ContainerTag { + var result = ContainerTag(tag) + result.children = ArrayList(children) + return result; + } + + /** + * Call with-method based on condition + * [.with] + */ + public fun condWith(condition: Boolean, child: Tag) = if (condition) this.with(child) else this + + /** + * Appends a list of tags to the end of this element + + * @param children tags to be appended + * * + * @return itself for easy chaining + */ + public fun with(children: List?): ContainerTag { + children?.forEach { this.with(it) } + + return this + } + + /** + * Call with-method based on condition + * [.with] + */ + public fun condWith(condition: Boolean, children: List) = if (condition) this.with(children) else this + + /** + * Appends the tags to the end of this element + + * @param children tags to be appended + * * + * @return itself for easy chaining + */ + public fun with(vararg children: Tag): ContainerTag { + for (aChildren in children) { + with(aChildren) + } + return this + } + + /** + * Call with-method based on condition + * [.with] + */ + public fun condWith(condition: Boolean, vararg children: Tag) = if (condition) this.with(*children) else this + + /** + * Appends a text tag to this element + + * @param text the text to be appended + * * + * @return itself for easy chaining + */ + public fun withText(text: String) = with(Text(text)) + + /** + * Sets a custom attribute + + * @param attribute the attribute name + * * + * @param value the attribute value + * * + * @return itself for easy chaining + */ + public fun attr(attribute: String, value: String?): ContainerTag { + setAttribute(attribute, value) + return this + } + + /** + * Call attr-method based on condition + * [.attr] + */ + public fun condAttr(condition: Boolean, attribute: String, value: String?) = if (condition) attr(attribute, value) else this + + /** + * Render the tag and its children + */ + override fun render(indent: Int, pretty: Boolean): String { + //very slow + // return renderOpenTag() + children.stream().map(Tag::render).collect(Collectors.joining()) + renderCloseTag(); + + //pretty fast + // StringBuilder rendered = new StringBuilder(renderOpenTag()); + // children.forEach(rendered::append); + // rendered.append(renderCloseTag()); + // return rendered.toString(); + + + //fastest + val rendered = StringBuilder() + + if (pretty) { rendered.append(indent(indent)) } + rendered.append(renderOpenTag()) + if (pretty) { rendered.append("\n") } + + for (child in children) { + rendered.append(child.render(indent + 2, pretty)) + if (pretty) { rendered.append("\n") } + } + + if (pretty) { rendered.append(indent(indent)) } + rendered.append(renderCloseTag()) + + return rendered.toString() + } + + override fun toString(): String { + return this.render() + } + + /** + * Methods below this point are convenience methods + * that call attr with a predefined attribute. + */ + + fun isAutoComplete() = attr(Attr.AUTOCOMPLETE, null) + fun isAutoFocus() = attr(Attr.AUTOFOCUS, null) + fun isHidden() = attr(Attr.HIDDEN, null) + fun isRequired() = attr(Attr.REQUIRED, null) + fun withAlt(alt: String) = attr(Attr.ALT, alt) + fun withAction(action: String) = attr(Attr.ACTION, action) + fun withCharset(charset: String) = attr(Attr.CHARSET, charset) + fun withClass(className: String) = attr(Attr.CLASS, className) + fun withContent(content: String) = attr(Attr.CONTENT, content) + fun withHref(href: String) = attr(Attr.HREF, href) + fun withId(id: String) = attr(Attr.ID, id) + fun withData(dataAttr: String, value: String) = attr(Attr.DATA + "-" + dataAttr, value) + fun withMethod(method: String) = attr(Attr.METHOD, method) + fun withName(name: String) = attr(Attr.NAME, name) + fun withPlaceholder(placeholder: String) = attr(Attr.PLACEHOLDER, placeholder) + fun withTarget(target: String) = attr(Attr.TARGET, target) + fun withType(type: String) = attr(Attr.TYPE, type) + fun withRel(rel: String) = attr(Attr.REL, rel) + fun withSrc(src: String) = attr(Attr.SRC, src) + fun withValue(value: String) = attr(Attr.VALUE, value) + fun withCondAutoComplete(condition: Boolean) = condAttr(condition, Attr.AUTOCOMPLETE, null) + fun withCondAutoFocus(condition: Boolean) = condAttr(condition, Attr.AUTOFOCUS, null) + fun withCondHidden(condition: Boolean) = condAttr(condition, Attr.HIDDEN, null) + fun withCondRequired(condition: Boolean) = condAttr(condition, Attr.REQUIRED, null) + fun withCondAlt(condition: Boolean, alt: String) = condAttr(condition, Attr.ALT, alt) + fun withCondAction(condition: Boolean, action: String) = condAttr(condition, Attr.ACTION, action) + fun withCharset(condition: Boolean, charset: String) = condAttr(condition, Attr.CHARSET, charset) + fun withCondClass(condition: Boolean, className: String) = condAttr(condition, Attr.CLASS, className) + fun withCondContent(condition: Boolean, content: String) = condAttr(condition, Attr.CONTENT, content) + fun withCondHref(condition: Boolean, href: String) = condAttr(condition, Attr.HREF, href) + fun withCondId(condition: Boolean, id: String) = condAttr(condition, Attr.ID, id) + fun withCondData(condition: Boolean, dataAttr: String, value: String) = condAttr(condition, Attr.DATA + "-" + dataAttr, value) + fun withCondMethod(condition: Boolean, method: String) = condAttr(condition, Attr.METHOD, method) + fun withCondName(condition: Boolean, name: String) = condAttr(condition, Attr.NAME, name) + fun withCondPlaceholder(condition: Boolean, placeholder: String) = condAttr(condition, Attr.PLACEHOLDER, placeholder) + fun withCondTarget(condition: Boolean, target: String) = condAttr(condition, Attr.TARGET, target) + fun withCondType(condition: Boolean, type: String) = condAttr(condition, Attr.TYPE, type) + fun withCondRel(condition: Boolean, rel: String) = condAttr(condition, Attr.REL, rel) + fun withCondSrc(condition: Boolean, src: String) = condAttr(condition, Attr.SRC, src) + fun withCondValue(condition: Boolean, value: String) = condAttr(condition, Attr.VALUE, value) +} + +fun tag(tagName: String) = ContainerTag(tagName) +fun emptyTag(tagName: String) = EmptyTag(tagName) +fun text(text: String) = Text(text) +fun unsafeHtml(html: String) = UnescapedText(html) + +//EmptyTags +fun area() = EmptyTag("area") +fun base() = EmptyTag("base") +fun br() = EmptyTag("br") +fun col() = EmptyTag("col") +fun document() = EmptyTag("!DOCTYPE html") +fun embed() = EmptyTag("embed") +fun hr() = EmptyTag("hr") +fun img() = EmptyTag("img") +fun input() = EmptyTag("input") +fun keygen() = EmptyTag("keygen") +fun link() = EmptyTag("link") +fun meta() = EmptyTag("meta") +fun param() = EmptyTag("param") +fun source() = EmptyTag("source") +fun track() = EmptyTag("track") +fun wbr() = EmptyTag("wbr") + +// ContainerTags +fun a() = tag("a") +fun a(text: String) = tag("a").withText(text) +fun a(text: String, href: String) = tag("a").withText(text).withHref(href) +fun abbr() = ContainerTag("abbr") +fun address() = ContainerTag("address") +fun article() = ContainerTag("article") +fun aside() = ContainerTag("aside") +fun audio() = ContainerTag("audio") +fun b() = ContainerTag("b") +fun b(text: String) = ContainerTag("b").withText(text) +fun bdi() = ContainerTag("bdi") +fun bdi(text: String) = ContainerTag("bdi").withText(text) +fun bdo() = ContainerTag("bdo") +fun bdo(text: String) = ContainerTag("bdo").withText(text) +fun blockquote() = ContainerTag("blockquote") +fun blockquote(text: String) = ContainerTag("blockquote").withText(text) +fun body() = ContainerTag("body") +fun button() = ContainerTag("button") +fun button(text: String) = ContainerTag("button").withText(text) +fun canvas() = ContainerTag("canvas") +fun caption() = ContainerTag("caption") +fun caption(text: String) = ContainerTag("caption").withText(text) +fun cite() = ContainerTag("cite") +fun cite(text: String) = ContainerTag("cite").withText(text) +fun code() = ContainerTag("code") +fun colgroup() = ContainerTag("colgroup") +fun datalist() = ContainerTag("datalist") +fun dd() = ContainerTag("dd") +fun dd(text: String) = ContainerTag("dd").withText(text) +fun del() = ContainerTag("del") +fun del(text: String) = ContainerTag("del").withText(text) +fun details() = ContainerTag("details") +fun dfn() = ContainerTag("dfn") +fun dfn(text: String) = ContainerTag("dfn").withText(text) +fun dialog() = ContainerTag("dialog") +fun dialog(text: String) = ContainerTag("dialog").withText(text) +fun div() = ContainerTag("div") +fun dl() = ContainerTag("dl") +fun dt() = ContainerTag("dt") +fun dt(text: String) = ContainerTag("dt").withText(text) +fun em() = ContainerTag("em") +fun em(text: String) = ContainerTag("em").withText(text) +fun fieldset() = ContainerTag("fieldset") +fun figcaption() = ContainerTag("figcaption") +fun figcaption(text: String) = ContainerTag("figcaption").withText(text) +fun figure() = ContainerTag("figure") +fun footer() = ContainerTag("footer") +fun form() = ContainerTag("form") +fun h1() = ContainerTag("h1") +fun h1(text: String) = ContainerTag("h1").withText(text) +fun h2() = ContainerTag("h2") +fun h2(text: String) = ContainerTag("h2").withText(text) +fun h3() = ContainerTag("h3") +fun h3(text: String) = ContainerTag("h3").withText(text) +fun h4() = ContainerTag("h4") +fun h4(text: String) = ContainerTag("h4").withText(text) +fun h5() = ContainerTag("h5") +fun h5(text: String) = ContainerTag("h5").withText(text) +fun h6() = ContainerTag("h6") +fun h6(text: String) = ContainerTag("h6").withText(text) +fun head() = ContainerTag("head") +fun header() = ContainerTag("header") +fun html() = ContainerTag("html") +fun i() = ContainerTag("i") +fun i(text: String) = ContainerTag("i").withText(text) +fun iframe() = ContainerTag("iframe") +fun ins() = ContainerTag("ins") +fun ins(text: String) = ContainerTag("ins").withText(text) +fun kbd() = ContainerTag("kbd") +fun label() = ContainerTag("label") +fun label(text: String) = ContainerTag("label").withText(text) +fun legend() = ContainerTag("legend") +fun legend(text: String) = ContainerTag("legend").withText(text) +fun li() = ContainerTag("li") +fun li(text: String) = ContainerTag("li").withText(text) +fun main() = ContainerTag("main") +fun map() = ContainerTag("map") +fun mark() = ContainerTag("mark") +fun menu() = ContainerTag("menu") +fun menuitem() = ContainerTag("menuitem") +fun meter() = ContainerTag("meter") +fun nav() = ContainerTag("nav") +fun noscript() = ContainerTag("noscript") +fun object_() = ContainerTag("object") +fun ol() = ContainerTag("ol") +fun optgroup() = ContainerTag("optgroup") +fun option() = ContainerTag("option") +fun option(text: String) = ContainerTag("option").withText(text) +fun output() = ContainerTag("output") +fun p() = ContainerTag("p") +fun p(text: String) = ContainerTag("p").withText(text) +fun pre() = ContainerTag("pre") +fun progress() = ContainerTag("progress") +fun q() = ContainerTag("q") +fun q(text: String) = ContainerTag("q").withText(text) +fun rp() = ContainerTag("rp") +fun rt() = ContainerTag("rt") +fun ruby() = ContainerTag("ruby") +fun s() = ContainerTag("s") +fun s(text: String) = ContainerTag("s").withText(text) +fun samp() = ContainerTag("samp") +fun script() = ContainerTag("script") +fun section() = ContainerTag("section") +fun select() = ContainerTag("select") +fun small() = ContainerTag("small") +fun small(text: String) = ContainerTag("small").withText(text) +fun span() = ContainerTag("span") +fun span(text: String) = ContainerTag("span").withText(text) +fun strong() = ContainerTag("strong") +fun strong(text: String) = ContainerTag("strong").withText(text) +fun style() = ContainerTag("style") +fun sub() = ContainerTag("sub") +fun sub(text: String) = ContainerTag("sub").withText(text) +fun summary() = ContainerTag("summary") +fun summary(text: String) = ContainerTag("summary").withText(text) +fun sup() = ContainerTag("sup") +fun sup(text: String) = ContainerTag("sup").withText(text) +fun table() = ContainerTag("table") +fun tbody() = ContainerTag("tbody") +fun td() = ContainerTag("td") +fun td(text: String) = ContainerTag("td").withText(text) +fun textarea() = ContainerTag("textarea") +fun tfoot() = ContainerTag("tfoot") +fun th() = ContainerTag("th") +fun th(text: String) = ContainerTag("th").withText(text) +fun thead() = ContainerTag("thead") +fun time() = ContainerTag("time") +fun title() = ContainerTag("title") +fun title(text: String) = ContainerTag("title").withText(text) +fun tr() = ContainerTag("tr") +fun u() = ContainerTag("u") +fun u(text: String) = ContainerTag("u").withText(text) +fun ul() = ContainerTag("ul") +fun var_() = ContainerTag("var") +fun videa() = ContainerTag("video") + +fun main(args: Array) { + var tag = div().with(h1().with(a("Text"))) + var tag1 = div() + + (h1("Title ") + a("Nu!", "http://www.nu.nl/")) + var tag2 = div() + (h1() + a("Text")) + var tag3 = tag2 + Text("Boehoe!") + + var tag4 = tag + tag1 + tag2 + tag3 + + println(tag) + println(tag1) + println(tag2) + println(tag3) + println(tag4) + + var tag5 = tag % tag1 % tag2 % tag3 + + println(tag) + println(tag5) +} diff --git a/test/nl/astraeus/tag/BasicTest.kt b/test/nl/astraeus/tag/BasicTest.kt new file mode 100644 index 0000000..af9fea9 --- /dev/null +++ b/test/nl/astraeus/tag/BasicTest.kt @@ -0,0 +1,31 @@ +package nl.astraeus.tag + +import nl.astraeus.web.tag.div +import nl.astraeus.web.tag.h1 +import nl.astraeus.web.tag.hr +import org.junit.Test +import kotlin.test.assertTrue + +/** + * Created by rnentjes on 20-10-15. + */ + +class BasicTest { + + @Test fun basicTest() { + var html = div().with( + h1("Hello world!") + ).with(hr()) + + assertTrue { + html.render().equals("

Hello world!


") + } + + var tst = html.render(pretty = true) + + assertTrue { + html.render(pretty = true).equals("
\n

\n Hello world!\n

\n
\n
") + } + } + +}