diff options
107 files changed, 130 insertions, 4376 deletions
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 Binary files differnew file mode 100644 index 00000000..752a1311 --- /dev/null +++ b/dokka/kvision-dokka-helper.jar 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. |
