From 0e2a507d1ab3aa876a2c62788b0b9591b8c3259b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp=20=28TWiStErRob=29?= Date: Sat, 15 Feb 2020 02:40:50 +0000 Subject: [PATCH] Split out :di-kodein-advanced from :di-kodein --- other/di-kodein-advanced/README.md | 13 +++++++ other/di-kodein-advanced/build.gradle | 37 +++++++++++++++++++ .../src/KodeinAdvancedApplication.kt | 0 other/di-kodein/build.gradle | 3 -- settings.gradle | 1 + 5 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 other/di-kodein-advanced/README.md create mode 100644 other/di-kodein-advanced/build.gradle rename other/{di-kodein => di-kodein-advanced}/src/KodeinAdvancedApplication.kt (100%) diff --git a/other/di-kodein-advanced/README.md b/other/di-kodein-advanced/README.md new file mode 100644 index 00000000..eb360b4b --- /dev/null +++ b/other/di-kodein-advanced/README.md @@ -0,0 +1,13 @@ +# Kodein-DI + +Sample project for [Ktor](https://ktor.io) showing how to use [Kodein DI](https://kodein.org/Kodein-DI/) within Ktor. + +## Running + +Execute this command in the repository's root directory to run this sample: + +```bash +./gradlew :di-kodein-advanced:run +``` + +And navigate to [http://localhost:8080/](http://localhost:8080/) to see the sample home page. diff --git a/other/di-kodein-advanced/build.gradle b/other/di-kodein-advanced/build.gradle new file mode 100644 index 00000000..685f56b9 --- /dev/null +++ b/other/di-kodein-advanced/build.gradle @@ -0,0 +1,37 @@ +buildscript { + repositories { + jcenter() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' +apply plugin: 'application' + +mainClassName = "io.ktor.samples.kodein.KodeinAdvancedApplicationKt" + +sourceSets { + main.kotlin.srcDirs = [ 'src' ] + test.kotlin.srcDirs = [ 'test' ] + main.resources.srcDirs = [ 'resources' ] +} + +repositories { + jcenter() + maven { url "https://dl.bintray.com/kotlin/ktor" } +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + compile "io.ktor:ktor-server-netty:$ktor_version" + compile "ch.qos.logback:logback-classic:$logback_version" + + compile "io.ktor:ktor-html-builder:$ktor_version" + compile "io.ktor:ktor-locations:$ktor_version" + + compile 'org.kodein.di:kodein-di-generic-jvm:5.2.0' + + testCompile "io.ktor:ktor-server-test-host:$ktor_version" +} diff --git a/other/di-kodein/src/KodeinAdvancedApplication.kt b/other/di-kodein-advanced/src/KodeinAdvancedApplication.kt similarity index 100% rename from other/di-kodein/src/KodeinAdvancedApplication.kt rename to other/di-kodein-advanced/src/KodeinAdvancedApplication.kt diff --git a/other/di-kodein/build.gradle b/other/di-kodein/build.gradle index 8cfda9ad..ade6cb13 100644 --- a/other/di-kodein/build.gradle +++ b/other/di-kodein/build.gradle @@ -28,9 +28,6 @@ dependencies { compile "io.ktor:ktor-server-netty:$ktor_version" compile "ch.qos.logback:logback-classic:$logback_version" - compile "io.ktor:ktor-html-builder:$ktor_version" - compile "io.ktor:ktor-locations:$ktor_version" - compile 'org.kodein.di:kodein-di-generic-jvm:5.2.0' testCompile "io.ktor:ktor-server-test-host:$ktor_version" diff --git a/settings.gradle b/settings.gradle index a88f2d6a..b9b1a8e1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -54,6 +54,7 @@ module('other', 'structured-logging') module('other', 'client-multipart') module('other', 'client-tools') module('other', 'di-kodein') +module('other', 'di-kodein-advanced') module('other', 'reverse-proxy') module('other', 'reverse-proxy-ws') module('other', 'redirect-with-exception')