Skip to content

Commit

Permalink
use gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-byrne committed Mar 5, 2019
1 parent 148ef25 commit 2fcf8f8
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 183 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
target/
build/
out/
.gradle
.idea/
*.iml
.DS_Store
9 changes: 9 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
plugins {
base
kotlin("jvm") version "1.3.21"
}

allprojects {
group = "io.mfj"
version = "1.0-SNAPSHOT"
}
9 changes: 9 additions & 0 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
plugins {
kotlin("jvm")
}

dependencies {
implementation(kotlin("stdlib-jdk8"))
compile("org.slf4j:slf4j-api:1.7.21")
compile("org.slf4j:slf4j-simple:1.7.21")
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package io.mfj.kotlinnight.library.web

import io.mfj.kotlinnight.library.*
package io.mfj.kotlinnight.library

import java.time.LocalDate

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package io.mfj.kotlinnight.library.web

import io.mfj.kotlinnight.library.*
package io.mfj.kotlinnight.library

import kotlin.concurrent.thread

Expand Down
170 changes: 0 additions & 170 deletions pom.xml

This file was deleted.

4 changes: 4 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
rootProject.name = "kotlinnight"
include("common")
include("web-javalin")
include("web-ktor")
13 changes: 13 additions & 0 deletions web-javalin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
plugins {
application
kotlin("jvm")
}

dependencies {
implementation(kotlin("stdlib-jdk8"))
compile(project(":common"))
compile("org.slf4j:slf4j-api:1.7.21")
compile("org.slf4j:slf4j-simple:1.7.21")
compile("io.javalin:javalin:2.6.0")
compile("com.fasterxml.jackson.module:jackson-module-kotlin:2.9.8")
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.mfj.kotlinnight.library.web.javalin

import io.mfj.kotlinnight.library.web.Inventory
import io.mfj.kotlinnight.library.web.InventoryImpl
import io.mfj.kotlinnight.library.*

import java.time.LocalDate

Expand Down
File renamed without changes.
15 changes: 15 additions & 0 deletions web-ktor/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
plugins {
application
kotlin("jvm")
}

dependencies {
implementation(kotlin("stdlib-jdk8"))
compile(project(":common"))
compile("org.slf4j:slf4j-api:1.7.21")
compile("org.slf4j:slf4j-simple:1.7.21")
compile("com.fasterxml.jackson.module:jackson-module-kotlin:2.9.8")
compile("io.ktor:ktor-server-core:1.1.2")
compile("io.ktor:ktor-server-jetty:1.1.2")
compile("io.ktor:ktor-jackson:1.1.2")
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.mfj.kotlinnight.library.web.ktor

import io.mfj.kotlinnight.library.Checkout
import io.mfj.kotlinnight.library.*

import io.ktor.application.ApplicationCall
import io.ktor.application.call
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package io.mfj.kotlinnight.library.web.ktor

import io.mfj.kotlinnight.library.web.Inventory
import io.mfj.kotlinnight.library.web.InventoryImpl
import io.mfj.kotlinnight.library.*

import java.time.LocalDate

import io.ktor.application.*
import io.ktor.features.*
import io.ktor.http.content.*
import io.ktor.jackson.jackson
import io.ktor.response.*
import io.ktor.routing.*
Expand Down Expand Up @@ -38,6 +38,11 @@ object KtorApp {

routing {

static("/") {
staticBasePackage = "static"
defaultResource("index.html")
}

get("/title/") {
call.respond( inventory.getTitles() )
}
Expand Down Expand Up @@ -78,7 +83,7 @@ object KtorApp {
put("/checkin", Controller.checkin)
}

}
}.start(wait=true)

}
}
Expand Down
5 changes: 5 additions & 0 deletions web-ktor/src/main/resources/static/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<html>
<body>
<p>Hello world!</p>
</body>
</html>

0 comments on commit 2fcf8f8

Please sign in to comment.