Skip to content
Permalink
Browse files

Bump to kotlin 1.3.10

  • Loading branch information...
Jonathan Estrella
Jonathan Estrella committed Jan 7, 2019
1 parent 6b49f07 commit ac96db4dfba12edfbbe0f95bb8e4eb45f24dc0bf
@@ -1,5 +1,5 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.51" apply false
id "org.jetbrains.kotlin.jvm" version "1.3.11" apply false
id "com.vanniktech.maven.publish" version "0.4.0" apply false
}

@@ -52,13 +52,13 @@ subprojects {
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
// TODO(jayestrella): re-add allWarningsAsErrors = true when we (+okio) bump kotlin versions
allWarningsAsErrors = true
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
// TODO(jayestrella): re-add allWarningsAsErrors = true when we (+okio) bump kotlin versions
allWarningsAsErrors = true
}
}
sourceSets {
@@ -39,11 +39,11 @@ ext.dep = [
"junitApi": "org.junit.jupiter:junit-jupiter-api:5.3.1",
"junitEngine": "org.junit.jupiter:junit-jupiter-engine:5.3.1",
"junitParams": "org.junit.jupiter:junit-jupiter-params:5.3.1",
"kotlinNoArgPlugin": "org.jetbrains.kotlin:kotlin-noarg:1.2.51",
"kotlinReflection": "org.jetbrains.kotlin:kotlin-reflect:1.2.51",
"kotlinStdLib": "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.51",
"kotlinTest": "org.jetbrains.kotlin:kotlin-test:1.2.51",
"kotlinxCoroutines": "org.jetbrains.kotlinx:kotlinx-coroutines-core:0.24.0",
"kotlinNoArgPlugin": "org.jetbrains.kotlin:kotlin-noarg:1.3.11",
"kotlinReflection": "org.jetbrains.kotlin:kotlin-reflect:1.3.11",
"kotlinStdLib": "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.11",
"kotlinTest": "org.jetbrains.kotlin:kotlin-test:1.3.11",
"kotlinxCoroutines": "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.0",
"kubernetesClient": "io.kubernetes:client-java:1.0.0",
"logbackClassic": "ch.qos.logback:logback-classic:1.2.3",
"logbackJsonCore": "ch.qos.logback.contrib:logback-json-core:0.1.5",
@@ -51,7 +51,7 @@ public class GidGenerator : AbstractPostInsertGenerator(), Configurable {

init {
require(persister is SingleTableEntityPersister) { "Single table entities supported only" }
this.persister = persister as SingleTableEntityPersister
this.persister = persister
}

override fun prepareIdentifierGeneratingInsert(): IdentifierGeneratingInsert {
@@ -14,7 +14,6 @@ import misk.jdbc.PingDatabaseService
import misk.resources.ResourceLoader
import misk.vitess.StartVitessService
import org.hibernate.SessionFactory
import org.hibernate.boot.Metadata
import org.hibernate.event.spi.EventType
import javax.inject.Inject
import javax.inject.Provider
@@ -143,7 +143,7 @@ class DockerVitessCluster(

val schemaVolume = Volume("/vt/src/vitess.io/vitess/schema")
val httpPort = ExposedPort.tcp(cluster.httpPort)
if (cluster.config.port != null && cluster.config.port != cluster.grpcPort) {
if (cluster.config.port != cluster.grpcPort) {
throw RuntimeException(
"Config port ${cluster.config.port} has to match Vitess Docker container: ${cluster.grpcPort}")
}
@@ -224,7 +224,7 @@ class MergingDigest(private val compression: Double) {
* approximately equal to quantile. Returns NaN if the digest is empty.
*/
fun quantile(quantile: Double): Double {
require(quantile in 0..1) {
require(quantile in 0.toDouble().rangeTo(1.toDouble())) {
"quantile out of bounds"
}
mergeAllTemps()
@@ -6,7 +6,6 @@ import org.apache.curator.framework.CuratorFrameworkFactory
import org.apache.curator.retry.ExponentialBackoffRetry
import javax.inject.Inject
import javax.inject.Provider
import javax.inject.Singleton

internal class CuratorFrameworkProvider @Inject internal constructor(
private val config: ZookeeperConfig
@@ -5,13 +5,10 @@ import com.google.common.util.concurrent.Service
import com.google.inject.Key
import misk.DependentService
import misk.clustering.fake.FakeClusterModule
import misk.clustering.lease.LeaseManager
import misk.config.AppName
import misk.inject.KAbstractModule
import misk.inject.asSingleton
import misk.inject.keyOf
import misk.logging.getLogger
import org.apache.curator.framework.CuratorFramework
import javax.inject.Singleton

internal class ZkTestModule : KAbstractModule() {
@@ -1,8 +1,3 @@
kotlin {
experimental {
coroutines 'enable'
}
}
apply from: rootProject.file("gradle/localdb.gradle")
apply from: "https://raw.githubusercontent.com/square/misk-web/master/gradle/web.gradle"

@@ -4,7 +4,6 @@ import misk.security.ssl.SslContextFactory
import misk.security.ssl.SslLoader
import okhttp3.OkHttpClient
import okhttp3.Protocol
import java.net.Proxy
import java.util.concurrent.TimeUnit
import javax.inject.Inject
import javax.inject.Singleton
@@ -3,7 +3,7 @@ package misk.okio
import okio.Buffer
import okio.BufferedSource
import okio.ByteString
import kotlin.coroutines.experimental.buildSequence
import kotlin.sequences.sequence

fun BufferedSource.forEachBlock(buffer: ByteArray, f: (buffer: ByteArray, bytesRead: Int) -> Unit) {
var bytesRead = read(buffer)
@@ -19,7 +19,7 @@ fun BufferedSource.forEachBlock(blockSize: Int, f: (buffer: ByteArray, bytesRead

fun BufferedSource.split(separator: ByteString): Sequence<Buffer> {
val source = this
return buildSequence {
return sequence {
while (true) {
val indexOf = indexOf(separator)
if (indexOf >= 0) {
@@ -2,7 +2,6 @@ package misk.resources

import com.google.inject.multibindings.MapBinder
import misk.inject.KAbstractModule
import misk.inject.asSingleton

class ResourceLoaderModule : KAbstractModule() {
override fun configure() {
@@ -46,7 +46,7 @@ object MediaTypes {
}
}

fun String.asMediaType() = MediaType.get(this)!!
fun String.asMediaType() = MediaType.get(this)
fun String.asMediaRange() = MediaRange.parse(this)

internal val MediaType.wildcardCount
@@ -129,7 +129,7 @@ class StaticResourceAction @Inject constructor(
return Response(
body = "".toResponseBody(),
statusCode = HttpURLConnection.HTTP_MOVED_TEMP,
headers = Headers.of("Location", "$urlPath"))
headers = Headers.of("Location", urlPath))
}
}
}
@@ -21,7 +21,7 @@ class MockWebServerService(val unixSocketFile: String?) : AbstractIdleService()
}

override fun shutDown() {
server?.let { it.shutdown() }
server?.shutdown()
file.delete()
}
}
@@ -3,7 +3,6 @@ package misk.config
import com.google.inject.util.Modules
import misk.environment.Environment
import misk.environment.EnvironmentModule
import misk.inject.KAbstractModule
import misk.testing.MiskTest
import misk.testing.MiskTestModule
import org.assertj.core.api.Assertions.assertThat
@@ -1,7 +1,6 @@
package misk.resources

import com.google.inject.util.Modules
import misk.MiskTestingServiceModule
import misk.testing.MiskTest
import misk.testing.MiskTestModule
import misk.testing.TemporaryFolder
@@ -107,6 +107,6 @@ internal class QueryStringRequestTest {
val httpClient = OkHttpClient()
val response = httpClient.newCall(request.build()).execute()
assertThat(response.code()).isEqualTo(200)
return response.body()!!.source()!!.readUtf8()
return response.body()!!.source().readUtf8()
}
}
@@ -1,7 +1,8 @@
package misk.web.proxy

import kotlinx.coroutines.experimental.async
import kotlinx.coroutines.experimental.runBlocking
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.async
import kotlinx.coroutines.runBlocking
import misk.inject.KAbstractModule
import misk.testing.MiskTest
import misk.testing.MiskTestModule
@@ -111,7 +112,7 @@ class WebProxyActionTest {
.addHeader("UpstreamHeader", "UpstreamHeaderValue")
.setBody("I am an intercepted response!"))

val responseAsync = async {
val responseAsync = GlobalScope.async {
optionalBinder.proxyClient.newCall(
get("/local/prefix/tacos/", weirdMediaType)).execute().toMisk()
}
@@ -138,7 +139,7 @@ class WebProxyActionTest {
.setBody("I am an intercepted response!"))

val responseAsync =
async {
GlobalScope.async {
optionalBinder.proxyClient.newCall(get("/local/prefix/tacos", weirdMediaType)).execute()
.toMisk()
}
@@ -172,7 +173,7 @@ class WebProxyActionTest {
.addHeader("UpstreamHeader", "UpstreamHeaderValue")
.setBody("I am an intercepted response!"))

val response = async {
val response = GlobalScope.async {
optionalBinder.proxyClient.newCall(
post("/local/prefix/tacos/", weirdMediaType, "my taco", weirdMediaType)).execute()
.toMisk()
@@ -199,7 +200,7 @@ class WebProxyActionTest {
.addHeader("UpstreamHeader", "UpstreamHeaderValue")
.setBody("I am an intercepted response!"))

val response = async {
val response = GlobalScope.async {
optionalBinder.proxyClient.newCall(
post("/local/prefix/tacos", weirdMediaType, "my taco", weirdMediaType)).execute().toMisk()
}
@@ -256,7 +257,7 @@ class WebProxyActionTest {
.addHeader("UpstreamHeader", "UpstreamHeaderValue")
.setBody("I am an intercepted response!"))

val responseAsync = async {
val responseAsync = GlobalScope.async {
optionalBinder.proxyClient.newCall(
get("/local/prefix/tacos/another/long/prefix/see/if/forwards/", weirdMediaType)).execute()
.toMisk()
@@ -284,7 +285,7 @@ class WebProxyActionTest {
.addHeader("UpstreamHeader", "UpstreamHeaderValue")
.setBody("I am an intercepted response!"))

val responseAsync = async {
val responseAsync = GlobalScope.async {
optionalBinder.proxyClient.newCall(
get("/local/prefix/tacos////see/if/forwards/", weirdMediaType)).execute().toMisk()
}
@@ -310,7 +311,7 @@ class WebProxyActionTest {
.addHeader("UpstreamHeader", "UpstreamHeaderValue")
.setBody("I am an intercepted response!"))

val responseAsync = async {
val responseAsync = GlobalScope.async {
optionalBinder.proxyClient.newCall(
get("/local/prefix/tacos/.test/.config/.ssh/see/if/forwards/", weirdMediaType)).execute()
.toMisk()
@@ -2,7 +2,6 @@ package com.squareup.exemplar

import misk.MiskApplication
import misk.MiskRealServiceModule
import misk.MiskTestingServiceModule
import misk.config.ConfigModule
import misk.config.MiskConfig
import misk.environment.Environment
@@ -2,7 +2,6 @@ package com.squareup.chat

import misk.MiskApplication
import misk.MiskRealServiceModule
import misk.MiskTestingServiceModule
import misk.config.ConfigModule
import misk.config.MiskConfig
import misk.environment.Environment

0 comments on commit ac96db4

Please sign in to comment.
You can’t perform that action at this time.