Skip to content

Commit

Permalink
Update build tools
Browse files Browse the repository at this point in the history
* Gradle 4.8
* Android Gradle plugin 3.1.3
* Ktlint Gradle plugin 4.0.0
* Ktlint 0.23.1
  • Loading branch information
Aaron He committed Jun 16, 2018
1 parent a0960c7 commit 8fe7577
Show file tree
Hide file tree
Showing 78 changed files with 26 additions and 102 deletions.
16 changes: 5 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.5.4"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}"
Expand All @@ -18,28 +18,22 @@ buildscript {
}

plugins {
id 'org.jlleitschuh.gradle.ktlint' version '2.2.0'
id 'org.jlleitschuh.gradle.ktlint' version '4.0.0'
}

ktlint {
version = '0.9.2'
version = '0.23.1'
}

allprojects {
subprojects {
apply plugin: 'org.kordamp.gradle.stats'
apply plugin: "com.jfrog.artifactory"
group = 'com.tinder.scarlet'

repositories {
mavenCentral()
maven { url "https://jitpack.io" }
google()
jcenter()
}
}

clean {
delete rootProject.buildDir
}

apply from: rootProject.file('dependencies.gradle')
apply from: rootProject.file('dependencies.gradle')
3 changes: 1 addition & 2 deletions demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

repositories {
mavenCentral()
google()
maven { url 'https://jitpack.io' }
}

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ class AuthStatusRepository @Inject constructor() {
fun observeAuthStatus(): Flowable<AuthStatus> = authStatusProcessor

fun updateAuthStatus(authStatus: AuthStatus) = authStatusProcessor.onNext(authStatus)

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ class LoggedInLifecycle constructor(
}
.subscribe(lifecycleRegistry)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,4 @@ interface EchoBotComponent {
interface ComponentProvider {
val echoBotComponent: EchoBotComponent
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ class TransactionBook(
newHistory.transactions[product] = (newHistory.transactions[product] ?: emptyList()) + transaction
return newHistory
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,4 @@ class TransactionRepository @Inject constructor(
transactionBookRef.set(transactionBook)
transactionBookProcessor.onNext(transactionBook)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,4 @@ interface GdaxComponent {
interface ComponentProvider {
val gdaxComponent: GdaxComponent
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ import com.tinder.app.gdax.domain.Transaction
interface GdaxTarget {

fun showTransactions(product: Product, transactions: List<Transaction>)

}
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,4 @@ class ScarletDemoApplication : Application(),
Timber.plant(Timber.DebugTree())
Stetho.initialize(stethoInitializer)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ class CommonModule {
fun provideApplicationContext(application: Application): Context {
return application
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,4 @@ class StethoModule {
internal fun provideInspectorModulesProvider(application: Application): InspectorModulesProvider {
return Stetho.defaultInspectorModulesProvider(application)
}

}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,4 @@ internal class FlowableStreamTest {
// Then
assertThat(processor.hasSubscribers()).isFalse()
}

}
1 change: 0 additions & 1 deletion scarlet-core/src/main/java/com/tinder/scarlet/Lifecycle.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,3 @@ interface Lifecycle : Publisher<Lifecycle.State> {
object Destroyed : State()
}
}

1 change: 0 additions & 1 deletion scarlet-core/src/main/java/com/tinder/scarlet/Stream.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,4 @@ interface Stream<T> : Publisher<T> {

fun isDisposed(): Boolean
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,5 @@ interface StreamAdapter<T, out R> {
* handled by this factory.
*/
fun create(type: Type): StreamAdapter<Any, Any>

}
}
1 change: 0 additions & 1 deletion scarlet-core/src/main/java/com/tinder/scarlet/WebSocket.kt
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,4 @@ interface WebSocket {
interface Factory {
fun create(): WebSocket
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ internal class TypeUtilsTest {
private fun param(type: Type, expectedHasUnresolvableType: Boolean) =
arrayOf(type, expectedHasUnresolvableType)
}

}

@RunWith(Parameterized::class)
Expand Down Expand Up @@ -102,7 +101,6 @@ internal class TypeUtilsTest {
private fun param(type: ParameterizedType, expectedParameterUpperBound: Array<Type>) =
arrayOf(type, expectedParameterUpperBound)
}

}

private companion object {
Expand Down Expand Up @@ -146,5 +144,4 @@ internal class TypeUtilsTest {
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ class BuiltInMessageAdapterFactory : MessageAdapter.Factory {
ByteArray::class.java -> ByteArrayMessageAdapter()
else -> throw IllegalArgumentException("Type is not supported by this MessageAdapterFactory: $type")
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ class ByteArrayMessageAdapter : MessageAdapter<ByteArray> {
}

override fun toMessage(data: ByteArray): Message = Message.Bytes(data)

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ class TextMessageAdapter : MessageAdapter<String> {
}

override fun toMessage(data: String): Message = Message.Text(data)

}
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,4 @@ internal class BuiltInMessageAdapterFactoryTest {
Collection::class.java
)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@ internal class ByteArrayMessageAdapterTest {
val (adaptedBytes) = (adaptedMessage as Message.Bytes)
assertThat(adaptedBytes).isEqualTo(bytes)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@ internal class TextMessageAdapterTest {
// Then
assertThat(adaptedMessage).isEqualTo(textMessage)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,4 @@ class GsonMessageAdapter<T> private constructor(
private val DEFAULT_GSON = Gson()
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ import com.google.gson.TypeAdapter
import com.google.gson.stream.JsonReader
import com.google.gson.stream.JsonToken
import com.google.gson.stream.JsonWriter
import com.tinder.scarlet.WebSocket.Event
import com.tinder.scarlet.Lifecycle
import com.tinder.scarlet.Message
import com.tinder.scarlet.MessageAdapter
import com.tinder.scarlet.Scarlet
import com.tinder.scarlet.Stream
import com.tinder.scarlet.Lifecycle
import com.tinder.scarlet.WebSocket.Event
import com.tinder.scarlet.lifecycle.LifecycleRegistry
import com.tinder.scarlet.testutils.TestStreamObserver
import com.tinder.scarlet.testutils.any
import com.tinder.scarlet.testutils.containingText
import com.tinder.scarlet.testutils.test
import com.tinder.scarlet.testutils.any
import com.tinder.scarlet.websocket.mockwebserver.newWebSocketFactory
import com.tinder.scarlet.websocket.okhttp.newWebSocketFactory
import com.tinder.scarlet.ws.Receive
Expand Down Expand Up @@ -225,7 +225,6 @@ internal class GsonMessageAdapterTest {
else -> throw IllegalArgumentException("$type is not supported.")
}
}

}

internal interface Service {
Expand All @@ -244,7 +243,5 @@ internal class GsonMessageAdapterTest {
@Send
fun sendAnInterface(impl: AnInterface): Boolean
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ class MoshiMessageAdapter<T> private constructor(
val serializeNull: Boolean = false,
val failOnUnknown: Boolean = false
)

}

private companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ internal class MoshiMessageAdapterTest {

class VerifyJsonQualifierJsonAdapterFactory : JsonAdapter.Factory {
override fun create(
type: Type, annotations: Set<Annotation>,
type: Type,
annotations: Set<Annotation>,
moshi: Moshi
): JsonAdapter<*>? {
for (annotation in annotations) {
Expand Down Expand Up @@ -381,7 +382,5 @@ internal class MoshiMessageAdapterTest {
@NonQualifer
fun observeAnnotatedString(): Stream<String>
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,5 @@ internal class ProtobufMessageAdapterTest {
@Receive
fun receiveWrongClassDeserialization(): Stream<Deserialization<String>>
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ class BuiltInStreamAdapterFactory : StreamAdapter.Factory {
Stream::class.java -> IdentityStreamAdapter()
else -> throw IllegalArgumentException("$type is not supported.")
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ import com.tinder.scarlet.StreamAdapter
class IdentityStreamAdapter<T> : StreamAdapter<T, Stream<T>> {

override fun adapt(stream: Stream<T>): Stream<T> = stream

}
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,4 @@ internal class BuiltInStreamAdapterFactoryTest {
Collection::class.java
)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ internal class IdentityStreamAdapterTest {
// Then
assertThat(adaptedStream).isSameAs(stream)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@ class ObservableStreamAdapter<T> : StreamAdapter<T, Observable<T>> {
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ class RxJavaStreamAdapterFactory : StreamAdapter.Factory {
Observable::class.java -> ObservableStreamAdapter()
else -> throw IllegalArgumentException()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ import io.reactivex.Flowable
class FlowableStreamAdapter<T> : StreamAdapter<T, Flowable<T>> {

override fun adapt(stream: Stream<T>): Flowable<T> = Flowable.fromPublisher(stream)

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ import io.reactivex.Observable
class ObservableStreamAdapter<T> : StreamAdapter<T, Observable<T>> {

override fun adapt(stream: Stream<T>): Observable<T> = Observable.fromPublisher(stream)

}
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,4 @@ class ObservableTest {
@Send
fun sendBytesAndConfirm(message: ByteArray): Boolean
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ class MockWebServerOkHttpWebSocketConnectionEstablisher(
override fun establishConnection(webSocketListener: WebSocketListener) {
mockWebServer.enqueue(MockResponse().withWebSocketUpgrade(webSocketListener))
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ import okhttp3.mockwebserver.MockWebServer

fun MockWebServer.newWebSocketFactory(): WebSocket.Factory =
OkHttpWebSocket.Factory(MockWebServerOkHttpWebSocketConnectionEstablisher(this))

Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ class OkHttpClientWebSocketConnectionEstablisher(
val request = requestFactory.createRequest()
okHttpClient.newWebSocket(request, webSocketListener)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@ internal class OkHttpWebSocketEventObserver : WebSocketListener() {

override fun onFailure(webSocket: okhttp3.WebSocket, t: Throwable, response: Response?) =
processor.onNext(WebSocket.Event.OnConnectionFailed(t))

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ internal class StaticUrlRequestFactory(
override fun createRequest(): Request = Request.Builder()
.url(url)
.build()

}
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,4 @@ internal class OkHttpWebSocketEventObserverTest {
WebSocket.Event.OnConnectionFailed(throwable)
)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -233,5 +233,4 @@ internal class OkHttpWebSocketIntegrationTest {
@Send
fun sendBytesAndConfirm(message: ByteArray): Boolean
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,4 @@ internal class OkHttpWebSocketTest {
// Then
then(webSocketHolder).should().cancel()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ internal class StaticUrlRequestFactoryTest {
// Then
assertThat(request1.url()).isEqualTo(request2.url())
}

}
1 change: 0 additions & 1 deletion scarlet/src/main/java/com/tinder/scarlet/Scarlet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,4 @@ class Scarlet internal constructor(
private val DEFAULT_SCHEDULER = Schedulers.computation() // TODO same thread option for debugging
}
}

}
Loading

0 comments on commit 8fe7577

Please sign in to comment.