Hank
08/06/2020, 7:17 AMbuildscript {
repositories {
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.google.cloud.tools:appengine-gradle-plugin:$appengine_plugin_version"
}
}
apply plugin: 'kotlin'
apply plugin: 'war'
apply plugin: 'application'
apply plugin: 'com.google.cloud.tools.appengine'
appengine.deploy.projectId = 'GCLOUD_CONFIG'
appengine.deploy.version = 'GCLOUD_CONFIG'
group 'dev.hankli'
version '1.0.0'
mainClassName = "io.ktor.server.netty.EngineMain"
sourceSets {
main.kotlin.srcDirs = main.java.srcDirs = ['src']
test.kotlin.srcDirs = test.java.srcDirs = ['test']
main.resources.srcDirs = ['resources']
test.resources.srcDirs = ['testresources']
}
webAppDirName = 'webapp'
repositories {
mavenLocal()
jcenter()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "io.ktor:ktor-server-netty:$ktor_version"
implementation "ch.qos.logback:logback-classic:$logback_version"
implementation "io.ktor:ktor-server-core:$ktor_version"
implementation "io.ktor:ktor-locations:$ktor_version"
implementation "io.ktor:ktor-server-sessions:$ktor_version"
implementation "io.ktor:ktor-auth:$ktor_version"
implementation "io.ktor:ktor-auth-jwt:$ktor_version"
implementation "io.ktor:ktor-gson:$ktor_version"
implementation 'com.google.firebase:firebase-admin:6.14.0'
implementation "com.desmondtzq.ktor:ktor-auth-firebase:1.0.1"
testImplementation "io.ktor:ktor-server-tests:$ktor_version"
implementation "org.jetbrains.exposed:exposed-core:$exposed_version"
implementation "org.jetbrains.exposed:exposed-dao:$exposed_version"
implementation "org.jetbrains.exposed:exposed-jdbc:$exposed_version"
implementation "org.jetbrains.exposed:exposed-jodatime:$exposed_version"
implementation "org.postgresql:postgresql:$postgres_version"
implementation "com.zaxxer:HikariCP:$hikaricp_version"
providedCompile "com.google.appengine:appengine:$appengine_version"
}
task run(dependsOn: appengineRun) // Could not get unknown property 'appengineRun' for root project
And I’ve tried to use the Cloud Code plugin in IntelliJ IDE to run my code and there was an error that showed “Please first confirm that there is a properly placed appengine-web.xml file”, even though I’ve set the directions.
Is anyone can help me out or give me some suggestions, really appreciate.🙏Jeff
08/07/2020, 6:37 AMappengine.deploy.projectId = 'GCLOUD_CONFIG'
appengine.deploy.version = 'GCLOUD_CONFIG'
You are now going to setup the configuration for appengine differently as documented on https://cloud.google.com/appengine/docs/standard/java/tools/gradle-reference
So now replace:
task run(dependsOn: appengineRun)
with this piece of code at the bottom of your build.gradle:
appengine { // App Engine tasks configuration
deploy { // deploy configuration
version = "GCLOUD_CONFIG"
projectId = "GCLOUD_CONFIG"
stopPreviousVersion = true // default - stop the current version
promote = true // default - & make this the current version
}
}
Cheers 🙂
Let me know if it works for you.MBegemot
08/07/2020, 4:30 PMHank
08/08/2020, 1:03 AM