-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Kotlin DSL in appengine/ktor sample, bump versions
- Loading branch information
Showing
4 changed files
with
71 additions
and
51 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
plugins { | ||
kotlin("jvm") version "1.4.20" | ||
war | ||
id("com.google.cloud.tools.appengine") version "2.4.1" | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
// kotlinx-html-jvm is not available in mavenCentral yet | ||
// See https://github.com/Kotlin/kotlinx.html/issues/173 | ||
jcenter { | ||
content { | ||
includeModule("org.jetbrains.kotlinx", "kotlinx-html-jvm") | ||
} | ||
} | ||
} | ||
|
||
require (JavaVersion.current() <= JavaVersion.VERSION_11) { | ||
"AppEngine supports only Java 8 or 11 for now, the current Java is ${JavaVersion.current()}" | ||
} | ||
|
||
dependencies { | ||
implementation(platform("io.ktor:ktor-bom:1.5.1")) | ||
implementation("io.ktor:ktor-server-servlet") | ||
implementation("io.ktor:ktor-html-builder") | ||
implementation("com.google.cloud:google-cloud-logging-logback:0.117.0-alpha") | ||
|
||
runtimeOnly("com.google.appengine:appengine:1.9.86") | ||
} | ||
|
||
appengine { | ||
deploy { | ||
projectId = "GCLOUD_CONFIG" | ||
version = "GCLOUD_CONFIG" | ||
} | ||
} | ||
|
||
tasks { | ||
withType<JavaCompile>().configureEach { | ||
options.encoding = "UTF-8" | ||
} | ||
|
||
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach { | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
} | ||
|
||
register("run") { | ||
dependsOn("appengineRun") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
org.gradle.parallel=true | ||
|
||
kotlin.code.style=official | ||
kotlin.parallel.tasks.in.project=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
pluginManagement { | ||
// resolutionStrategy enables using plugins { id("com.google.cloud.tools.appengine") } syntax | ||
// It won't be needed when the plugin publishes | ||
// com.google.cloud.tools.appengine:com.google.cloud.tools.appengine.gradle.plugin | ||
// artifact to Sonatype OSSRH | ||
resolutionStrategy { | ||
eachPlugin { | ||
if (requested.id.id == "com.google.cloud.tools.appengine") { | ||
useModule("com.google.cloud.tools:appengine-gradle-plugin:${requested.version}") | ||
} | ||
} | ||
} | ||
} | ||
|
||
rootProject.name = "appengine-ktor" |