aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2018-02-03 23:21:46 +0100
committerRobert Jaros <rjaros@finn.pl>2018-02-03 23:21:46 +0100
commit9665fe692681bc958e55d00cc0d0b238b7aee694 (patch)
treedd222dec725f64b8065a09311d9b034e9b9751b3 /examples
parent180528f620e53e4a828d6f4d427ce83817572f44 (diff)
downloadkvision-9665fe692681bc958e55d00cc0d0b238b7aee694.tar.gz
kvision-9665fe692681bc958e55d00cc0d0b238b7aee694.tar.bz2
kvision-9665fe692681bc958e55d00cc0d0b238b7aee694.zip
Refactoring for kdoc API documentation with dokka
Diffstat (limited to 'examples')
-rw-r--r--examples/helloworld/.gitignore5
-rw-r--r--examples/helloworld/build.gradle92
-rw-r--r--examples/helloworld/detekt.yml292
-rw-r--r--examples/helloworld/gradle.properties2
-rw-r--r--examples/helloworld/gradle/wrapper/gradle-wrapper.jarbin54712 -> 0 bytes
-rw-r--r--examples/helloworld/gradle/wrapper/gradle-wrapper.properties6
-rwxr-xr-xexamples/helloworld/gradlew172
-rw-r--r--examples/helloworld/gradlew.bat84
-rw-r--r--examples/helloworld/package.json.d/project.info3
-rw-r--r--examples/helloworld/settings.gradle1
-rw-r--r--examples/helloworld/src/main/kotlin/com/example/Helloworld.kt32
-rw-r--r--examples/helloworld/src/main/kotlin/com/example/Main.kt42
-rw-r--r--examples/helloworld/src/main/resources/css/style.css3
-rw-r--r--examples/helloworld/src/main/web/index.html19
-rw-r--r--examples/helloworld/src/test/kotlin/test/com/example/HelloworldSpec.kt21
-rw-r--r--examples/helloworld/src/test/kotlin/test/com/example/TestUtil.kt32
-rw-r--r--examples/helloworld/webpack.config.d/bootstrap.js4
-rw-r--r--examples/helloworld/webpack.config.d/css.js2
-rw-r--r--examples/helloworld/webpack.config.d/dce.js2
-rw-r--r--examples/helloworld/webpack.config.d/file.js6
-rw-r--r--examples/helloworld/webpack.config.d/jquery.js4
-rw-r--r--examples/helloworld/webpack.config.d/minify.js4
-rw-r--r--examples/showcase/.gitignore5
-rw-r--r--examples/showcase/build.gradle92
-rw-r--r--examples/showcase/detekt.yml292
-rw-r--r--examples/showcase/gradle.properties2
-rw-r--r--examples/showcase/gradle/wrapper/gradle-wrapper.jarbin54712 -> 0 bytes
-rw-r--r--examples/showcase/gradle/wrapper/gradle-wrapper.properties6
-rwxr-xr-xexamples/showcase/gradlew172
-rw-r--r--examples/showcase/gradlew.bat84
-rw-r--r--examples/showcase/package.json.d/project.info3
-rw-r--r--examples/showcase/settings.gradle1
-rw-r--r--examples/showcase/src/main/kotlin/com/example/BasicTab.kt38
-rw-r--r--examples/showcase/src/main/kotlin/com/example/ButtonsTab.kt48
-rw-r--r--examples/showcase/src/main/kotlin/com/example/ContainersTab.kt95
-rw-r--r--examples/showcase/src/main/kotlin/com/example/DataTab.kt74
-rw-r--r--examples/showcase/src/main/kotlin/com/example/DropDownTab.kt63
-rw-r--r--examples/showcase/src/main/kotlin/com/example/FormTab.kt137
-rw-r--r--examples/showcase/src/main/kotlin/com/example/LayoutsTab.kt160
-rw-r--r--examples/showcase/src/main/kotlin/com/example/Main.kt42
-rw-r--r--examples/showcase/src/main/kotlin/com/example/ModalsTab.kt78
-rw-r--r--examples/showcase/src/main/kotlin/com/example/Showcase.kt43
-rw-r--r--examples/showcase/src/main/resources/css/style.css0
-rw-r--r--examples/showcase/src/main/resources/img/cat.jpgbin39488 -> 0 bytes
-rw-r--r--examples/showcase/src/main/resources/img/dog.jpgbin119870 -> 0 bytes
-rw-r--r--examples/showcase/src/main/web/index.html19
-rw-r--r--examples/showcase/src/test/kotlin/test/com/example/ShowcaseSpec.kt19
-rw-r--r--examples/showcase/src/test/kotlin/test/com/example/TestUtil.kt32
-rw-r--r--examples/showcase/webpack.config.d/bootstrap.js4
-rw-r--r--examples/showcase/webpack.config.d/css.js2
-rw-r--r--examples/showcase/webpack.config.d/dce.js2
-rw-r--r--examples/showcase/webpack.config.d/file.js6
-rw-r--r--examples/showcase/webpack.config.d/jquery.js4
-rw-r--r--examples/showcase/webpack.config.d/minify.js4
-rw-r--r--examples/todomvc/.gitignore5
-rw-r--r--examples/todomvc/build.gradle100
-rw-r--r--examples/todomvc/detekt.yml292
-rw-r--r--examples/todomvc/gradle.properties2
-rw-r--r--examples/todomvc/gradle/wrapper/gradle-wrapper.jarbin54712 -> 0 bytes
-rw-r--r--examples/todomvc/gradle/wrapper/gradle-wrapper.properties6
-rwxr-xr-xexamples/todomvc/gradlew172
-rw-r--r--examples/todomvc/gradlew.bat84
-rw-r--r--examples/todomvc/package.json.d/project.info3
-rw-r--r--examples/todomvc/settings.gradle1
-rw-r--r--examples/todomvc/src/main/kotlin/com/example/Main.kt40
-rw-r--r--examples/todomvc/src/main/kotlin/com/example/Todomvc.kt245
-rw-r--r--examples/todomvc/src/main/web/index.html22
-rw-r--r--examples/todomvc/src/main/web/node_modules/todomvc-app-css/index.css376
-rw-r--r--examples/todomvc/src/main/web/node_modules/todomvc-app-css/package.json61
-rw-r--r--examples/todomvc/src/main/web/node_modules/todomvc-app-css/readme.md28
-rw-r--r--examples/todomvc/src/main/web/node_modules/todomvc-common/base.css141
-rw-r--r--examples/todomvc/src/main/web/node_modules/todomvc-common/base.js249
-rw-r--r--examples/todomvc/src/main/web/node_modules/todomvc-common/package.json57
-rw-r--r--examples/todomvc/src/main/web/node_modules/todomvc-common/readme.md15
-rw-r--r--examples/todomvc/src/main/web/package-lock.json16
-rw-r--r--examples/todomvc/src/main/web/package.json7
-rw-r--r--examples/todomvc/src/test/kotlin/test/com/example/TestUtil.kt32
-rw-r--r--examples/todomvc/webpack.config.d/bootstrap.js4
-rw-r--r--examples/todomvc/webpack.config.d/css.js2
-rw-r--r--examples/todomvc/webpack.config.d/dce.js2
-rw-r--r--examples/todomvc/webpack.config.d/file.js6
-rw-r--r--examples/todomvc/webpack.config.d/jquery.js4
-rw-r--r--examples/todomvc/webpack.config.d/minify.js4
83 files changed, 0 insertions, 4331 deletions
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
--- a/examples/helloworld/gradle/wrapper/gradle-wrapper.jar
+++ /dev/null
Binary files 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 li