From 9665fe692681bc958e55d00cc0d0b238b7aee694 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Sat, 3 Feb 2018 23:21:46 +0100 Subject: Refactoring for kdoc API documentation with dokka --- LICENSE | 21 ++ Module.md | 7 + build.gradle | 67 ++-- dokka/kvision-dokka-helper.jar | Bin 0 -> 7284 bytes examples/helloworld/.gitignore | 5 - examples/helloworld/build.gradle | 92 ----- examples/helloworld/detekt.yml | 292 ---------------- examples/helloworld/gradle.properties | 2 - .../helloworld/gradle/wrapper/gradle-wrapper.jar | Bin 54712 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 - examples/helloworld/gradlew | 172 ---------- examples/helloworld/gradlew.bat | 84 ----- examples/helloworld/package.json.d/project.info | 3 - examples/helloworld/settings.gradle | 1 - .../src/main/kotlin/com/example/Helloworld.kt | 32 -- .../helloworld/src/main/kotlin/com/example/Main.kt | 42 --- .../helloworld/src/main/resources/css/style.css | 3 - examples/helloworld/src/main/web/index.html | 19 -- .../test/kotlin/test/com/example/HelloworldSpec.kt | 21 -- .../src/test/kotlin/test/com/example/TestUtil.kt | 32 -- examples/helloworld/webpack.config.d/bootstrap.js | 4 - examples/helloworld/webpack.config.d/css.js | 2 - examples/helloworld/webpack.config.d/dce.js | 2 - examples/helloworld/webpack.config.d/file.js | 6 - examples/helloworld/webpack.config.d/jquery.js | 4 - examples/helloworld/webpack.config.d/minify.js | 4 - examples/showcase/.gitignore | 5 - examples/showcase/build.gradle | 92 ----- examples/showcase/detekt.yml | 292 ---------------- examples/showcase/gradle.properties | 2 - .../showcase/gradle/wrapper/gradle-wrapper.jar | Bin 54712 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 - examples/showcase/gradlew | 172 ---------- examples/showcase/gradlew.bat | 84 ----- examples/showcase/package.json.d/project.info | 3 - examples/showcase/settings.gradle | 1 - .../src/main/kotlin/com/example/BasicTab.kt | 38 --- .../src/main/kotlin/com/example/ButtonsTab.kt | 48 --- .../src/main/kotlin/com/example/ContainersTab.kt | 95 ------ .../src/main/kotlin/com/example/DataTab.kt | 74 ---- .../src/main/kotlin/com/example/DropDownTab.kt | 63 ---- .../src/main/kotlin/com/example/FormTab.kt | 137 -------- .../src/main/kotlin/com/example/LayoutsTab.kt | 160 --------- .../showcase/src/main/kotlin/com/example/Main.kt | 42 --- .../src/main/kotlin/com/example/ModalsTab.kt | 78 ----- .../src/main/kotlin/com/example/Showcase.kt | 43 --- examples/showcase/src/main/resources/css/style.css | 0 examples/showcase/src/main/resources/img/cat.jpg | Bin 39488 -> 0 bytes examples/showcase/src/main/resources/img/dog.jpg | Bin 119870 -> 0 bytes examples/showcase/src/main/web/index.html | 19 -- .../test/kotlin/test/com/example/ShowcaseSpec.kt | 19 -- .../src/test/kotlin/test/com/example/TestUtil.kt | 32 -- examples/showcase/webpack.config.d/bootstrap.js | 4 - examples/showcase/webpack.config.d/css.js | 2 - examples/showcase/webpack.config.d/dce.js | 2 - examples/showcase/webpack.config.d/file.js | 6 - examples/showcase/webpack.config.d/jquery.js | 4 - examples/showcase/webpack.config.d/minify.js | 4 - examples/todomvc/.gitignore | 5 - examples/todomvc/build.gradle | 100 ------ examples/todomvc/detekt.yml | 292 ---------------- examples/todomvc/gradle.properties | 2 - examples/todomvc/gradle/wrapper/gradle-wrapper.jar | Bin 54712 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 - examples/todomvc/gradlew | 172 ---------- examples/todomvc/gradlew.bat | 84 ----- examples/todomvc/package.json.d/project.info | 3 - examples/todomvc/settings.gradle | 1 - .../todomvc/src/main/kotlin/com/example/Main.kt | 40 --- .../todomvc/src/main/kotlin/com/example/Todomvc.kt | 245 -------------- examples/todomvc/src/main/web/index.html | 22 -- .../web/node_modules/todomvc-app-css/index.css | 376 --------------------- .../web/node_modules/todomvc-app-css/package.json | 61 ---- .../web/node_modules/todomvc-app-css/readme.md | 28 -- .../main/web/node_modules/todomvc-common/base.css | 141 -------- .../main/web/node_modules/todomvc-common/base.js | 249 -------------- .../web/node_modules/todomvc-common/package.json | 57 ---- .../main/web/node_modules/todomvc-common/readme.md | 15 - examples/todomvc/src/main/web/package-lock.json | 16 - examples/todomvc/src/main/web/package.json | 7 - .../src/test/kotlin/test/com/example/TestUtil.kt | 32 -- examples/todomvc/webpack.config.d/bootstrap.js | 4 - examples/todomvc/webpack.config.d/css.js | 2 - examples/todomvc/webpack.config.d/dce.js | 2 - examples/todomvc/webpack.config.d/file.js | 6 - examples/todomvc/webpack.config.d/jquery.js | 4 - examples/todomvc/webpack.config.d/minify.js | 4 - gradle/wrapper/gradle-wrapper.jar | Bin 54712 -> 54333 bytes gradle/wrapper/gradle-wrapper.properties | 3 +- .../kotlin/pl/treksoft/kvision/ApplicationBase.kt | 21 +- src/main/kotlin/pl/treksoft/kvision/HMR.kt | 15 + src/main/kotlin/pl/treksoft/kvision/basic/Label.kt | 6 - .../kotlin/pl/treksoft/kvision/core/Component.kt | 2 - .../pl/treksoft/kvision/core/StyledComponent.kt | 4 +- .../pl/treksoft/kvision/data/DataContainer.kt | 2 +- src/main/kotlin/pl/treksoft/kvision/html/Label.kt | 6 + .../kotlin/pl/treksoft/kvision/panel/SplitPanel.kt | 5 +- .../test/pl/treksoft/kvision/basic/LabelSpec.kt | 23 -- .../pl/treksoft/kvision/data/DataContainerSpec.kt | 2 +- .../test/pl/treksoft/kvision/html/LabelSpec.kt | 23 ++ .../pl/treksoft/kvision/panel/DockPanelSpec.kt | 2 +- .../pl/treksoft/kvision/panel/FlexPanelSpec.kt | 2 +- .../pl/treksoft/kvision/panel/GridPanelSpec.kt | 2 +- .../test/pl/treksoft/kvision/panel/HPanelSpec.kt | 2 +- .../kvision/panel/ResponsiveGridPanelSpec.kt | 2 +- .../pl/treksoft/kvision/panel/SplitPanelSpec.kt | 2 +- .../pl/treksoft/kvision/panel/StackPanelSpec.kt | 2 +- .../test/pl/treksoft/kvision/panel/TabPanelSpec.kt | 2 +- .../test/pl/treksoft/kvision/panel/VPanelSpec.kt | 2 +- 109 files changed, 155 insertions(+), 4401 deletions(-) create mode 100644 LICENSE create mode 100644 Module.md create mode 100644 dokka/kvision-dokka-helper.jar delete mode 100644 examples/helloworld/.gitignore delete mode 100644 examples/helloworld/build.gradle delete mode 100644 examples/helloworld/detekt.yml delete mode 100644 examples/helloworld/gradle.properties delete mode 100644 examples/helloworld/gradle/wrapper/gradle-wrapper.jar delete mode 100644 examples/helloworld/gradle/wrapper/gradle-wrapper.properties delete mode 100755 examples/helloworld/gradlew delete mode 100644 examples/helloworld/gradlew.bat delete mode 100644 examples/helloworld/package.json.d/project.info delete mode 100644 examples/helloworld/settings.gradle delete mode 100644 examples/helloworld/src/main/kotlin/com/example/Helloworld.kt delete mode 100644 examples/helloworld/src/main/kotlin/com/example/Main.kt delete mode 100644 examples/helloworld/src/main/resources/css/style.css delete mode 100644 examples/helloworld/src/main/web/index.html delete mode 100644 examples/helloworld/src/test/kotlin/test/com/example/HelloworldSpec.kt delete mode 100644 examples/helloworld/src/test/kotlin/test/com/example/TestUtil.kt delete mode 100644 examples/helloworld/webpack.config.d/bootstrap.js delete mode 100644 examples/helloworld/webpack.config.d/css.js delete mode 100644 examples/helloworld/webpack.config.d/dce.js delete mode 100644 examples/helloworld/webpack.config.d/file.js delete mode 100644 examples/helloworld/webpack.config.d/jquery.js delete mode 100644 examples/helloworld/webpack.config.d/minify.js delete mode 100644 examples/showcase/.gitignore delete mode 100644 examples/showcase/build.gradle delete mode 100644 examples/showcase/detekt.yml delete mode 100644 examples/showcase/gradle.properties delete mode 100644 examples/showcase/gradle/wrapper/gradle-wrapper.jar delete mode 100644 examples/showcase/gradle/wrapper/gradle-wrapper.properties delete mode 100755 examples/showcase/gradlew delete mode 100644 examples/showcase/gradlew.bat delete mode 100644 examples/showcase/package.json.d/project.info delete mode 100644 examples/showcase/settings.gradle delete mode 100644 examples/showcase/src/main/kotlin/com/example/BasicTab.kt delete mode 100644 examples/showcase/src/main/kotlin/com/example/ButtonsTab.kt delete mode 100644 examples/showcase/src/main/kotlin/com/example/ContainersTab.kt delete mode 100644 examples/showcase/src/main/kotlin/com/example/DataTab.kt delete mode 100644 examples/showcase/src/main/kotlin/com/example/DropDownTab.kt delete mode 100644 examples/showcase/src/main/kotlin/com/example/FormTab.kt delete mode 100644 examples/showcase/src/main/kotlin/com/example/LayoutsTab.kt delete mode 100644 examples/showcase/src/main/kotlin/com/example/Main.kt delete mode 100644 examples/showcase/src/main/kotlin/com/example/ModalsTab.kt delete mode 100644 examples/showcase/src/main/kotlin/com/example/Showcase.kt delete mode 100644 examples/showcase/src/main/resources/css/style.css delete mode 100644 examples/showcase/src/main/resources/img/cat.jpg delete mode 100644 examples/showcase/src/main/resources/img/dog.jpg delete mode 100644 examples/showcase/src/main/web/index.html delete mode 100644 examples/showcase/src/test/kotlin/test/com/example/ShowcaseSpec.kt delete mode 100644 examples/showcase/src/test/kotlin/test/com/example/TestUtil.kt delete mode 100644 examples/showcase/webpack.config.d/bootstrap.js delete mode 100644 examples/showcase/webpack.config.d/css.js delete mode 100644 examples/showcase/webpack.config.d/dce.js delete mode 100644 examples/showcase/webpack.config.d/file.js delete mode 100644 examples/showcase/webpack.config.d/jquery.js delete mode 100644 examples/showcase/webpack.config.d/minify.js delete mode 100644 examples/todomvc/.gitignore delete mode 100644 examples/todomvc/build.gradle delete mode 100644 examples/todomvc/detekt.yml delete mode 100644 examples/todomvc/gradle.properties delete mode 100644 examples/todomvc/gradle/wrapper/gradle-wrapper.jar delete mode 100644 examples/todomvc/gradle/wrapper/gradle-wrapper.properties delete mode 100755 examples/todomvc/gradlew delete mode 100644 examples/todomvc/gradlew.bat delete mode 100644 examples/todomvc/package.json.d/project.info delete mode 100644 examples/todomvc/settings.gradle delete mode 100644 examples/todomvc/src/main/kotlin/com/example/Main.kt delete mode 100644 examples/todomvc/src/main/kotlin/com/example/Todomvc.kt delete mode 100644 examples/todomvc/src/main/web/index.html delete mode 100644 examples/todomvc/src/main/web/node_modules/todomvc-app-css/index.css delete mode 100644 examples/todomvc/src/main/web/node_modules/todomvc-app-css/package.json delete mode 100644 examples/todomvc/src/main/web/node_modules/todomvc-app-css/readme.md delete mode 100644 examples/todomvc/src/main/web/node_modules/todomvc-common/base.css delete mode 100644 examples/todomvc/src/main/web/node_modules/todomvc-common/base.js delete mode 100644 examples/todomvc/src/main/web/node_modules/todomvc-common/package.json delete mode 100644 examples/todomvc/src/main/web/node_modules/todomvc-common/readme.md delete mode 100644 examples/todomvc/src/main/web/package-lock.json delete mode 100644 examples/todomvc/src/main/web/package.json delete mode 100644 examples/todomvc/src/test/kotlin/test/com/example/TestUtil.kt delete mode 100644 examples/todomvc/webpack.config.d/bootstrap.js delete mode 100644 examples/todomvc/webpack.config.d/css.js delete mode 100644 examples/todomvc/webpack.config.d/dce.js delete mode 100644 examples/todomvc/webpack.config.d/file.js delete mode 100644 examples/todomvc/webpack.config.d/jquery.js delete mode 100644 examples/todomvc/webpack.config.d/minify.js delete mode 100644 src/main/kotlin/pl/treksoft/kvision/basic/Label.kt create mode 100644 src/main/kotlin/pl/treksoft/kvision/html/Label.kt delete mode 100644 src/test/kotlin/test/pl/treksoft/kvision/basic/LabelSpec.kt create mode 100644 src/test/kotlin/test/pl/treksoft/kvision/html/LabelSpec.kt diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..b4f8e8b2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2017-2018 Robert Jaros + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Module.md b/Module.md new file mode 100644 index 00000000..753c7fbe --- /dev/null +++ b/Module.md @@ -0,0 +1,7 @@ +# Module KVision + +KVision - object oriented Web UI framework for Kotlin/JS. + +# Package pl.treksoft.kvision + +Base interfaces, classes and functions declarations necessary to develop KVision applications. diff --git a/build.gradle b/build.gradle index c714b81a..532af293 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,6 @@ buildscript { ext.kotlin_version = '1.2.21' + ext.dokka_version = '0.9.16-eap-3' ext.production = (findProperty('prod') ?: 'false') == 'true' ext.npmdeps = new File("npm.dependencies").getText() @@ -7,12 +8,14 @@ buildscript { jcenter() maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' } maven { url "https://plugins.gradle.org/m2/" } + maven { url 'https://bintray.com/kotlin/kotlin-eap/dokka' } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-frontend-plugin:0.0.26" classpath "gradle.plugin.io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.0.0.RC6-2" + classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}" } } @@ -21,9 +24,14 @@ plugins { id "com.jfrog.bintray" version "1.7.3" } -apply plugin: 'kotlin2js' +if (!project.gradle.startParameter.taskNames.contains("dokka")) { + apply plugin: 'kotlin2js' +} else { + apply plugin: 'kotlin' +} apply plugin: 'org.jetbrains.kotlin.frontend' apply plugin: "io.gitlab.arturbosch.detekt" +apply plugin: 'org.jetbrains.dokka' group = 'pl.treksoft' version = '0.0.1' @@ -35,8 +43,13 @@ repositories { } dependencies { - compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version" - compile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version" // for now only compile configuration is supported + if (!project.gradle.startParameter.taskNames.contains("dokka")) { + compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version" + compile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version" // for now only compile configuration is supported + } else { + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + compile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" // for now only compile configuration is supported + } compile "com.github.snabbdom:snabbdom-kotlin:0.1.1" compile "pl.treksoft:navigo-kotlin:0.0.2" compile "pl.treksoft:jquery-kotlin:0.0.3" @@ -62,16 +75,16 @@ kotlinFrontend { } task cleanLibs(type: Delete) { - delete 'build/js', 'build/libs' + delete 'build/js', 'build/libs' } -if (project.gradle.startParameter.taskNames.contains("jar")){ +if (project.gradle.startParameter.taskNames.contains("jar")) { compileKotlin2Js.dependsOn 'cleanLibs' } jar { duplicatesStrategy = DuplicatesStrategy.EXCLUDE - excludes = [ "package.json" ] + excludes = ["package.json"] } task sourcesJar(type: Jar, dependsOn: classes) { @@ -88,18 +101,30 @@ detekt { } } -compileKotlin2Js { - kotlinOptions.metaInfo = true - kotlinOptions.outputFile = "$project.buildDir.path/js/${project.name}.js" - kotlinOptions.sourceMap = !production - kotlinOptions.moduleKind = 'commonjs' +dokka { + includes = ['Module.md'] + classpath = [new File("dokka/kvision-dokka-helper.jar")] + outputFormat = 'html' + outputDirectory = "$buildDir/kdoc" + impliedPlatforms = ["JS"] } -compileTestKotlin2Js { - kotlinOptions.metaInfo = true - kotlinOptions.outputFile = "$project.buildDir.path/js-tests/${project.name}-tests.js" - kotlinOptions.sourceMap = !production - kotlinOptions.moduleKind = 'commonjs' +if (!project.gradle.startParameter.taskNames.contains("dokka")) { + + compileKotlin2Js { + kotlinOptions.metaInfo = true + kotlinOptions.outputFile = "$project.buildDir.path/js/${project.name}.js" + kotlinOptions.sourceMap = !production + kotlinOptions.moduleKind = 'commonjs' + } + + compileTestKotlin2Js { + kotlinOptions.metaInfo = true + kotlinOptions.outputFile = "$project.buildDir.path/js-tests/${project.name}-tests.js" + kotlinOptions.sourceMap = !production + kotlinOptions.moduleKind = 'commonjs' + } + } task copyResources(type: Copy) { @@ -112,9 +137,11 @@ task copyResourcesForTests(type: Copy) { into file(buildDir.path + "/js-tests/") } -afterEvaluate { - tasks.getByName("webpack-bundle") { dependsOn(copyResources) } - tasks.getByName("webpack-run") { dependsOn(copyResources, copyResourcesForTests) } +if (!project.gradle.startParameter.taskNames.contains("dokka")) { + afterEvaluate { + tasks.getByName("webpack-bundle") { dependsOn(copyResources) } + tasks.getByName("webpack-run") { dependsOn(copyResources, copyResourcesForTests) } + } } publishing { @@ -148,7 +175,7 @@ bintray { vcsUrl = "https://github.com/rjaros/${project.name}.git" version { name = "${project.version}" - desc = 'Object oriented Web UI framework for Kotlin.' + desc = 'Object oriented Web UI framework for Kotlin/JS' released = new Date() } } diff --git a/dokka/kvision-dokka-helper.jar b/dokka/kvision-dokka-helper.jar new file mode 100644 index 00000000..752a1311 Binary files /dev/null and b/dokka/kvision-dokka-helper.jar differ diff --git a/examples/helloworld/.gitignore b/examples/helloworld/.gitignore deleted file mode 100644 index 631a8b87..00000000 --- a/examples/helloworld/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.*/ -build/ -out/ -*.iml -/refresh.sh diff --git a/examples/helloworld/build.gradle b/examples/helloworld/build.gradle deleted file mode 100644 index 8ffec081..00000000 --- a/examples/helloworld/build.gradle +++ /dev/null @@ -1,92 +0,0 @@ -buildscript { - ext.kotlin_version = '1.2.21' - ext.production = (findProperty('prod') ?: 'false') == 'true' - ext.npmdeps = new URL("file:///home/rjaros/git/kvision/npm.dependencies").getText() - - repositories { - jcenter() - maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' } - maven { url "https://plugins.gradle.org/m2/" } - } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-frontend-plugin:0.0.26" - classpath "gradle.plugin.io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.0.0.RC6-2" - } -} - -apply plugin: 'kotlin2js' -apply plugin: 'org.jetbrains.kotlin.frontend' -apply plugin: "io.gitlab.arturbosch.detekt" - -repositories { - jcenter() - maven { url = 'https://dl.bintray.com/gbaldeck/kotlin' } - maven { url = 'https://dl.bintray.com/rjaros/kotlin' } - maven { - url "file:///home/rjaros/kotlin/mvn/" - } -} - -dependencies { - compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version" - compile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version" // for now only compile configuration is supported - compile "pl.treksoft:kvision:0.0.1" -} - -kotlinFrontend { - npm { - npmdeps.eachLine { line -> - def (name, version) = line.tokenize(" ") - dependency(name, version) - } - devDependency("karma") - } - - webpackBundle { - bundleName = "main" - contentPath = file('src/main/web') - } - - define "PRODUCTION", production - -} - -detekt { - version = "1.0.0.RC6-2" - profile("main") { - input = "$projectDir/src/main/kotlin" - config = "$projectDir/detekt.yml" - filters = ".*test.*,.*/resources/.*,.*/tmp/.*" - } -} - -compileKotlin2Js { - kotlinOptions.metaInfo = true - kotlinOptions.outputFile = "$project.buildDir.path/js/${project.name}.js" - kotlinOptions.sourceMap = !production - kotlinOptions.moduleKind = 'commonjs' -} - -compileTestKotlin2Js { - kotlinOptions.metaInfo = true - kotlinOptions.outputFile = "$project.buildDir.path/js-tests/${project.name}-tests.js" - kotlinOptions.sourceMap = !production - kotlinOptions.moduleKind = 'commonjs' -} - -task copyResources(type: Copy) { - from "src/main/resources" - into file(buildDir.path + "/js") -} - -task copyResourcesForTests(type: Copy) { - from "src/main/resources" - into file(buildDir.path + "/js-tests/") -} - -afterEvaluate { - tasks.getByName("webpack-bundle") { dependsOn(copyResources) } - tasks.getByName("webpack-run") { dependsOn(copyResources, copyResourcesForTests) } -} diff --git a/examples/helloworld/detekt.yml b/examples/helloworld/detekt.yml deleted file mode 100644 index a6fdea75..00000000 --- a/examples/helloworld/detekt.yml +++ /dev/null @@ -1,292 +0,0 @@ -autoCorrect: true -failFast: false - -build: - warningThreshold: 5 - failThreshold: 10 - weights: - complexity: 2 - formatting: 1 - LongParameterList: 1 - comments: 1 - -processors: - active: true - exclude: - # - 'FunctionCountProcessor' - # - 'PropertyCountProcessor' - # - 'ClassCountProcessor' - # - 'PackageCountProcessor' - # - 'KtFileCountProcessor' - -console-reports: - active: true - exclude: - # - 'ProjectStatisticsReport' - # - 'ComplexityReport' - # - 'NotificationReport' - # - 'FindingsReport' - # - 'BuildFailureReport' - -output-reports: - active: true - exclude: - # - 'PlainOutputReport' - # - 'XmlOutputReport' - -potential-bugs: - active: true - DuplicateCaseInWhenExpression: - active: true - EqualsAlwaysReturnsTrueOrFalse: - active: false - EqualsWithHashCodeExist: - active: true - WrongEqualsTypeParameter: - active: false - ExplicitGarbageCollectionCall: - active: true - UnreachableCode: - active: true - LateinitUsage: - active: false - UnsafeCallOnNullableType: - active: false - UnsafeCast: - active: false - UselessPostfixExpression: - active: false - -performance: - active: true - ForEachOnRange: - active: true - SpreadOperator: - active: true - UnnecessaryTemporaryInstantiation: - active: true - -exceptions: - active: true - TooGenericExceptionCatched: - active: true - exceptions: - - ArrayIndexOutOfBoundsException - - Error - - Exception - - IllegalMonitorStateException - - IndexOutOfBoundsException - - NullPointerException - - RuntimeException - TooGenericExceptionThrown: - active: true - exceptions: - - Throwable - - ThrowError - - ThrowException - - ThrowNullPointerException - - ThrowRuntimeException - - ThrowThrowable - -empty-blocks: - active: true - EmptyCatchBlock: - active: true - EmptyClassBlock: - active: true - EmptyDefaultConstructor: - active: true - EmptyDoWhileBlock: - active: true - EmptyElseBlock: - active: true - EmptyFinallyBlock: - active: true - EmptyForBlock: - active: true - EmptyFunctionBlock: - active: true - EmptyIfBlock: - active: true - EmptyInitBlock: - active: true - EmptySecondaryConstructor: - active: true - EmptyWhenBlock: - active: true - EmptyWhileBlock: - active: true - -complexity: - active: true - LongMethod: - threshold: 20 - LongParameterList: - threshold: 5 - LargeClass: - threshold: 150 - ComplexMethod: - threshold: 10 - TooManyFunctions: - threshold: 10 - ComplexCondition: - threshold: 3 - LabeledExpression: - active: false - StringLiteralDuplication: - active: false - threshold: 2 - ignoreAnnotation: true - excludeStringsWithLessThan5Characters: true - ignoreStringsRegex: '$^' - -code-smell: - active: true - FeatureEnvy: - threshold: 0.5 - weight: 0.45 - base: 0.5 - -formatting: - active: true - useTabs: true - Indentation: - active: false - indentSize: 4 - ConsecutiveBlankLines: - active: true - autoCorrect: true - MultipleSpaces: - active: true - autoCorrect: true - SpacingAfterComma: - active: true - autoCorrect: true - SpacingAfterKeyword: - active: true - autoCorrect: true - SpacingAroundColon: - active: true - autoCorrect: true - SpacingAroundCurlyBraces: - active: true - autoCorrect: true - SpacingAroundOperator: - active: true - autoCorrect: true - TrailingSpaces: - active: true - autoCorrect: true - UnusedImports: - active: true - autoCorrect: true - OptionalSemicolon: - active: true - autoCorrect: true - OptionalUnit: - active: true - autoCorrect: true - ExpressionBodySyntax: - active: false - autoCorrect: false - ExpressionBodySyntaxLineBreaks: - active: false - autoCorrect: false - OptionalReturnKeyword: - active: true - autoCorrect: false - -style: - active: true - ReturnCount: - active: true - max: 2 - NewLineAtEndOfFile: - active: true - OptionalAbstractKeyword: - active: true - OptionalWhenBraces: - active: false - EqualsNullCall: - active: false - ForbiddenComment: - active: true - values: 'TODO:,FIXME:,STOPSHIP:' - ForbiddenImport: - active: false - imports: '' - ModifierOrder: - active: true - MagicNumber: - active: true - ignoreNumbers: '-1,0,1,2' - ignoreHashCodeFunction: false - ignorePropertyDeclaration: false - ignoreAnnotation: false - WildcardImport: - active: true - SafeCast: - active: true - MaxLineLength: - active: true - maxLineLength: 120 - excludePackageStatements: false - excludeImportStatements: false - PackageNaming: - active: true - packagePattern: '^[a-z]+(\.[a-z][a-z0-9]*)*$' - ClassNaming: - active: true - classPattern: '[A-Z$][a-zA-Z$]*' - EnumNaming: - active: true - enumEntryPattern: '^[A-Z$][a-zA-Z_$]*$' - FunctionNaming : - active: true - functionPattern: '^[a-z$][a-zA-Z$0-9]*$' - FunctionMaxLength: - active: false - maximumFunctionNameLength: 30 - FunctionMinLength: - active: false - minimumFunctionNameLength: 3 - VariableNaming : - active: true - variablePattern: '^(_)?[a-z$][a-zA-Z$0-9]*$' - ConstantNaming : - active: true - constantPattern: '^([A-Z_]*|serialVersionUID)$' - VariableMaxLength: - active: false - maximumVariableNameLength: 30 - VariableMinLength: - active: false - minimumVariableNameLength: 3 - ProtectedMemberInFinalClass: - active: false - UnnecessaryParentheses: - active: false - -comments: - active: true - CommentOverPrivateMethod: - active: true - CommentOverPrivateProperty: - active: true - UndocumentedPublicClass: - active: false - searchInNestedClass: true - searchInInnerClass: true - searchInInnerObject: true - searchInInnerInterface: true - UndocumentedPublicFunction: - active: false - -# *experimental feature* -# Migration rules can be defined in the same config file or a new one -migration: - active: true - imports: - # your.package.Class: new.package.or.Class - # for example: - # io.gitlab.arturbosch.detekt.api.Rule: io.gitlab.arturbosch.detekt.rule.Rule diff --git a/examples/helloworld/gradle.properties b/examples/helloworld/gradle.properties deleted file mode 100644 index 4ac81290..00000000 --- a/examples/helloworld/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -#org.gradle.jvmargs=-XX:+UnlockCommercialFeatures -XX:+FlightRecorder -#org.gradle.debug=true diff --git a/examples/helloworld/gradle/wrapper/gradle-wrapper.jar b/examples/helloworld/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 09f1fecb..00000000 Binary files a/examples/helloworld/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/examples/helloworld/gradle/wrapper/gradle-wrapper.properties b/examples/helloworld/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 9f53b3e5..00000000 --- a/examples/helloworld/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Mon Jan 22 09:38:31 CET 2018 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip diff --git a/examples/helloworld/gradlew b/examples/helloworld/gradlew deleted file mode 100755 index cccdd3d5..00000000 --- a/examples/helloworld/gradlew +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/env sh - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# 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\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -# 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 -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -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" -a "$nonstop" = "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"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # 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 - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - -exec "$JAVACMD" "$@" diff --git a/examples/helloworld/gradlew.bat b/examples/helloworld/gradlew.bat deleted file mode 100644 index f9553162..00000000 --- a/examples/helloworld/gradlew.bat +++ /dev/null @@ -1,84 +0,0 @@ -@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 - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@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= - -@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 Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_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=%* - -: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/examples/helloworld/package.json.d/project.info b/examples/helloworld/package.json.d/project.info deleted file mode 100644 index 805c8f43..00000000 --- a/examples/helloworld/package.json.d/project.info +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "KVision Helloworld" -} diff --git a/examples/helloworld/settings.gradle b/examples/helloworld/settings.gradle deleted file mode 100644 index 6a02f57e..00000000 --- a/examples/helloworld/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'helloworld' diff --git a/examples/helloworld/src/main/kotlin/com/example/Helloworld.kt b/examples/helloworld/src/main/kotlin/com/example/Helloworld.kt deleted file mode 100644 index 61e75482..00000000 --- a/examples/helloworld/src/main/kotlin/com/example/Helloworld.kt +++ /dev/null @@ -1,32 +0,0 @@ -package com.example - -import pl.treksoft.kvision.ApplicationBase -import pl.treksoft.kvision.core.Root -import pl.treksoft.kvision.html.TAG -import pl.treksoft.kvision.html.Tag -import pl.treksoft.kvision.panel.FLEXDIR -import pl.treksoft.kvision.panel.FLEXJUSTIFY -import pl.treksoft.kvision.panel.FlexPanel -import pl.treksoft.kvision.utils.px - -class Helloworld : ApplicationBase() { - - override fun start(state: Map) { - val root = Root("helloworld") - val panel = FlexPanel(FLEXDIR.ROW, justify = FLEXJUSTIFY.CENTER) - val hello = Tag(TAG.DIV, "Hello world!", classes = setOf("helloworld")).apply { - marginTop = 50.px() - - } - panel.add(hello) - root.add(panel) - } - - override fun dispose(): Map { - return mapOf() - } - - companion object { - val css = require("./css/style.css") - } -} diff --git a/examples/helloworld/src/main/kotlin/com/example/Main.kt b/examples/helloworld/src/main/kotlin/com/example/Main.kt deleted file mode 100644 index 53b6b0ae..00000000 --- a/examples/helloworld/src/main/kotlin/com/example/Main.kt +++ /dev/null @@ -1,42 +0,0 @@ -package com.example - -import pl.treksoft.kvision.ApplicationBase -import pl.treksoft.kvision.core.KVManager -import pl.treksoft.kvision.module -import kotlin.browser.document - -external fun require(name: String): dynamic - -fun main(args: Array) { - var application: ApplicationBase? = null - - val state: dynamic = module.hot?.let { hot -> - hot.accept() - - hot.dispose { data -> - data.appState = application?.dispose() - KVManager.shutdown() - application = null - } - - hot.data - } - - if (document.body != null) { - KVManager.start() - application = start(state) - } else { - KVManager.init() - application = null - document.addEventListener("DOMContentLoaded", { application = start(state) }) - } -} - -fun start(state: dynamic): ApplicationBase? { - if (document.getElementById("helloworld") == null) return null - val application = Helloworld() - @Suppress("UnsafeCastFromDynamic") - application.start(state?.appState ?: emptyMap()) - return application -} - diff --git a/examples/helloworld/src/main/resources/css/style.css b/examples/helloworld/src/main/resources/css/style.css deleted file mode 100644 index 76482c15..00000000 --- a/examples/helloworld/src/main/resources/css/style.css +++ /dev/null @@ -1,3 +0,0 @@ -.helloworld { - font-size: 30px; -} diff --git a/examples/helloworld/src/main/web/index.html b/examples/helloworld/src/main/web/index.html deleted file mode 100644 index a29727fe..00000000 --- a/examples/helloworld/src/main/web/index.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - KVision Helloworld - - - - - - -
- - diff --git a/examples/helloworld/src/test/kotlin/test/com/example/HelloworldSpec.kt b/examples/helloworld/src/test/kotlin/test/com/example/HelloworldSpec.kt deleted file mode 100644 index 8054c000..00000000 --- a/examples/helloworld/src/test/kotlin/test/com/example/HelloworldSpec.kt +++ /dev/null @@ -1,21 +0,0 @@ -package test.com.example - -import com.example.Helloworld -import kotlin.browser.document -import kotlin.test.Test -import kotlin.test.assertTrue - -class HelloworldSpec : DomSpec { - - @Test - fun render() { - run { - Helloworld().start(mapOf()) - val element = document.getElementById("helloworld") - assertTrue( - element?.innerHTML?.contains("Hello world!") ?: false, - "Application should render Hello world! text" - ) - } - } -} diff --git a/examples/helloworld/src/test/kotlin/test/com/example/TestUtil.kt b/examples/helloworld/src/test/kotlin/test/com/example/TestUtil.kt deleted file mode 100644 index c5ec014f..00000000 --- a/examples/helloworld/src/test/kotlin/test/com/example/TestUtil.kt +++ /dev/null @@ -1,32 +0,0 @@ -package test.com.example - -import pl.treksoft.jquery.jQuery -import kotlin.browser.document - -interface TestSpec { - fun beforeTest() - - fun afterTest() - - fun run(code: () -> Unit) { - beforeTest() - code() - afterTest() - } -} - -interface DomSpec : TestSpec { - - override fun beforeTest() { - val fixture = "
" + - "
" - document.body?.insertAdjacentHTML("afterbegin", fixture) - } - - override fun afterTest() { - val div = document.getElementById("pretest") - div?.remove() - jQuery(`object` = ".modal-backdrop").remove() - } - -} diff --git a/examples/helloworld/webpack.config.d/bootstrap.js b/examples/helloworld/webpack.config.d/bootstrap.js deleted file mode 100644 index 32a7c4d0..00000000 --- a/examples/helloworld/webpack.config.d/bootstrap.js +++ /dev/null @@ -1,4 +0,0 @@ -config.module.rules.push({test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff'}); -config.module.rules.push({test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=application/octet-stream'}); -config.module.rules.push({test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file-loader'}); -config.module.rules.push({test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=image/svg+xml'}); diff --git a/examples/helloworld/webpack.config.d/css.js b/examples/helloworld/webpack.config.d/css.js deleted file mode 100644 index 5d710d35..00000000 --- a/examples/helloworld/webpack.config.d/css.js +++ /dev/null @@ -1,2 +0,0 @@ -config.module.rules.push({ test: /\.css$/, loader: "style-loader!css-loader" }); - diff --git a/examples/helloworld/webpack.config.d/dce.js b/examples/helloworld/webpack.config.d/dce.js deleted file mode 100644 index b536a6bf..00000000 --- a/examples/helloworld/webpack.config.d/dce.js +++ /dev/null @@ -1,2 +0,0 @@ -var path = require("path"); -config.resolve.modules.unshift(path.resolve("./js/min")); diff --git a/examples/helloworld/webpack.config.d/file.js b/examples/helloworld/webpack.config.d/file.js deleted file mode 100644 index 8b853e7e..00000000 --- a/examples/helloworld/webpack.config.d/file.js +++ /dev/null @@ -1,6 +0,0 @@ -config.module.rules.push( - { - test: /\.(jpe?g|png|gif|svg)$/i, - loader: 'file-loader' - } -); \ No newline at end of file diff --git a/examples/helloworld/webpack.config.d/jquery.js b/examples/helloworld/webpack.config.d/jquery.js deleted file mode 100644 index 40522595..00000000 --- a/examples/helloworld/webpack.config.d/jquery.js +++ /dev/null @@ -1,4 +0,0 @@ -config.plugins.push(new webpack.ProvidePlugin({ - $: "jquery", - jQuery: "jquery" -})); diff --git a/examples/helloworld/webpack.config.d/minify.js b/examples/helloworld/webpack.config.d/minify.js deleted file mode 100644 index 34e706c9..00000000 --- a/examples/helloworld/webpack.config.d/minify.js +++ /dev/null @@ -1,4 +0,0 @@ -if (defined.PRODUCTION) { - config.plugins.push(new webpack.optimize.UglifyJsPlugin({ - })); -} diff --git a/examples/showcase/.gitignore b/examples/showcase/.gitignore deleted file mode 100644 index 631a8b87..00000000 --- a/examples/showcase/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.*/ -build/ -out/ -*.iml -/refresh.sh diff --git a/examples/showcase/build.gradle b/examples/showcase/build.gradle deleted file mode 100644 index 8ffec081..00000000 --- a/examples/showcase/build.gradle +++ /dev/null @@ -1,92 +0,0 @@ -buildscript { - ext.kotlin_version = '1.2.21' - ext.production = (findProperty('prod') ?: 'false') == 'true' - ext.npmdeps = new URL("file:///home/rjaros/git/kvision/npm.dependencies").getText() - - repositories { - jcenter() - maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' } - maven { url "https://plugins.gradle.org/m2/" } - } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-frontend-plugin:0.0.26" - classpath "gradle.plugin.io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.0.0.RC6-2" - } -} - -apply plugin: 'kotlin2js' -apply plugin: 'org.jetbrains.kotlin.frontend' -apply plugin: "io.gitlab.arturbosch.detekt" - -repositories { - jcenter() - maven { url = 'https://dl.bintray.com/gbaldeck/kotlin' } - maven { url = 'https://dl.bintray.com/rjaros/kotlin' } - maven { - url "file:///home/rjaros/kotlin/mvn/" - } -} - -dependencies { - compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version" - compile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version" // for now only compile configuration is supported - compile "pl.treksoft:kvision:0.0.1" -} - -kotlinFrontend { - npm { - npmdeps.eachLine { line -> - def (name, version) = line.tokenize(" ") - dependency(name, version) - } - devDependency("karma") - } - - webpackBundle { - bundleName = "main" - contentPath = file('src/main/web') - } - - define "PRODUCTION", production - -} - -detekt { - version = "1.0.0.RC6-2" - profile("main") { - input = "$projectDir/src/main/kotlin" - config = "$projectDir/detekt.yml" - filters = ".*test.*,.*/resources/.*,.*/tmp/.*" - } -} - -compileKotlin2Js { - kotlinOptions.metaInfo = true - kotlinOptions.outputFile = "$project.buildDir.path/js/${project.name}.js" - kotlinOptions.sourceMap = !production - kotlinOptions.moduleKind = 'commonjs' -} - -compileTestKotlin2Js { - kotlinOptions.metaInfo = true - kotlinOptions.outputFile = "$project.buildDir.path/js-tests/${project.name}-tests.js" - kotlinOptions.sourceMap = !production - kotlinOptions.moduleKind = 'commonjs' -} - -task copyResources(type: Copy) { - from "src/main/resources" - into file(buildDir.path + "/js") -} - -task copyResourcesForTests(type: Copy) { - from "src/main/resources" - into file(buildDir.path + "/js-tests/") -} - -afterEvaluate { - tasks.getByName("webpack-bundle") { dependsOn(copyResources) } - tasks.getByName("webpack-run") { dependsOn(copyResources, copyResourcesForTests) } -} diff --git a/examples/showcase/detekt.yml b/examples/showcase/detekt.yml deleted file mode 100644 index a6fdea75..00000000 --- a/examples/showcase/detekt.yml +++ /dev/null @@ -1,292 +0,0 @@ -autoCorrect: true -failFast: false - -build: - warningThreshold: 5 - failThreshold: 10 - weights: - complexity: 2 - formatting: 1 - LongParameterList: 1 - comments: 1 - -processors: - active: true - exclude: - # - 'FunctionCountProcessor' - # - 'PropertyCountProcessor' - # - 'ClassCountProcessor' - # - 'PackageCountProcessor' - # - 'KtFileCountProcessor' - -console-reports: - active: true - exclude: - # - 'ProjectStatisticsReport' - # - 'ComplexityReport' - # - 'NotificationReport' - # - 'FindingsReport' - # - 'BuildFailureReport' - -output-reports: - active: true - exclude: - # - 'PlainOutputReport' - # - 'XmlOutputReport' - -potential-bugs: - active: true - DuplicateCaseInWhenExpression: - active: true - EqualsAlwaysReturnsTrueOrFalse: - active: false - EqualsWithHashCodeExist: - active: true - WrongEqualsTypeParameter: - active: false - ExplicitGarbageCollectionCall: - active: true - UnreachableCode: - active: true - LateinitUsage: - active: false - UnsafeCallOnNullableType: - active: false - UnsafeCast: - active: false - UselessPostfixExpression: - active: false - -performance: - active: true - ForEachOnRange: - active: true - SpreadOperator: - active: true - UnnecessaryTemporaryInstantiation: - active: true - -exceptions: - active: true - TooGenericExceptionCatched: - active: true - exceptions: - - ArrayIndexOutOfBoundsException - - Error - - Exception - - IllegalMonitorStateException - - IndexOutOfBoundsException - - NullPointerException - - RuntimeException - TooGenericExceptionThrown: - active: true - exceptions: - - Throwable - - ThrowError - - ThrowException - - ThrowNullPointerException - - ThrowRuntimeException - - ThrowThrowable - -empty-blocks: - active: true - EmptyCatchBlock: - active: true - EmptyClassBlock: - active: true - EmptyDefaultConstructor: - active: true - EmptyDoWhileBlock: - active: true - EmptyElseBlock: - active: true - EmptyFinallyBlock: - active: true - EmptyForBlock: - active: true - EmptyFunctionBlock: - active: true - EmptyIfBlock: - active: true - EmptyInitBlock: - active: true - EmptySecondaryConstructor: - active: true - EmptyWhenBlock: - active: true - EmptyWhileBlock: - active: true - -complexity: - active: true - LongMethod: - threshold: 20 - LongParameterList: - threshold: 5 - LargeClass: - threshold: 150 - ComplexMethod: - threshold: 10 - TooManyFunctions: - threshold: 10 - ComplexCondition: - threshold: 3 - LabeledExpression: - active: false - StringLiteralDuplication: - active: false - threshold: 2 - ignoreAnnotation: true - excludeStringsWithLessThan5Characters: true - ignoreStringsRegex: '$^' - -code-smell: - active: true - FeatureEnvy: - threshold: 0.5 - weight: 0.45 - base: 0.5 - -formatting: - active: true - useTabs: true - Indentation: - active: false - indentSize: 4 - ConsecutiveBlankLines: - active: true - autoCorrect: true - MultipleSpaces: - active: true - autoCorrect: true - SpacingAfterComma: - active: true - autoCorrect: true - SpacingAfterKeyword: - active: true - autoCorrect: true - SpacingAroundColon: - active: true - autoCorrect: true - SpacingAroundCurlyBraces: - active: true - autoCorrect: true - SpacingAroundOperator: - active: true - autoCorrect: true - TrailingSpaces: - active: true - autoCorrect: true - UnusedImports: - active: true - autoCorrect: true - OptionalSemicolon: - active: true - autoCorrect: true - OptionalUnit: - active: true - autoCorrect: true - ExpressionBodySyntax: - active: false - autoCorrect: false - ExpressionBodySyntaxLineBreaks: - active: false - autoCorrect: false - OptionalReturnKeyword: - active: true - autoCorrect: false - -style: - active: true - ReturnCount: - active: true - max: 2 - NewLineAtEndOfFile: - active: true - OptionalAbstractKeyword: - active: true - OptionalWhenBraces: - active: false - EqualsNullCall: - active: false - ForbiddenComment: - active: true - values: 'TODO:,FIXME:,STOPSHIP:' - ForbiddenImport: - active: false - imports: '' - ModifierOrder: - active: true - MagicNumber: - active: true - ignoreNumbers: '-1,0,1,2' - ignoreHashCodeFunction: false - ignorePropertyDeclaration: false - ignoreAnnotation: false - WildcardImport: - active: true - SafeCast: - active: true - MaxLineLength: - active: true - maxLineLength: 120 - excludePackageStatements: false - excludeImportStatements: false - PackageNaming: - active: true - packagePattern: '^[a-z]+(\.[a-z][a-z0-9]*)*$' - ClassNaming: - active: true - classPattern: '[A-Z$][a-zA-Z$]*' - EnumNaming: - active: true - enumEntryPattern: '^[A-Z$][a-zA-Z_$]*$' - FunctionNaming : - active: true - functionPattern: '^[a-z$][a-zA-Z$0-9]*$' - FunctionMaxLength: - active: false - maximumFunctionNameLength: 30 - FunctionMinLength: - active: false - minimumFunctionNameLength: 3 - VariableNaming : - active: true - variablePattern: '^(_)?[a-z$][a-zA-Z$0-9]*$' - ConstantNaming : - active: true - constantPattern: '^([A-Z_]*|serialVersionUID)$' - VariableMaxLength: - active: false - maximumVariableNameLength: 30 - VariableMinLength: - active: false - minimumVariableNameLength: 3 - ProtectedMemberInFinalClass: - active: false - UnnecessaryParentheses: - active: false - -comments: - active: true - CommentOverPrivateMethod: - active: true - CommentOverPrivateProperty: - active: true - UndocumentedPublicClass: - active: false - searchInNestedClass: true - searchInInnerClass: true - searchInInnerObject: true - searchInInnerInterface: true - UndocumentedPublicFunction: - active: false - -# *experimental feature* -# Migration rules can be defined in the same config file or a new one -migration: - active: true - imports: - # your.package.Class: new.package.or.Class - # for example: - # io.gitlab.arturbosch.detekt.api.Rule: io.gitlab.arturbosch.detekt.rule.Rule diff --git a/examples/showcase/gradle.properties b/examples/showcase/gradle.properties deleted file mode 100644 index 4ac81290..00000000 --- a/examples/showcase/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -#org.gradle.jvmargs=-XX:+UnlockCommercialFeatures -XX:+FlightRecorder -#org.gradle.debug=true diff --git a/examples/showcase/gradle/wrapper/gradle-wrapper.jar b/examples/showcase/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 09f1fecb..00000000 Binary files a/examples/showcase/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/examples/showcase/gradle/wrapper/gradle-wrapper.properties b/examples/showcase/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index ebc5a13a..00000000 --- a/examples/showcase/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Wed Jan 24 11:39:21 CET 2018 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip diff --git a/examples/showcase/gradlew b/examples/showcase/gradlew deleted file mode 100755 index cccdd3d5..00000000 --- a/examples/showcase/gradlew +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/env sh - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# 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\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -# 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 -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -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" -a "$nonstop" = "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"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # 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 - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - -exec "$JAVACMD" "$@" diff --git a/examples/showcase/gradlew.bat b/examples/showcase/gradlew.bat deleted file mode 100644 index f9553162..00000000 --- a/examples/showcase/gradlew.bat +++ /dev/null @@ -1,84 +0,0 @@ -@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 - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@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= - -@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 inst