use shadow

This commit is contained in:
Torma Kristóf 2020-10-22 00:12:27 +02:00
parent 0106b94e8f
commit f6a8ac9aaf
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047
2 changed files with 29 additions and 9 deletions

View File

@ -2,13 +2,27 @@ buildscript {
repositories { repositories {
jcenter() jcenter()
} }
mavenCentral()
maven {
url = uri("https://repo.eclipse.org/content/repositories/paho-releases/")
}
maven {
url = uri("https://plugins.gradle.org/m2/")
}
dependencies { dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.github.jengelman.gradle.plugins:shadow:5.2.0"
} }
} }
tasks.withType(JavaCompile) {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
apply plugin: 'kotlin' apply plugin: 'kotlin'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'application' apply plugin: 'application'
group 'com.kmlabz.k8s' group 'com.kmlabz.k8s'
@ -17,9 +31,7 @@ mainClassName = "io.ktor.server.jetty.EngineMain"
sourceSets { sourceSets {
main.kotlin.srcDirs = main.java.srcDirs = ['src'] main.kotlin.srcDirs = main.java.srcDirs = ['src']
test.kotlin.srcDirs = test.java.srcDirs = ['test']
main.resources.srcDirs = ['resources'] main.resources.srcDirs = ['resources']
test.resources.srcDirs = ['testresources']
} }
repositories { repositories {
@ -38,5 +50,19 @@ dependencies {
implementation "io.ktor:ktor-client-jetty:$ktor_version" implementation "io.ktor:ktor-client-jetty:$ktor_version"
implementation "io.ktor:ktor-client-json-jvm:$ktor_version" implementation "io.ktor:ktor-client-json-jvm:$ktor_version"
implementation "io.ktor:ktor-client-gson:$ktor_version" implementation "io.ktor:ktor-client-gson:$ktor_version"
testImplementation "io.ktor:ktor-server-tests:$ktor_version" implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5'
} }
kotlin.experimental.coroutines = 'enable'
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "11"
}
}
shadowJar {
baseName = 'mqtt-benchmark-component'
classifier = null
version = null
}

View File

@ -2,21 +2,15 @@ package com.kmlabz.k8s
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.GsonBuilder import com.google.gson.GsonBuilder
import com.google.gson.internal.GsonBuildConfig
import io.ktor.application.* import io.ktor.application.*
import io.ktor.response.*
import io.ktor.request.*
import io.ktor.client.* import io.ktor.client.*
import io.ktor.client.engine.jetty.* import io.ktor.client.engine.jetty.*
import io.ktor.client.features.json.* import io.ktor.client.features.json.*
import io.ktor.client.request.* import io.ktor.client.request.*
import io.ktor.client.request.forms.* import io.ktor.client.request.forms.*
import io.ktor.client.statement.*
import io.ktor.http.* import io.ktor.http.*
import io.ktor.http.ContentDisposition.Companion.File
import io.ktor.http.content.* import io.ktor.http.content.*
import io.ktor.util.* import io.ktor.util.*
import io.ktor.utils.io.streams.*
import kotlinx.coroutines.* import kotlinx.coroutines.*
import java.io.File import java.io.File