diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..fd050e36 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,21 @@ +version: 2 + +jobs: + build: + docker: + - image: circleci/android:api-27-alpha + environment: + TERM: dumb + GRADLE_OPTS: '-Dorg.gradle.jvmargs="-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap" -Dorg.gradle.parallel=false -Dorg.gradle.daemon=true' + CIRCLE_TEST_REPORTS: test-reports + resource_class: xlarge + parallelism: 4 + steps: + - checkout + - run: + name: Disable PreDexing + command: echo "disablePreDex" >> gradle.properties + - run: if [ -e ./gradlew ]; then ./gradlew dependencies;else gradle dependencies;fi + - run: ./gradlew test + - run: mkdir -p $CIRCLE_TEST_REPORTS/junit/ + - run: find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \; diff --git a/README.md b/README.md index 398c48e2..4b3bddf1 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,36 @@ Scarlet === +[![CircleCI](https://circleci.com/gh/Tinder/Scarlet.svg?style=svg)](https://circleci.com/gh/Tinder/Scarlet) +[![Release](https://jitpack.io/v/tinder/scarlet.svg)](https://jitpack.io/#tinder/scarlet) A Retrofit inspired WebSocket client for Kotlin, Java, and Android. -This README is still **WIP**. Please see the [tutorial][tutorial] for more information. - Tutorial --- - [Taming WebSocket with Scarlet][tutorial] +- [A talk][slides] at [Conference for Kotliners][kotliners] Usage --- -In this example, we are reading the realtime Bitcoin price from [Gdax WebSocket Feed][gdax-websocket-feed]. +In this example, we read the realtime Bitcoin price from [Gdax WebSocket Feed][gdax-websocket-feed]. For more information, please check out the [demo app][demo-app]. -Declare a WebSocket client using an interface. +Declare a WebSocket client using an interface: ~~~ kotlin interface GdaxService { + @Receive + fun observeOnConnectionOpenedEvent(): Flowable> @Send fun sendSubscribe(subscribe: Subscribe) @Receive fun observeTicker(): Flowable - @Receive - fun observeOnConnectionOpenedEvent(): Flowable> } -val gdaxService = scarlet.create() ~~~ -Use Scarlet to create an implementation. +Use Scarlet to create an implementation: ~~~ kotlin -val okHttpClient = OkHttpClient.Builder().build() - val scarletInstance = Scarlet.Builder() .webSocketFactory(okHttpClient.newWebSocketFactory("wss://ws-feed.gdax.com")) .addMessageAdapterFactory(MoshiMessageAdapter.Factory()) @@ -42,7 +40,9 @@ val scarletInstance = Scarlet.Builder() val gdaxService = scarletInstance.create() ~~~ -Send a `Subscribe` message upon connection open so that the server will start streaming tickers, which contain the latest price. +Send a `Subscribe` message upon connection open and the server will start streaming tickers which contain the latest price. + + ~~~ kotlin val BITCOIN_TICKER_SUBSCRIBE_MESSAGE = Subscribe( productIds = listOf("BTC-USD"), @@ -53,64 +53,72 @@ gdaxService.observeOnConnectionOpenedEvent() .subscribe({ gdaxService.sendSubscribe(BITCOIN_TICKER_SUBSCRIBE_MESSAGE) }) -~~~ -Start observing realtime tickers. -~~~ kotlin gdaxService.observeTicker() .subscribe({ ticker -> Log.d("Bitcoin price is ${ticker.price} at ${ticker.time}") }) ~~~ -### Built-in Plugins -`WebSocket.Factory` -- `OkHttpClient` -- `MockHttpServer` - -`MessageAdapter.Factory` -- moshi -- gson -- protobuf - -`StreamAdapter.Factory` -- RxJava2 -- RxJava1 +### Android +Scarlet is driven by a [StateMachine][state-machine]. -`Lifecycle` -- AndroidLifecycle + -`BackoffStrategy` -- Linear -- Exponential -- ExponentialWithJitter - -### Android -TODO: -- `AndroidLifecycle` - - -### State Machine -Scarlet is driven by a [StateMachine](https://github.com/Tinder/StateMachine). -![State Diagram](./example/scarlet-state-machine.png) +TODO Download -------- -**TODO: make the jar public** +While we are working on Bintray support, Scarlet is available via [JitPack][jitpack]. -Download [the latest JAR][latest-jar] or grab via Maven: +##### Maven: ```xml + + jitpack.io + https://jitpack.io + - com.tinder.scarlet - scarlet - 0.1.0 + com.github.tinder.scarlet + scarlet + 0.1.4 ``` -or Gradle: + +##### Gradle: ```groovy -implementation 'com.tinder.scarlet:scarlet:0.1.0' +repositories { + // ... + maven { url "https://jitpack.io" } +} + +implementation 'com.github.tinder.scarlet:scarlet:0.1.4' ``` +### Plug-in Roadmap +`WebSocket.Factory` +- [x] `OkHttpClient` +- [x] `MockHttpServer` + +`MessageAdapter.Factory` +- [x] `moshi` +- [x] `gson` +- [x] `protobuf` +- [ ] `jackson` +- [ ] `simple-xml` + +`StreamAdapter.Factory` +- [x] `RxJava2` +- [x] `RxJava1` +- [x] `Kotlin Coroutine` + +`Lifecycle` +- [x] `AndroidLifecycle` + +`BackoffStrategy` +- [x] `Linear` +- [x] `Exponential` +- [x] `ExponentialWithJitter` + Copyright --- ~~~ @@ -142,5 +150,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. [gdax-websocket-feed]: https://docs.gdax.com/#websocket-feed [latest-jar]: https://tinder.jfrog.io/tinder/webapp/#/artifacts/browse/tree/General/libs-release-local/com/tinder/scarlet/scarlet - [demo-app]: https://github.com/Tinder/Scarlet/tree/master/demo/src/main/java/com/tinder/app + [demo-app]: /demo/src/main/java/com/tinder/app [tutorial]: https://tech.gotinder.com/taming-websocket-with-scarlet/ + [slides]: https://speakerdeck.com/zhxnlai/taming-websocket-with-scarlet + [kotliners]: https://www.conferenceforkotliners.com/ + [state-machine]: https://github.com/Tinder/StateMachine + [jitpack]: https://jitpack.io/#tinder/scarlet diff --git a/build.gradle b/build.gradle index 886306d0..0b39cbdc 100644 --- a/build.gradle +++ b/build.gradle @@ -18,28 +18,23 @@ buildscript { } plugins { - id 'org.jlleitschuh.gradle.ktlint' version '2.2.0' + id 'org.jlleitschuh.gradle.ktlint' version '4.1.0' } ktlint { - version = '0.9.2' + version = '0.24.0' } -allprojects { +subprojects { apply plugin: 'org.kordamp.gradle.stats' apply plugin: "com.jfrog.artifactory" - group = 'com.tinder.scarlet' + // group = 'com.tinder.scarlet' TODO use Bintray + group = 'com.github.tinder' repositories { - mavenCentral() - maven { url "https://jitpack.io" } google() jcenter() } } -clean { - delete rootProject.buildDir -} - apply from: rootProject.file('dependencies.gradle') diff --git a/demo/build.gradle b/demo/build.gradle index 80d62a25..cad1f91e 100755 --- a/demo/build.gradle +++ b/demo/build.gradle @@ -3,8 +3,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' repositories { - mavenCentral() - google() + maven { url 'https://jitpack.io' } } android { diff --git a/demo/src/main/AndroidManifest.xml b/demo/src/main/AndroidManifest.xml index ce97b0d2..b6cadabd 100755 --- a/demo/src/main/AndroidManifest.xml +++ b/demo/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ (AuthStatus.LOGGED_IN) - fun getAuthStatus(): AuthStatus = authStatusProcessor.value + fun getAuthStatus(): AuthStatus = authStatusProcessor.value!! fun observeAuthStatus(): Flowable = authStatusProcessor fun updateAuthStatus(authStatus: AuthStatus) = authStatusProcessor.onNext(authStatus) - } diff --git a/demo/src/main/java/com/tinder/app/echo/domain/ChatMessage.kt b/demo/src/main/java/com/tinder/app/echo/domain/ChatMessage.kt index a8666989..828a616d 100644 --- a/demo/src/main/java/com/tinder/app/echo/domain/ChatMessage.kt +++ b/demo/src/main/java/com/tinder/app/echo/domain/ChatMessage.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.echo.domain diff --git a/demo/src/main/java/com/tinder/app/echo/domain/ChatMessageRepository.kt b/demo/src/main/java/com/tinder/app/echo/domain/ChatMessageRepository.kt index 26d06a94..c9d74349 100644 --- a/demo/src/main/java/com/tinder/app/echo/domain/ChatMessageRepository.kt +++ b/demo/src/main/java/com/tinder/app/echo/domain/ChatMessageRepository.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.echo.domain diff --git a/demo/src/main/java/com/tinder/app/echo/domain/LoggedInLifecycle.kt b/demo/src/main/java/com/tinder/app/echo/domain/LoggedInLifecycle.kt index 836add9d..4e26c82c 100644 --- a/demo/src/main/java/com/tinder/app/echo/domain/LoggedInLifecycle.kt +++ b/demo/src/main/java/com/tinder/app/echo/domain/LoggedInLifecycle.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.echo.domain @@ -27,5 +27,4 @@ class LoggedInLifecycle constructor( } .subscribe(lifecycleRegistry) } - } diff --git a/demo/src/main/java/com/tinder/app/echo/inject/EchoBotComponent.kt b/demo/src/main/java/com/tinder/app/echo/inject/EchoBotComponent.kt index 90628a29..ec0b830c 100644 --- a/demo/src/main/java/com/tinder/app/echo/inject/EchoBotComponent.kt +++ b/demo/src/main/java/com/tinder/app/echo/inject/EchoBotComponent.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.echo.inject @@ -67,5 +67,4 @@ interface EchoBotComponent { interface ComponentProvider { val echoBotComponent: EchoBotComponent } - } diff --git a/demo/src/main/java/com/tinder/app/echo/inject/EchoBotScope.kt b/demo/src/main/java/com/tinder/app/echo/inject/EchoBotScope.kt index 6955a138..cfe38d51 100644 --- a/demo/src/main/java/com/tinder/app/echo/inject/EchoBotScope.kt +++ b/demo/src/main/java/com/tinder/app/echo/inject/EchoBotScope.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.echo.inject diff --git a/demo/src/main/java/com/tinder/app/echo/presenter/EchoBotPresenter.kt b/demo/src/main/java/com/tinder/app/echo/presenter/EchoBotPresenter.kt index b8312b27..80a33290 100755 --- a/demo/src/main/java/com/tinder/app/echo/presenter/EchoBotPresenter.kt +++ b/demo/src/main/java/com/tinder/app/echo/presenter/EchoBotPresenter.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.echo.presenter diff --git a/demo/src/main/java/com/tinder/app/echo/target/EchoBotTarget.kt b/demo/src/main/java/com/tinder/app/echo/target/EchoBotTarget.kt index ca5ad51a..25372695 100755 --- a/demo/src/main/java/com/tinder/app/echo/target/EchoBotTarget.kt +++ b/demo/src/main/java/com/tinder/app/echo/target/EchoBotTarget.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.echo.target diff --git a/demo/src/main/java/com/tinder/app/echo/view/EchoBotFragment.kt b/demo/src/main/java/com/tinder/app/echo/view/EchoBotFragment.kt index 3f795c56..c9aa6293 100755 --- a/demo/src/main/java/com/tinder/app/echo/view/EchoBotFragment.kt +++ b/demo/src/main/java/com/tinder/app/echo/view/EchoBotFragment.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.echo.view diff --git a/demo/src/main/java/com/tinder/app/gdax/api/GdaxService.kt b/demo/src/main/java/com/tinder/app/gdax/api/GdaxService.kt index f4f8cd5e..598da288 100644 --- a/demo/src/main/java/com/tinder/app/gdax/api/GdaxService.kt +++ b/demo/src/main/java/com/tinder/app/gdax/api/GdaxService.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.gdax.api diff --git a/demo/src/main/java/com/tinder/app/gdax/api/MoshiAdapters.kt b/demo/src/main/java/com/tinder/app/gdax/api/MoshiAdapters.kt index ec8f70bc..530aa330 100644 --- a/demo/src/main/java/com/tinder/app/gdax/api/MoshiAdapters.kt +++ b/demo/src/main/java/com/tinder/app/gdax/api/MoshiAdapters.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.gdax.api diff --git a/demo/src/main/java/com/tinder/app/gdax/api/model/ProductId.kt b/demo/src/main/java/com/tinder/app/gdax/api/model/ProductId.kt index 59446c54..a56cce29 100644 --- a/demo/src/main/java/com/tinder/app/gdax/api/model/ProductId.kt +++ b/demo/src/main/java/com/tinder/app/gdax/api/model/ProductId.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.gdax.api.model diff --git a/demo/src/main/java/com/tinder/app/gdax/api/model/Subscribe.kt b/demo/src/main/java/com/tinder/app/gdax/api/model/Subscribe.kt index f9304d3c..df872131 100644 --- a/demo/src/main/java/com/tinder/app/gdax/api/model/Subscribe.kt +++ b/demo/src/main/java/com/tinder/app/gdax/api/model/Subscribe.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.gdax.api.model diff --git a/demo/src/main/java/com/tinder/app/gdax/api/model/Ticker.kt b/demo/src/main/java/com/tinder/app/gdax/api/model/Ticker.kt index 0b323321..d30f313c 100644 --- a/demo/src/main/java/com/tinder/app/gdax/api/model/Ticker.kt +++ b/demo/src/main/java/com/tinder/app/gdax/api/model/Ticker.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.gdax.api.model diff --git a/demo/src/main/java/com/tinder/app/gdax/domain/Product.kt b/demo/src/main/java/com/tinder/app/gdax/domain/Product.kt index d443bb8d..dfadc6d5 100644 --- a/demo/src/main/java/com/tinder/app/gdax/domain/Product.kt +++ b/demo/src/main/java/com/tinder/app/gdax/domain/Product.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.gdax.domain diff --git a/demo/src/main/java/com/tinder/app/gdax/domain/Transaction.kt b/demo/src/main/java/com/tinder/app/gdax/domain/Transaction.kt index a5b4620c..78e909d4 100644 --- a/demo/src/main/java/com/tinder/app/gdax/domain/Transaction.kt +++ b/demo/src/main/java/com/tinder/app/gdax/domain/Transaction.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.gdax.domain diff --git a/demo/src/main/java/com/tinder/app/gdax/domain/TransactionBook.kt b/demo/src/main/java/com/tinder/app/gdax/domain/TransactionBook.kt index f38a64c4..853707f7 100644 --- a/demo/src/main/java/com/tinder/app/gdax/domain/TransactionBook.kt +++ b/demo/src/main/java/com/tinder/app/gdax/domain/TransactionBook.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.gdax.domain @@ -16,5 +16,4 @@ class TransactionBook( newHistory.transactions[product] = (newHistory.transactions[product] ?: emptyList()) + transaction return newHistory } - } diff --git a/demo/src/main/java/com/tinder/app/gdax/domain/TransactionRepository.kt b/demo/src/main/java/com/tinder/app/gdax/domain/TransactionRepository.kt index 5e951fc0..ef125afc 100644 --- a/demo/src/main/java/com/tinder/app/gdax/domain/TransactionRepository.kt +++ b/demo/src/main/java/com/tinder/app/gdax/domain/TransactionRepository.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.gdax.domain @@ -68,5 +68,4 @@ class TransactionRepository @Inject constructor( transactionBookRef.set(transactionBook) transactionBookProcessor.onNext(transactionBook) } - } diff --git a/demo/src/main/java/com/tinder/app/gdax/inject/GdaxComponent.kt b/demo/src/main/java/com/tinder/app/gdax/inject/GdaxComponent.kt index 450eac32..ba670eea 100644 --- a/demo/src/main/java/com/tinder/app/gdax/inject/GdaxComponent.kt +++ b/demo/src/main/java/com/tinder/app/gdax/inject/GdaxComponent.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.gdax.inject @@ -73,5 +73,4 @@ interface GdaxComponent { interface ComponentProvider { val gdaxComponent: GdaxComponent } - } diff --git a/demo/src/main/java/com/tinder/app/gdax/inject/GdaxScope.kt b/demo/src/main/java/com/tinder/app/gdax/inject/GdaxScope.kt index d8b0e0a7..a1d6ef47 100644 --- a/demo/src/main/java/com/tinder/app/gdax/inject/GdaxScope.kt +++ b/demo/src/main/java/com/tinder/app/gdax/inject/GdaxScope.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.gdax.inject diff --git a/demo/src/main/java/com/tinder/app/gdax/presenter/GdaxPresenter.kt b/demo/src/main/java/com/tinder/app/gdax/presenter/GdaxPresenter.kt index c467e1fc..fdfe789e 100644 --- a/demo/src/main/java/com/tinder/app/gdax/presenter/GdaxPresenter.kt +++ b/demo/src/main/java/com/tinder/app/gdax/presenter/GdaxPresenter.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.gdax.presenter diff --git a/demo/src/main/java/com/tinder/app/gdax/target/GdaxTarget.kt b/demo/src/main/java/com/tinder/app/gdax/target/GdaxTarget.kt index dcdb599b..06470a35 100644 --- a/demo/src/main/java/com/tinder/app/gdax/target/GdaxTarget.kt +++ b/demo/src/main/java/com/tinder/app/gdax/target/GdaxTarget.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.gdax.target @@ -10,5 +10,4 @@ import com.tinder.app.gdax.domain.Transaction interface GdaxTarget { fun showTransactions(product: Product, transactions: List) - } diff --git a/demo/src/main/java/com/tinder/app/gdax/view/GdaxFragment.kt b/demo/src/main/java/com/tinder/app/gdax/view/GdaxFragment.kt index 15687481..25bf36fd 100644 --- a/demo/src/main/java/com/tinder/app/gdax/view/GdaxFragment.kt +++ b/demo/src/main/java/com/tinder/app/gdax/view/GdaxFragment.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.gdax.view diff --git a/demo/src/main/java/com/tinder/app/root/ScarletDemoApplication.kt b/demo/src/main/java/com/tinder/app/root/ScarletDemoApplication.kt index 5d24cd2c..921dd8a4 100755 --- a/demo/src/main/java/com/tinder/app/root/ScarletDemoApplication.kt +++ b/demo/src/main/java/com/tinder/app/root/ScarletDemoApplication.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.root @@ -46,5 +46,4 @@ class ScarletDemoApplication : Application(), Timber.plant(Timber.DebugTree()) Stetho.initialize(stethoInitializer) } - } diff --git a/demo/src/main/java/com/tinder/app/root/inject/ApplicationComponent.kt b/demo/src/main/java/com/tinder/app/root/inject/ApplicationComponent.kt index 139669d5..ee84c0d9 100755 --- a/demo/src/main/java/com/tinder/app/root/inject/ApplicationComponent.kt +++ b/demo/src/main/java/com/tinder/app/root/inject/ApplicationComponent.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.root.inject diff --git a/demo/src/main/java/com/tinder/app/root/inject/CommonModule.kt b/demo/src/main/java/com/tinder/app/root/inject/CommonModule.kt index 4827a727..e62992aa 100755 --- a/demo/src/main/java/com/tinder/app/root/inject/CommonModule.kt +++ b/demo/src/main/java/com/tinder/app/root/inject/CommonModule.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.root.inject @@ -16,5 +16,4 @@ class CommonModule { fun provideApplicationContext(application: Application): Context { return application } - } diff --git a/demo/src/main/java/com/tinder/app/root/inject/StethoModule.kt b/demo/src/main/java/com/tinder/app/root/inject/StethoModule.kt index ef0b0f42..460a673d 100755 --- a/demo/src/main/java/com/tinder/app/root/inject/StethoModule.kt +++ b/demo/src/main/java/com/tinder/app/root/inject/StethoModule.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.root.inject @@ -43,5 +43,4 @@ class StethoModule { internal fun provideInspectorModulesProvider(application: Application): InspectorModulesProvider { return Stetho.defaultInspectorModulesProvider(application) } - } diff --git a/demo/src/main/java/com/tinder/app/root/view/DemoActivity.kt b/demo/src/main/java/com/tinder/app/root/view/DemoActivity.kt index a36ad388..918168ce 100755 --- a/demo/src/main/java/com/tinder/app/root/view/DemoActivity.kt +++ b/demo/src/main/java/com/tinder/app/root/view/DemoActivity.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.app.root.view diff --git a/demo/src/main/res/drawable/ic_launcher_background.xml b/demo/src/main/res/drawable/ic_launcher_background.xml index b57efee4..1eca8a79 100755 --- a/demo/src/main/res/drawable/ic_launcher_background.xml +++ b/demo/src/main/res/drawable/ic_launcher_background.xml @@ -1,6 +1,6 @@ diff --git a/demo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/demo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml index 4b776554..176e2843 100755 --- a/demo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/demo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -1,6 +1,6 @@ diff --git a/demo/src/main/res/values/colors.xml b/demo/src/main/res/values/colors.xml index 496c74c6..eab0c52a 100755 --- a/demo/src/main/res/values/colors.xml +++ b/demo/src/main/res/values/colors.xml @@ -1,6 +1,6 @@ diff --git a/demo/src/main/res/values/dimens.xml b/demo/src/main/res/values/dimens.xml index a92b8340..3e761681 100644 --- a/demo/src/main/res/values/dimens.xml +++ b/demo/src/main/res/values/dimens.xml @@ -1,6 +1,6 @@ diff --git a/demo/src/main/res/values/strings.xml b/demo/src/main/res/values/strings.xml index ebd1197e..8e09dfe4 100755 --- a/demo/src/main/res/values/strings.xml +++ b/demo/src/main/res/values/strings.xml @@ -1,5 +1,5 @@ diff --git a/demo/src/main/res/values/styles.xml b/demo/src/main/res/values/styles.xml index 796cf1ae..34343ba1 100755 --- a/demo/src/main/res/values/styles.xml +++ b/demo/src/main/res/values/styles.xml @@ -1,5 +1,5 @@ diff --git a/dependencies.gradle b/dependencies.gradle index 87031947..122469c4 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -15,17 +15,22 @@ ext { multiDex = 'com.android.support:multidex:1.0.2' reactiveStreams = 'org.reactivestreams:reactive-streams:1.0.2' - rxJava = 'io.reactivex.rxjava2:rxjava:2.1.6' - rxAndroid = 'io.reactivex.rxjava2:rxandroid:2.0.1' - rxKotlin = 'io.reactivex.rxjava2:rxkotlin:2.1.0' + rxJava = 'io.reactivex.rxjava2:rxjava:2.1.16' + rxAndroid = 'io.reactivex.rxjava2:rxandroid:2.0.2' + rxKotlin = 'io.reactivex.rxjava2:rxkotlin:2.2.0' rxJava1 = 'io.reactivex:rxjava:1.3.4' + kotlinCoroutines = 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.23.3' + kotlinCoroutinesRxInterop = 'org.jetbrains.kotlinx:kotlinx-coroutines-reactive:0.23.3' stetho = 'com.facebook.stetho:stetho:1.5.0' stethoOkHttp = 'com.facebook.stetho:stetho-okhttp3:1.5.0' moshi = 'com.squareup.moshi:moshi-kotlin:1.5.0' + moshiCodeGen = 'com.squareup.moshi:moshi-kotlin-codegen:1.6.0' gson = 'com.google.code.gson:gson:2.8.2' protobuf = 'com.google.protobuf:protobuf-java:3.4.0' + jacksonDatabind = 'com.fasterxml.jackson.core:jackson-databind:2.9.5' + jsonPatch = 'com.github.fge:json-patch:1.9' dagger = 'com.google.dagger:dagger:2.12' daggerCompiler = 'com.google.dagger:dagger-compiler:2.12' @@ -37,16 +42,17 @@ ext { jodaTime = 'joda-time:joda-time:2.9.9' glide = 'com.github.bumptech.glide:glide:4.5.0' - okHttp = 'com.squareup.okhttp3:okhttp:3.8.1' - okHttpLoggingInterceptor = 'com.squareup.okhttp3:logging-interceptor:3.8.1' + okHttp = 'com.squareup.okhttp3:okhttp:3.11.0' + okHttpLoggingInterceptor = 'com.squareup.okhttp3:logging-interceptor:3.11.0' okio = 'com.squareup.okio:okio:1.13.0' - mockWebServer = 'com.squareup.okhttp3:mockwebserver:3.8.1' + mockWebServer = 'com.squareup.okhttp3:mockwebserver:3.11.0' timber = 'com.jakewharton.timber:timber:4.6.0' + okSse = 'com.github.heremaps:oksse:0.9.0' junit = 'junit:junit:4.12' - mockito = 'com.nhaarman:mockito-kotlin-kt1.1:1.5.0' + mockito = 'com.nhaarman:mockito-kotlin-kt1.1:1.6.0' assertJ = 'org.assertj:assertj-core:3.8.0' - kotlinStdlib = "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" + kotlinStdlib = "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" kotlinReflect = "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" } diff --git a/gradle.properties b/gradle.properties index de55ab65..49bc55ca 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=0.1.0 +version=0.1.4 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b2ee17c4..8ef3530a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-all.zip diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 00000000..7ce70da2 --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,4 @@ +jdk: + - oraclejdk8 +install: + - ./publish-jitpack.sh diff --git a/publish-jitpack.sh b/publish-jitpack.sh new file mode 100755 index 00000000..17d1c71e --- /dev/null +++ b/publish-jitpack.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +./gradlew clean + +./gradlew scarlet-core:build scarlet-core:publishToMavenLocal + +./gradlew scarlet-core-internal:build scarlet-core-internal:publishToMavenLocal + +./gradlew state-machine:build state-machine:publishToMavenLocal + +./gradlew scarlet:build scarlet:publishToMavenLocal + +./gradlew scarlet-test-utils:build scarlet-test-utils:publishToMavenLocal + +./gradlew scarlet-message-adapter-builtin:build scarlet-message-adapter-builtin:publishToMavenLocal + +./gradlew scarlet-message-adapter-protobuf:build scarlet-message-adapter-protobuf:publishToMavenLocal + +./gradlew scarlet-message-adapter-moshi:build scarlet-message-adapter-moshi:publishToMavenLocal + +./gradlew scarlet-message-adapter-gson:build scarlet-message-adapter-gson:publishToMavenLocal + +./gradlew scarlet-stream-adapter-builtin:build scarlet-stream-adapter-builtin:publishToMavenLocal + +./gradlew scarlet-stream-adapter-rxjava2:build scarlet-stream-adapter-rxjava2:publishToMavenLocal + +./gradlew scarlet-stream-adapter-rxjava:build scarlet-stream-adapter-rxjava:publishToMavenLocal + +./gradlew scarlet-stream-adapter-coroutines:build scarlet-stream-adapter-coroutines:publishToMavenLocal + +./gradlew scarlet-websocket-okhttp:build scarlet-websocket-okhttp:publishToMavenLocal + +./gradlew scarlet-websocket-mockwebserver:build scarlet-websocket-mockwebserver:publishToMavenLocal + +./gradlew scarlet-lifecycle-android:assemble scarlet-lifecycle-android:generatePomFileForAarPublication +./gradlew scarlet-lifecycle-android:publishToMavenLocal diff --git a/publish.sh b/publish.sh index da301066..8901706a 100755 --- a/publish.sh +++ b/publish.sh @@ -17,12 +17,20 @@ ./gradlew scarlet-message-adapter-builtin:build scarlet-message-adapter-builtin:artifactoryPublish +./gradlew scarlet-message-adapter-gson:build scarlet-message-adapter-gson:artifactoryPublish + +./gradlew scarlet-message-adapter-moshi:build scarlet-message-adapter-moshi:artifactoryPublish + ./gradlew scarlet-message-adapter-protobuf:build scarlet-message-adapter-protobuf:artifactoryPublish ./gradlew scarlet-stream-adapter-builtin:build scarlet-stream-adapter-builtin:artifactoryPublish +./gradlew scarlet-stream-adapter-rxjava:build scarlet-stream-adapter-rxjava:artifactoryPublish + ./gradlew scarlet-stream-adapter-rxjava2:build scarlet-stream-adapter-rxjava2:artifactoryPublish +./gradlew scarlet-stream-adapter-coroutines:build scarlet-stream-adapter-coroutines:artifactoryPublish + ./gradlew scarlet-websocket-okhttp:build scarlet-websocket-okhttp:artifactoryPublish ./gradlew scarlet-websocket-mockwebserver:build scarlet-websocket-mockwebserver:artifactoryPublish diff --git a/scarlet-core-internal/build.gradle b/scarlet-core-internal/build.gradle index 04341c7f..98ab8041 100644 --- a/scarlet-core-internal/build.gradle +++ b/scarlet-core-internal/build.gradle @@ -27,7 +27,7 @@ artifacts { publishing { publications { mavenJava(MavenPublication) { - groupId 'com.tinder.scarlet' + groupId 'com.tinder' version version artifactId project.getName() artifact sourcesJar diff --git a/scarlet-core-internal/src/main/java/com/tinder/scarlet/utils/EmptyStreamObserver.kt b/scarlet-core-internal/src/main/java/com/tinder/scarlet/utils/EmptyStreamObserver.kt index 7a4dfb58..6127a1ae 100644 --- a/scarlet-core-internal/src/main/java/com/tinder/scarlet/utils/EmptyStreamObserver.kt +++ b/scarlet-core-internal/src/main/java/com/tinder/scarlet/utils/EmptyStreamObserver.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.utils diff --git a/scarlet-core-internal/src/main/java/com/tinder/scarlet/utils/FlowableStream.kt b/scarlet-core-internal/src/main/java/com/tinder/scarlet/utils/FlowableStream.kt index 52e227c0..1cc810c2 100644 --- a/scarlet-core-internal/src/main/java/com/tinder/scarlet/utils/FlowableStream.kt +++ b/scarlet-core-internal/src/main/java/com/tinder/scarlet/utils/FlowableStream.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.utils diff --git a/scarlet-core-internal/src/main/java/com/tinder/scarlet/utils/FlowableUtils.kt b/scarlet-core-internal/src/main/java/com/tinder/scarlet/utils/FlowableUtils.kt index f9c735bd..c36de72c 100644 --- a/scarlet-core-internal/src/main/java/com/tinder/scarlet/utils/FlowableUtils.kt +++ b/scarlet-core-internal/src/main/java/com/tinder/scarlet/utils/FlowableUtils.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ @file:JvmName("FlowableUtils") diff --git a/scarlet-core-internal/src/test/java/com/tinder/scarlet/utils/FlowableStreamTest.kt b/scarlet-core-internal/src/test/java/com/tinder/scarlet/utils/FlowableStreamTest.kt index 7f4e2b71..80f79631 100644 --- a/scarlet-core-internal/src/test/java/com/tinder/scarlet/utils/FlowableStreamTest.kt +++ b/scarlet-core-internal/src/test/java/com/tinder/scarlet/utils/FlowableStreamTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.utils @@ -71,5 +71,4 @@ internal class FlowableStreamTest { // Then assertThat(processor.hasSubscribers()).isFalse() } - } diff --git a/scarlet-core/build.gradle b/scarlet-core/build.gradle index 86813d44..3de8323a 100644 --- a/scarlet-core/build.gradle +++ b/scarlet-core/build.gradle @@ -38,7 +38,7 @@ artifacts { publishing { publications { mavenJava(MavenPublication) { - groupId 'com.tinder.scarlet' + groupId 'com.tinder' version version artifactId project.getName() artifact sourcesJar diff --git a/scarlet-core/src/main/java/com/tinder/scarlet/Deserialization.kt b/scarlet-core/src/main/java/com/tinder/scarlet/Deserialization.kt index 23e7c480..421d2717 100644 --- a/scarlet-core/src/main/java/com/tinder/scarlet/Deserialization.kt +++ b/scarlet-core/src/main/java/com/tinder/scarlet/Deserialization.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet diff --git a/scarlet-core/src/main/java/com/tinder/scarlet/Lifecycle.kt b/scarlet-core/src/main/java/com/tinder/scarlet/Lifecycle.kt index c0952d95..88386e78 100644 --- a/scarlet-core/src/main/java/com/tinder/scarlet/Lifecycle.kt +++ b/scarlet-core/src/main/java/com/tinder/scarlet/Lifecycle.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet @@ -45,4 +45,3 @@ interface Lifecycle : Publisher { object Destroyed : State() } } - diff --git a/scarlet-core/src/main/java/com/tinder/scarlet/Message.kt b/scarlet-core/src/main/java/com/tinder/scarlet/Message.kt index aa751d0e..2fe20369 100644 --- a/scarlet-core/src/main/java/com/tinder/scarlet/Message.kt +++ b/scarlet-core/src/main/java/com/tinder/scarlet/Message.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet diff --git a/scarlet-core/src/main/java/com/tinder/scarlet/MessageAdapter.kt b/scarlet-core/src/main/java/com/tinder/scarlet/MessageAdapter.kt index 9fe7dab4..5a72ce1a 100644 --- a/scarlet-core/src/main/java/com/tinder/scarlet/MessageAdapter.kt +++ b/scarlet-core/src/main/java/com/tinder/scarlet/MessageAdapter.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet diff --git a/scarlet-core/src/main/java/com/tinder/scarlet/ShutdownReason.kt b/scarlet-core/src/main/java/com/tinder/scarlet/ShutdownReason.kt index 7f8f89f5..3434ac21 100644 --- a/scarlet-core/src/main/java/com/tinder/scarlet/ShutdownReason.kt +++ b/scarlet-core/src/main/java/com/tinder/scarlet/ShutdownReason.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet diff --git a/scarlet-core/src/main/java/com/tinder/scarlet/Stream.kt b/scarlet-core/src/main/java/com/tinder/scarlet/Stream.kt index ea206e1d..2db6dc94 100644 --- a/scarlet-core/src/main/java/com/tinder/scarlet/Stream.kt +++ b/scarlet-core/src/main/java/com/tinder/scarlet/Stream.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet @@ -40,5 +40,4 @@ interface Stream : Publisher { fun isDisposed(): Boolean } - } diff --git a/scarlet-core/src/main/java/com/tinder/scarlet/StreamAdapter.kt b/scarlet-core/src/main/java/com/tinder/scarlet/StreamAdapter.kt index ca128731..320e176b 100644 --- a/scarlet-core/src/main/java/com/tinder/scarlet/StreamAdapter.kt +++ b/scarlet-core/src/main/java/com/tinder/scarlet/StreamAdapter.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet @@ -28,6 +28,5 @@ interface StreamAdapter { * handled by this factory. */ fun create(type: Type): StreamAdapter - } } diff --git a/scarlet-core/src/main/java/com/tinder/scarlet/WebSocket.kt b/scarlet-core/src/main/java/com/tinder/scarlet/WebSocket.kt index 40103adb..d7f6ec91 100644 --- a/scarlet-core/src/main/java/com/tinder/scarlet/WebSocket.kt +++ b/scarlet-core/src/main/java/com/tinder/scarlet/WebSocket.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet @@ -79,5 +79,4 @@ interface WebSocket { interface Factory { fun create(): WebSocket } - } diff --git a/scarlet-core/src/main/java/com/tinder/scarlet/utils/TypeUtils.kt b/scarlet-core/src/main/java/com/tinder/scarlet/utils/TypeUtils.kt index e302d2ed..1c130124 100644 --- a/scarlet-core/src/main/java/com/tinder/scarlet/utils/TypeUtils.kt +++ b/scarlet-core/src/main/java/com/tinder/scarlet/utils/TypeUtils.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ @file:JvmName("TypeUtils") diff --git a/scarlet-core/src/main/java/com/tinder/scarlet/utils/Utils.java b/scarlet-core/src/main/java/com/tinder/scarlet/utils/Utils.java index cdf74d50..2073db34 100644 --- a/scarlet-core/src/main/java/com/tinder/scarlet/utils/Utils.java +++ b/scarlet-core/src/main/java/com/tinder/scarlet/utils/Utils.java @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ /* diff --git a/scarlet-core/src/test/java/com/tinder/scarlet/utils/TypeUtilsTest.kt b/scarlet-core/src/test/java/com/tinder/scarlet/utils/TypeUtilsTest.kt index 7c987af4..25d3c698 100644 --- a/scarlet-core/src/test/java/com/tinder/scarlet/utils/TypeUtilsTest.kt +++ b/scarlet-core/src/test/java/com/tinder/scarlet/utils/TypeUtilsTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.utils @@ -70,7 +70,6 @@ internal class TypeUtilsTest { private fun param(type: Type, expectedHasUnresolvableType: Boolean) = arrayOf(type, expectedHasUnresolvableType) } - } @RunWith(Parameterized::class) @@ -102,7 +101,6 @@ internal class TypeUtilsTest { private fun param(type: ParameterizedType, expectedParameterUpperBound: Array) = arrayOf(type, expectedParameterUpperBound) } - } private companion object { @@ -146,5 +144,4 @@ internal class TypeUtilsTest { } } } - } diff --git a/scarlet-lifecycle-android/build.gradle b/scarlet-lifecycle-android/build.gradle index 124d5168..80acb44c 100755 --- a/scarlet-lifecycle-android/build.gradle +++ b/scarlet-lifecycle-android/build.gradle @@ -63,7 +63,7 @@ task sourcesJar(type: Jar) { publishing { publications { aar(MavenPublication) { - groupId 'com.tinder.scarlet' + groupId 'com.tinder' version version artifactId project.getName() diff --git a/scarlet-lifecycle-android/src/main/AndroidManifest.xml b/scarlet-lifecycle-android/src/main/AndroidManifest.xml index 4e2a5928..8555a8d5 100755 --- a/scarlet-lifecycle-android/src/main/AndroidManifest.xml +++ b/scarlet-lifecycle-android/src/main/AndroidManifest.xml @@ -1,6 +1,9 @@ + package="com.tinder.scarlet.lifecycle.android"> + + + diff --git a/scarlet-lifecycle-android/src/main/java/com/tinder/scarlet/lifecycle/android/AndroidLifecycle.kt b/scarlet-lifecycle-android/src/main/java/com/tinder/scarlet/lifecycle/android/AndroidLifecycle.kt index 115d8143..d97e0dfd 100755 --- a/scarlet-lifecycle-android/src/main/java/com/tinder/scarlet/lifecycle/android/AndroidLifecycle.kt +++ b/scarlet-lifecycle-android/src/main/java/com/tinder/scarlet/lifecycle/android/AndroidLifecycle.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.lifecycle.android diff --git a/scarlet-lifecycle-android/src/main/java/com/tinder/scarlet/lifecycle/android/ApplicationResumedLifecycle.kt b/scarlet-lifecycle-android/src/main/java/com/tinder/scarlet/lifecycle/android/ApplicationResumedLifecycle.kt index c427cab5..19603a53 100644 --- a/scarlet-lifecycle-android/src/main/java/com/tinder/scarlet/lifecycle/android/ApplicationResumedLifecycle.kt +++ b/scarlet-lifecycle-android/src/main/java/com/tinder/scarlet/lifecycle/android/ApplicationResumedLifecycle.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.lifecycle.android diff --git a/scarlet-lifecycle-android/src/main/java/com/tinder/scarlet/lifecycle/android/ConnectivityOnLifecycle.kt b/scarlet-lifecycle-android/src/main/java/com/tinder/scarlet/lifecycle/android/ConnectivityOnLifecycle.kt index 9b124460..adc97263 100644 --- a/scarlet-lifecycle-android/src/main/java/com/tinder/scarlet/lifecycle/android/ConnectivityOnLifecycle.kt +++ b/scarlet-lifecycle-android/src/main/java/com/tinder/scarlet/lifecycle/android/ConnectivityOnLifecycle.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.lifecycle.android diff --git a/scarlet-lifecycle-android/src/main/java/com/tinder/scarlet/lifecycle/android/LifecycleOwnerResumedLifecycle.kt b/scarlet-lifecycle-android/src/main/java/com/tinder/scarlet/lifecycle/android/LifecycleOwnerResumedLifecycle.kt index ac842e0f..4c394c74 100644 --- a/scarlet-lifecycle-android/src/main/java/com/tinder/scarlet/lifecycle/android/LifecycleOwnerResumedLifecycle.kt +++ b/scarlet-lifecycle-android/src/main/java/com/tinder/scarlet/lifecycle/android/LifecycleOwnerResumedLifecycle.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.lifecycle.android diff --git a/scarlet-message-adapter-builtin/build.gradle b/scarlet-message-adapter-builtin/build.gradle index 881e6aa2..0527cd6c 100644 --- a/scarlet-message-adapter-builtin/build.gradle +++ b/scarlet-message-adapter-builtin/build.gradle @@ -25,7 +25,7 @@ artifacts { publishing { publications { mavenJava(MavenPublication) { - groupId 'com.tinder.scarlet' + groupId 'com.tinder' version version artifactId project.getName() artifact sourcesJar diff --git a/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/BuiltInMessageAdapterFactory.kt b/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/BuiltInMessageAdapterFactory.kt index 396ad2b2..4a0017be 100644 --- a/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/BuiltInMessageAdapterFactory.kt +++ b/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/BuiltInMessageAdapterFactory.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.messageadapter.builtin @@ -15,5 +15,4 @@ class BuiltInMessageAdapterFactory : MessageAdapter.Factory { ByteArray::class.java -> ByteArrayMessageAdapter() else -> throw IllegalArgumentException("Type is not supported by this MessageAdapterFactory: $type") } - } diff --git a/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/ByteArrayMessageAdapter.kt b/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/ByteArrayMessageAdapter.kt index 30a93d12..d7b64c47 100644 --- a/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/ByteArrayMessageAdapter.kt +++ b/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/ByteArrayMessageAdapter.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.messageadapter.builtin @@ -15,5 +15,4 @@ class ByteArrayMessageAdapter : MessageAdapter { } override fun toMessage(data: ByteArray): Message = Message.Bytes(data) - } diff --git a/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/TextMessageAdapter.kt b/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/TextMessageAdapter.kt index 7d3f060e..2606654f 100644 --- a/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/TextMessageAdapter.kt +++ b/scarlet-message-adapter-builtin/src/main/java/com/tinder/scarlet/messageadapter/builtin/TextMessageAdapter.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.messageadapter.builtin @@ -15,5 +15,4 @@ class TextMessageAdapter : MessageAdapter { } override fun toMessage(data: String): Message = Message.Text(data) - } diff --git a/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/BuiltInMessageAdapterFactoryTest.kt b/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/BuiltInMessageAdapterFactoryTest.kt index 63aee894..8e991d54 100644 --- a/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/BuiltInMessageAdapterFactoryTest.kt +++ b/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/BuiltInMessageAdapterFactoryTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.messageadapter.builtin @@ -51,5 +51,4 @@ internal class BuiltInMessageAdapterFactoryTest { Collection::class.java ) } - } diff --git a/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/ByteArrayMessageAdapterTest.kt b/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/ByteArrayMessageAdapterTest.kt index 62d16694..487a215a 100644 --- a/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/ByteArrayMessageAdapterTest.kt +++ b/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/ByteArrayMessageAdapterTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.messageadapter.builtin @@ -38,5 +38,4 @@ internal class ByteArrayMessageAdapterTest { val (adaptedBytes) = (adaptedMessage as Message.Bytes) assertThat(adaptedBytes).isEqualTo(bytes) } - } diff --git a/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/TextMessageAdapterTest.kt b/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/TextMessageAdapterTest.kt index 89b7512c..9391113c 100644 --- a/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/TextMessageAdapterTest.kt +++ b/scarlet-message-adapter-builtin/src/test/java/com/tinder/scarlet/messageadapter/builtin/TextMessageAdapterTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.messageadapter.builtin @@ -37,5 +37,4 @@ internal class TextMessageAdapterTest { // Then assertThat(adaptedMessage).isEqualTo(textMessage) } - } diff --git a/scarlet-message-adapter-gson/build.gradle b/scarlet-message-adapter-gson/build.gradle index 1a777de9..b174d6b4 100755 --- a/scarlet-message-adapter-gson/build.gradle +++ b/scarlet-message-adapter-gson/build.gradle @@ -46,7 +46,7 @@ artifacts { publishing { publications { mavenJava(MavenPublication) { - groupId 'com.tinder.scarlet' + groupId 'com.tinder' version version artifactId project.getName() artifact sourcesJar diff --git a/scarlet-message-adapter-gson/src/main/java/com/tinder/scarlet/messageadapter/gson/GsonMessageAdapter.kt b/scarlet-message-adapter-gson/src/main/java/com/tinder/scarlet/messageadapter/gson/GsonMessageAdapter.kt index 5c9346f0..9962e597 100644 --- a/scarlet-message-adapter-gson/src/main/java/com/tinder/scarlet/messageadapter/gson/GsonMessageAdapter.kt +++ b/scarlet-message-adapter-gson/src/main/java/com/tinder/scarlet/messageadapter/gson/GsonMessageAdapter.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.messageadapter.gson @@ -55,5 +55,4 @@ class GsonMessageAdapter private constructor( private val DEFAULT_GSON = Gson() } } - } diff --git a/scarlet-message-adapter-gson/src/test/java/com/tinder/scarlet/messageadapter/gson/GsonMessageAdapterTest.kt b/scarlet-message-adapter-gson/src/test/java/com/tinder/scarlet/messageadapter/gson/GsonMessageAdapterTest.kt index 526c8fad..8f2d4452 100644 --- a/scarlet-message-adapter-gson/src/test/java/com/tinder/scarlet/messageadapter/gson/GsonMessageAdapterTest.kt +++ b/scarlet-message-adapter-gson/src/test/java/com/tinder/scarlet/messageadapter/gson/GsonMessageAdapterTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.messageadapter.gson @@ -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 @@ -52,7 +52,7 @@ internal class GsonMessageAdapterTest { // Given givenConnectionIsEstablished() val data = AnImplementation("value") - val expectedString = "{\"name\":\"value\"}" + val expectedString = """{"name":"value"}""" val serverAnImplementationObserver = server.observeAnImplementation().test() // When @@ -72,7 +72,7 @@ internal class GsonMessageAdapterTest { // Given givenConnectionIsEstablished() val data = AnImplementation("value") - val expectedString = "{\"name\":\"value\"}" + val expectedString = """{"name":"value"}""" val serverAnImplementationObserver = server.observeAnImplementation().test() // When @@ -225,7 +225,6 @@ internal class GsonMessageAdapterTest { else -> throw IllegalArgumentException("$type is not supported.") } } - } internal interface Service { @@ -244,7 +243,5 @@ internal class GsonMessageAdapterTest { @Send fun sendAnInterface(impl: AnInterface): Boolean } - } - } diff --git a/scarlet-message-adapter-moshi/build.gradle b/scarlet-message-adapter-moshi/build.gradle index 905d0dee..f7836198 100755 --- a/scarlet-message-adapter-moshi/build.gradle +++ b/scarlet-message-adapter-moshi/build.gradle @@ -51,7 +51,7 @@ artifacts { publishing { publications { mavenJava(MavenPublication) { - groupId 'com.tinder.scarlet' + groupId 'com.tinder' version version artifactId project.getName() artifact sourcesJar diff --git a/scarlet-message-adapter-moshi/src/main/java/com/tinder/scarlet/messageadapter/moshi/MoshiMessageAdapter.kt b/scarlet-message-adapter-moshi/src/main/java/com/tinder/scarlet/messageadapter/moshi/MoshiMessageAdapter.kt index e3224f2e..9d0aa746 100755 --- a/scarlet-message-adapter-moshi/src/main/java/com/tinder/scarlet/messageadapter/moshi/MoshiMessageAdapter.kt +++ b/scarlet-message-adapter-moshi/src/main/java/com/tinder/scarlet/messageadapter/moshi/MoshiMessageAdapter.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.messageadapter.moshi @@ -83,7 +83,6 @@ class MoshiMessageAdapter private constructor( val serializeNull: Boolean = false, val failOnUnknown: Boolean = false ) - } private companion object { diff --git a/scarlet-message-adapter-moshi/src/test/java/com/tinder/scarlet/messageadapter/moshi/MoshiMessageAdapterTest.kt b/scarlet-message-adapter-moshi/src/test/java/com/tinder/scarlet/messageadapter/moshi/MoshiMessageAdapterTest.kt index eec8a633..e4e497df 100644 --- a/scarlet-message-adapter-moshi/src/test/java/com/tinder/scarlet/messageadapter/moshi/MoshiMessageAdapterTest.kt +++ b/scarlet-message-adapter-moshi/src/test/java/com/tinder/scarlet/messageadapter/moshi/MoshiMessageAdapterTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.messageadapter.moshi @@ -53,7 +53,7 @@ internal class MoshiMessageAdapterTest { // Given givenConnectionIsEstablished() val data = AnImplementation("value") - val expectedSerializedData = "{\"name\":\"value\"}" + val expectedSerializedData = """{"name":"value"}""" val serverAnImplementationObserver = server.observeAnImplementation().test() // When @@ -75,7 +75,7 @@ internal class MoshiMessageAdapterTest { // Given givenConnectionIsEstablished() val data = AnImplementation("value") - val expectedSerializedData = "{\"name\":\"value\"}" + val expectedSerializedData = """{"name":"value"}""" val serverAnImplementationObserver = server.observeAnImplementation().test() // When @@ -97,7 +97,7 @@ internal class MoshiMessageAdapterTest { // Given givenConnectionIsEstablished() val data = "value" - val expectedSerializedData = "\"qualified!\"" + val expectedSerializedData = """"qualified!"""" val expectedDeserializedSerializedData = "it worked!" val serverAnnotatedStringObserver = server.observeAnnotatedString().test() @@ -119,7 +119,7 @@ internal class MoshiMessageAdapterTest { fun sendRawString_givenJsonIsMalformed_andFactoryIsLenient_shouldBeReceivedByTheServer() { // Given givenConnectionIsEstablished(Factory.Config(lenient = true)) - val malformedJson = "{\"name\":value}" + val malformedJson = """{"name":value}""" val serverAnImplementationObserver = server.observeAnImplementation().test() // When @@ -139,7 +139,7 @@ internal class MoshiMessageAdapterTest { fun sendRawString_givenJsonIsMalformed_andFactoryIsNotLenient_shouldNotBeReceivedByTheServer() { // Given givenConnectionIsEstablished() - val malformedJson = "{\"name\":value}" + val malformedJson = """{"name":value}""" val serverAnImplementationObserver = server.observeAnImplementation().test() // When @@ -177,7 +177,7 @@ internal class MoshiMessageAdapterTest { fun sendRawString_givenJsonHasUnknownKeys_andFactoryFailsOnUnknown_shouldNotBeReceivedByTheServer() { // Given givenConnectionIsEstablished(Factory.Config(lenient = true, serializeNull = true, failOnUnknown = true)) - val jsonWithUnknownKeys = "{\"taco\":\"delicious\"}" + val jsonWithUnknownKeys = """{"taco":"delicious"}""" val serverAnImplementationObserver = server.observeAnImplementation().test() // When @@ -197,7 +197,7 @@ internal class MoshiMessageAdapterTest { givenConnectionIsEstablished(Factory.Config()) val jsonWithUtf8Bom = Buffer() .write(ByteString.decodeHex("EFBBBF")) - .writeUtf8("{\"name\":\"value\"}") + .writeUtf8("""{"name":"value"}""") .readByteString() .toByteArray() val serverAnImplementationObserver = server.observeAnImplementation().test() @@ -221,7 +221,7 @@ internal class MoshiMessageAdapterTest { givenConnectionIsEstablished(Factory.Config()) val jsonWithUtf16Bom = Buffer() .write(ByteString.decodeHex("FEFF")) - .writeString("{\"name\":\"value\"}", Charset.forName("UTF-16")) + .writeString("""{"name":"value"}""", Charset.forName("UTF-16")) .readByteString() .toByteArray() val serverAnImplementationObserver = server.observeAnImplementation().test() @@ -302,12 +302,13 @@ internal class MoshiMessageAdapterTest { class VerifyJsonQualifierJsonAdapterFactory : JsonAdapter.Factory { override fun create( - type: Type, annotations: Set, + type: Type, + annotations: Set, moshi: Moshi ): JsonAdapter<*>? { for (annotation in annotations) { assert(annotation.annotationClass.java.isAnnotationPresent(JsonQualifier::class.java)) { - "Non-@JsonQualifier annotation: " + annotation + "Non-@JsonQualifier annotation: $annotation" } } return null @@ -350,7 +351,7 @@ internal class MoshiMessageAdapterTest { if (string == "qualified!") { return "it worked!" } - throw AssertionError("Found: " + string) + throw AssertionError("Found: $string") } } @@ -381,7 +382,5 @@ internal class MoshiMessageAdapterTest { @NonQualifer fun observeAnnotatedString(): Stream } - } - } diff --git a/scarlet-message-adapter-protobuf/build.gradle b/scarlet-message-adapter-protobuf/build.gradle index 0c7dc4cf..7d905bf3 100755 --- a/scarlet-message-adapter-protobuf/build.gradle +++ b/scarlet-message-adapter-protobuf/build.gradle @@ -45,7 +45,7 @@ artifacts { publishing { publications { mavenJava(MavenPublication) { - groupId 'com.tinder.scarlet' + groupId 'com.tinder' version version artifactId project.getName() artifact sourcesJar diff --git a/scarlet-message-adapter-protobuf/src/main/java/com/tinder/scarlet/messageadapter/protobuf/ProtobufMessageAdapter.kt b/scarlet-message-adapter-protobuf/src/main/java/com/tinder/scarlet/messageadapter/protobuf/ProtobufMessageAdapter.kt index 42637961..43fda8d0 100755 --- a/scarlet-message-adapter-protobuf/src/main/java/com/tinder/scarlet/messageadapter/protobuf/ProtobufMessageAdapter.kt +++ b/scarlet-message-adapter-protobuf/src/main/java/com/tinder/scarlet/messageadapter/protobuf/ProtobufMessageAdapter.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.messageadapter.protobuf diff --git a/scarlet-message-adapter-protobuf/src/test/java/com/tinder/scarlet/messageadapter/protobuf/PhoneProtos.java b/scarlet-message-adapter-protobuf/src/test/java/com/tinder/scarlet/messageadapter/protobuf/PhoneProtos.java index 4fb798aa..e500c8b1 100644 --- a/scarlet-message-adapter-protobuf/src/test/java/com/tinder/scarlet/messageadapter/protobuf/PhoneProtos.java +++ b/scarlet-message-adapter-protobuf/src/test/java/com/tinder/scarlet/messageadapter/protobuf/PhoneProtos.java @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ // Generated by the protocol buffer compiler. DO NOT EDIT! diff --git a/scarlet-message-adapter-protobuf/src/test/java/com/tinder/scarlet/messageadapter/protobuf/ProtobufMessageAdapterTest.kt b/scarlet-message-adapter-protobuf/src/test/java/com/tinder/scarlet/messageadapter/protobuf/ProtobufMessageAdapterTest.kt index db627554..d86aa123 100644 --- a/scarlet-message-adapter-protobuf/src/test/java/com/tinder/scarlet/messageadapter/protobuf/ProtobufMessageAdapterTest.kt +++ b/scarlet-message-adapter-protobuf/src/test/java/com/tinder/scarlet/messageadapter/protobuf/ProtobufMessageAdapterTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.messageadapter.protobuf @@ -218,6 +218,5 @@ internal class ProtobufMessageAdapterTest { @Receive fun receiveWrongClassDeserialization(): Stream> } - } } diff --git a/scarlet-stream-adapter-builtin/build.gradle b/scarlet-stream-adapter-builtin/build.gradle index 881e6aa2..0527cd6c 100644 --- a/scarlet-stream-adapter-builtin/build.gradle +++ b/scarlet-stream-adapter-builtin/build.gradle @@ -25,7 +25,7 @@ artifacts { publishing { publications { mavenJava(MavenPublication) { - groupId 'com.tinder.scarlet' + groupId 'com.tinder' version version artifactId project.getName() artifact sourcesJar diff --git a/scarlet-stream-adapter-builtin/src/main/java/com/tinder/scarlet/streamadapter/builtin/BuiltInStreamAdapterFactory.kt b/scarlet-stream-adapter-builtin/src/main/java/com/tinder/scarlet/streamadapter/builtin/BuiltInStreamAdapterFactory.kt index 559bffdd..b86aa70f 100644 --- a/scarlet-stream-adapter-builtin/src/main/java/com/tinder/scarlet/streamadapter/builtin/BuiltInStreamAdapterFactory.kt +++ b/scarlet-stream-adapter-builtin/src/main/java/com/tinder/scarlet/streamadapter/builtin/BuiltInStreamAdapterFactory.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.streamadapter.builtin @@ -15,5 +15,4 @@ class BuiltInStreamAdapterFactory : StreamAdapter.Factory { Stream::class.java -> IdentityStreamAdapter() else -> throw IllegalArgumentException("$type is not supported.") } - } diff --git a/scarlet-stream-adapter-builtin/src/main/java/com/tinder/scarlet/streamadapter/builtin/IdentityStreamAdapter.kt b/scarlet-stream-adapter-builtin/src/main/java/com/tinder/scarlet/streamadapter/builtin/IdentityStreamAdapter.kt index 9aaf8c1a..1632dc34 100644 --- a/scarlet-stream-adapter-builtin/src/main/java/com/tinder/scarlet/streamadapter/builtin/IdentityStreamAdapter.kt +++ b/scarlet-stream-adapter-builtin/src/main/java/com/tinder/scarlet/streamadapter/builtin/IdentityStreamAdapter.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.streamadapter.builtin @@ -10,5 +10,4 @@ import com.tinder.scarlet.StreamAdapter class IdentityStreamAdapter : StreamAdapter> { override fun adapt(stream: Stream): Stream = stream - } diff --git a/scarlet-stream-adapter-builtin/src/test/java/com/tinder/scarlet/streamadapter/builtin/BuiltInStreamAdapterFactoryTest.kt b/scarlet-stream-adapter-builtin/src/test/java/com/tinder/scarlet/streamadapter/builtin/BuiltInStreamAdapterFactoryTest.kt index 7608f8e0..c1aff33a 100644 --- a/scarlet-stream-adapter-builtin/src/test/java/com/tinder/scarlet/streamadapter/builtin/BuiltInStreamAdapterFactoryTest.kt +++ b/scarlet-stream-adapter-builtin/src/test/java/com/tinder/scarlet/streamadapter/builtin/BuiltInStreamAdapterFactoryTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.streamadapter.builtin @@ -44,5 +44,4 @@ internal class BuiltInStreamAdapterFactoryTest { Collection::class.java ) } - } diff --git a/scarlet-stream-adapter-builtin/src/test/java/com/tinder/scarlet/streamadapter/builtin/IdentityStreamAdapterTest.kt b/scarlet-stream-adapter-builtin/src/test/java/com/tinder/scarlet/streamadapter/builtin/IdentityStreamAdapterTest.kt index 85e1b0d5..8cc1d049 100644 --- a/scarlet-stream-adapter-builtin/src/test/java/com/tinder/scarlet/streamadapter/builtin/IdentityStreamAdapterTest.kt +++ b/scarlet-stream-adapter-builtin/src/test/java/com/tinder/scarlet/streamadapter/builtin/IdentityStreamAdapterTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.streamadapter.builtin @@ -24,5 +24,4 @@ internal class IdentityStreamAdapterTest { // Then assertThat(adaptedStream).isSameAs(stream) } - } diff --git a/scarlet-stream-adapter-coroutines/build.gradle b/scarlet-stream-adapter-coroutines/build.gradle new file mode 100644 index 00000000..c96f46f3 --- /dev/null +++ b/scarlet-stream-adapter-coroutines/build.gradle @@ -0,0 +1,76 @@ +apply plugin: 'kotlin' +apply plugin: 'java-library' +apply plugin: 'org.jetbrains.dokka' +apply plugin: 'maven-publish' + +dependencies { + api rootProject.ext.kotlinCoroutines + api rootProject.ext.kotlinCoroutinesRxInterop + + implementation project(':scarlet-core') + implementation rootProject.ext.kotlinStdlib + + testImplementation project(':scarlet') + testImplementation project(':scarlet-websocket-mockwebserver') + testImplementation project(':scarlet-test-utils') + testImplementation rootProject.ext.junit + testImplementation rootProject.ext.mockito + testImplementation rootProject.ext.kotlinReflect + testImplementation rootProject.ext.assertJ +} + +kotlin { experimental { coroutines 'enable' } } + +dokka { + outputFormat = 'javadoc' + outputDirectory = "$buildDir/javadoc" +} + +task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.allSource +} + +task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) { + outputFormat = 'javadoc' + outputDirectory = javadoc.destinationDir +} + +task javadocJar(type: Jar, dependsOn: dokkaJavadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + +artifacts { + archives sourcesJar, javadocJar +} + +publishing { + publications { + mavenJava(MavenPublication) { + groupId 'com.tinder' + version version + artifactId project.getName() + artifact sourcesJar + artifact javadocJar + from components.java + } + } +} + +artifactory { + contextUrl = 'https://tinder.jfrog.io/tinder' + publish { + repository { + repoKey = 'libs-release-local' + username = System.getenv("ARTIFACTORY_USER") + password = System.getenv("ARTIFACTORY_PASSWORD") + maven = true + } + defaults { + publications('mavenJava') + publishArtifacts = true + publishPom = true + } + } +} diff --git a/scarlet-stream-adapter-coroutines/src/main/java/com/tinder/streamadapter/coroutines/CoroutinesStreamAdapterFactory.kt b/scarlet-stream-adapter-coroutines/src/main/java/com/tinder/streamadapter/coroutines/CoroutinesStreamAdapterFactory.kt new file mode 100644 index 00000000..85816d4b --- /dev/null +++ b/scarlet-stream-adapter-coroutines/src/main/java/com/tinder/streamadapter/coroutines/CoroutinesStreamAdapterFactory.kt @@ -0,0 +1,23 @@ +/* + * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + */ + +package com.tinder.streamadapter.coroutines + +import com.tinder.scarlet.StreamAdapter +import com.tinder.scarlet.utils.getRawType +import kotlinx.coroutines.experimental.channels.ReceiveChannel +import java.lang.reflect.Type + +/** + * A [stream adapter factory][StreamAdapter.Factory] that uses ReceiveChannel. + */ +class CoroutinesStreamAdapterFactory : StreamAdapter.Factory { + + override fun create(type: Type): StreamAdapter { + return when (type.getRawType()) { + ReceiveChannel::class.java -> ReceiveChannelStreamAdapter() + else -> throw IllegalArgumentException() + } + } +} \ No newline at end of file diff --git a/scarlet-stream-adapter-coroutines/src/main/java/com/tinder/streamadapter/coroutines/ReceiveChannelStreamAdapter.kt b/scarlet-stream-adapter-coroutines/src/main/java/com/tinder/streamadapter/coroutines/ReceiveChannelStreamAdapter.kt new file mode 100644 index 00000000..0cbe36be --- /dev/null +++ b/scarlet-stream-adapter-coroutines/src/main/java/com/tinder/streamadapter/coroutines/ReceiveChannelStreamAdapter.kt @@ -0,0 +1,15 @@ +/* + * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + */ + +package com.tinder.streamadapter.coroutines + +import com.tinder.scarlet.Stream +import com.tinder.scarlet.StreamAdapter +import kotlinx.coroutines.experimental.channels.ReceiveChannel +import kotlinx.coroutines.experimental.reactive.openSubscription + +class ReceiveChannelStreamAdapter : StreamAdapter> { + + override fun adapt(stream: Stream) = stream.openSubscription() +} \ No newline at end of file diff --git a/scarlet-stream-adapter-coroutines/src/test/java/com/tinder/scarlet/streamadapter/coroutines/ReceiveChannelTest.kt b/scarlet-stream-adapter-coroutines/src/test/java/com/tinder/scarlet/streamadapter/coroutines/ReceiveChannelTest.kt new file mode 100644 index 00000000..e39d44aa --- /dev/null +++ b/scarlet-stream-adapter-coroutines/src/test/java/com/tinder/scarlet/streamadapter/coroutines/ReceiveChannelTest.kt @@ -0,0 +1,152 @@ +/* + * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + */ + +package com.tinder.scarlet.streamadapter.coroutines + +import com.tinder.scarlet.Lifecycle +import com.tinder.scarlet.Scarlet +import com.tinder.scarlet.Stream +import com.tinder.scarlet.WebSocket +import com.tinder.scarlet.lifecycle.LifecycleRegistry +import com.tinder.scarlet.testutils.TestStreamObserver +import com.tinder.scarlet.testutils.any +import com.tinder.scarlet.testutils.test +import com.tinder.scarlet.testutils.containingText +import com.tinder.scarlet.testutils.containingBytes +import com.tinder.scarlet.websocket.mockwebserver.newWebSocketFactory +import com.tinder.scarlet.websocket.okhttp.newWebSocketFactory +import com.tinder.scarlet.ws.Receive +import com.tinder.scarlet.ws.Send +import com.tinder.streamadapter.coroutines.CoroutinesStreamAdapterFactory +import kotlinx.coroutines.experimental.runBlocking +import kotlinx.coroutines.experimental.channels.ReceiveChannel +import okhttp3.OkHttpClient +import okhttp3.mockwebserver.MockWebServer +import org.assertj.core.api.Assertions.assertThat +import org.junit.Rule +import org.junit.Test +import java.util.concurrent.TimeUnit + +class ReceiveChannelTest { + + @get:Rule + private val mockWebServer = MockWebServer() + private val serverUrlString by lazy { mockWebServer.url("/").toString() } + + private val serverLifecycleRegistry = LifecycleRegistry() + private lateinit var server: Service + private lateinit var serverEventObserver: TestStreamObserver + + private val clientLifecycleRegistry = LifecycleRegistry() + private lateinit var client: Service + private lateinit var clientEventObserver: TestStreamObserver + + @Test + fun send_givenConnectionIsEstablished_shouldBeReceivedByTheServer() { + // Given + givenConnectionIsEstablished() + val textMessage1 = "Hello" + val textMessage2 = "Hi" + val bytesMessage1 = "Yo".toByteArray() + val bytesMessage2 = "Sup".toByteArray() + val testTextChannel = server.observeText() + val testBytesChannel = server.observeBytes() + + // When + client.sendText(textMessage1) + val isSendTextSuccessful = client.sendTextAndConfirm(textMessage2) + client.sendBytes(bytesMessage1) + val isSendBytesSuccessful = client.sendBytesAndConfirm(bytesMessage2) + + // Then + assertThat(isSendTextSuccessful).isTrue() + assertThat(isSendBytesSuccessful).isTrue() + + serverEventObserver.awaitValues( + any>(), + any().containingText(textMessage1), + any().containingText(textMessage2), + any().containingBytes(bytesMessage1), + any().containingBytes(bytesMessage2) + ) + + runBlocking { + assertThat(testTextChannel.receiveOrNull()).isEqualTo(textMessage1) + assertThat(testTextChannel.receiveOrNull()).isEqualTo(textMessage2) + + assertThat(testBytesChannel.receiveOrNull()).isEqualTo(bytesMessage1) + assertThat(testBytesChannel.receiveOrNull()).isEqualTo(bytesMessage2) + } + } + + private fun givenConnectionIsEstablished() { + createClientAndServer() + serverLifecycleRegistry.onNext(Lifecycle.State.Started) + clientLifecycleRegistry.onNext(Lifecycle.State.Started) + blockUntilConnectionIsEstablish() + } + + private fun createClientAndServer() { + server = createServer() + serverEventObserver = server.observeEvents().test() + client = createClient() + clientEventObserver = client.observeEvents().test() + } + + private fun createServer(): Service { + val webSocketFactory = mockWebServer.newWebSocketFactory() + val scarlet = Scarlet.Builder() + .webSocketFactory(webSocketFactory) + .lifecycle(serverLifecycleRegistry) + .addStreamAdapterFactory(CoroutinesStreamAdapterFactory()) + .build() + return scarlet.create() + } + + private fun createClient(): Service { + val okHttpClient = OkHttpClient.Builder() + .writeTimeout(500, TimeUnit.MILLISECONDS) + .readTimeout(500, TimeUnit.MILLISECONDS) + .build() + val webSocketFactory = okHttpClient.newWebSocketFactory(serverUrlString) + val scarlet = Scarlet.Builder() + .webSocketFactory(webSocketFactory) + .lifecycle(clientLifecycleRegistry) + .addStreamAdapterFactory(CoroutinesStreamAdapterFactory()) + .build() + return scarlet.create() + } + + private fun blockUntilConnectionIsEstablish() { + clientEventObserver.awaitValues( + any>() + ) + serverEventObserver.awaitValues( + any>() + ) + } + + private interface Service { + @Receive + fun observeEvents(): Stream + + @Receive + fun observeText(): ReceiveChannel + + @Receive + fun observeBytes(): ReceiveChannel + + @Send + fun sendText(message: String) + + @Send + fun sendTextAndConfirm(message: String): Boolean + + @Send + fun sendBytes(message: ByteArray) + + @Send + fun sendBytesAndConfirm(message: ByteArray): Boolean + } +} \ No newline at end of file diff --git a/scarlet-stream-adapter-rxjava/build.gradle b/scarlet-stream-adapter-rxjava/build.gradle index f4fbd2b7..1145c482 100755 --- a/scarlet-stream-adapter-rxjava/build.gradle +++ b/scarlet-stream-adapter-rxjava/build.gradle @@ -45,7 +45,7 @@ artifacts { publishing { publications { mavenJava(MavenPublication) { - groupId 'com.tinder.scarlet' + groupId 'com.tinder' version version artifactId project.getName() artifact sourcesJar diff --git a/scarlet-stream-adapter-rxjava/src/main/java/com/tinder/scarlet/streamadapter/rxjava/ObservableStreamAdapter.kt b/scarlet-stream-adapter-rxjava/src/main/java/com/tinder/scarlet/streamadapter/rxjava/ObservableStreamAdapter.kt index 7edb9955..874feb7d 100644 --- a/scarlet-stream-adapter-rxjava/src/main/java/com/tinder/scarlet/streamadapter/rxjava/ObservableStreamAdapter.kt +++ b/scarlet-stream-adapter-rxjava/src/main/java/com/tinder/scarlet/streamadapter/rxjava/ObservableStreamAdapter.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.streamadapter.rxjava @@ -35,5 +35,4 @@ class ObservableStreamAdapter : StreamAdapter> { } } } - } diff --git a/scarlet-stream-adapter-rxjava/src/main/java/com/tinder/scarlet/streamadapter/rxjava/RxJavaStreamAdapterFactory.kt b/scarlet-stream-adapter-rxjava/src/main/java/com/tinder/scarlet/streamadapter/rxjava/RxJavaStreamAdapterFactory.kt index 83653ce7..92bcaee0 100755 --- a/scarlet-stream-adapter-rxjava/src/main/java/com/tinder/scarlet/streamadapter/rxjava/RxJavaStreamAdapterFactory.kt +++ b/scarlet-stream-adapter-rxjava/src/main/java/com/tinder/scarlet/streamadapter/rxjava/RxJavaStreamAdapterFactory.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.streamadapter.rxjava @@ -18,5 +18,4 @@ class RxJavaStreamAdapterFactory : StreamAdapter.Factory { Observable::class.java -> ObservableStreamAdapter() else -> throw IllegalArgumentException() } - } diff --git a/scarlet-stream-adapter-rxjava/src/test/java/com/tinder/scarlet/streamadapter/rxjava/ObservableTest.kt b/scarlet-stream-adapter-rxjava/src/test/java/com/tinder/scarlet/streamadapter/rxjava/ObservableTest.kt index 6a1d2520..66c847fe 100644 --- a/scarlet-stream-adapter-rxjava/src/test/java/com/tinder/scarlet/streamadapter/rxjava/ObservableTest.kt +++ b/scarlet-stream-adapter-rxjava/src/test/java/com/tinder/scarlet/streamadapter/rxjava/ObservableTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.streamadapter.rxjava diff --git a/scarlet-stream-adapter-rxjava2/build.gradle b/scarlet-stream-adapter-rxjava2/build.gradle index 97754282..52f79154 100755 --- a/scarlet-stream-adapter-rxjava2/build.gradle +++ b/scarlet-stream-adapter-rxjava2/build.gradle @@ -45,7 +45,7 @@ artifacts { publishing { publications { mavenJava(MavenPublication) { - groupId 'com.tinder.scarlet' + groupId 'com.tinder' version version artifactId project.getName() artifact sourcesJar diff --git a/scarlet-stream-adapter-rxjava2/src/main/java/com/tinder/scarlet/streamadapter/rxjava2/FlowableStreamAdapter.kt b/scarlet-stream-adapter-rxjava2/src/main/java/com/tinder/scarlet/streamadapter/rxjava2/FlowableStreamAdapter.kt index 08b9763a..b903d7ff 100644 --- a/scarlet-stream-adapter-rxjava2/src/main/java/com/tinder/scarlet/streamadapter/rxjava2/FlowableStreamAdapter.kt +++ b/scarlet-stream-adapter-rxjava2/src/main/java/com/tinder/scarlet/streamadapter/rxjava2/FlowableStreamAdapter.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.streamadapter.rxjava2 @@ -11,5 +11,4 @@ import io.reactivex.Flowable class FlowableStreamAdapter : StreamAdapter> { override fun adapt(stream: Stream): Flowable = Flowable.fromPublisher(stream) - } diff --git a/scarlet-stream-adapter-rxjava2/src/main/java/com/tinder/scarlet/streamadapter/rxjava2/ObservableStreamAdapter.kt b/scarlet-stream-adapter-rxjava2/src/main/java/com/tinder/scarlet/streamadapter/rxjava2/ObservableStreamAdapter.kt index 09f50a77..51c20fb5 100644 --- a/scarlet-stream-adapter-rxjava2/src/main/java/com/tinder/scarlet/streamadapter/rxjava2/ObservableStreamAdapter.kt +++ b/scarlet-stream-adapter-rxjava2/src/main/java/com/tinder/scarlet/streamadapter/rxjava2/ObservableStreamAdapter.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.streamadapter.rxjava2 @@ -11,5 +11,4 @@ import io.reactivex.Observable class ObservableStreamAdapter : StreamAdapter> { override fun adapt(stream: Stream): Observable = Observable.fromPublisher(stream) - } diff --git a/scarlet-stream-adapter-rxjava2/src/main/java/com/tinder/scarlet/streamadapter/rxjava2/RxJava2StreamAdapterFactory.kt b/scarlet-stream-adapter-rxjava2/src/main/java/com/tinder/scarlet/streamadapter/rxjava2/RxJava2StreamAdapterFactory.kt index 82e3ce18..cc871daf 100755 --- a/scarlet-stream-adapter-rxjava2/src/main/java/com/tinder/scarlet/streamadapter/rxjava2/RxJava2StreamAdapterFactory.kt +++ b/scarlet-stream-adapter-rxjava2/src/main/java/com/tinder/scarlet/streamadapter/rxjava2/RxJava2StreamAdapterFactory.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.streamadapter.rxjava2 diff --git a/scarlet-stream-adapter-rxjava2/src/test/java/com/tinder/scarlet/streamadapter/rxjava2/FlowableTest.kt b/scarlet-stream-adapter-rxjava2/src/test/java/com/tinder/scarlet/streamadapter/rxjava2/FlowableTest.kt index e245fcde..c4d18b9f 100644 --- a/scarlet-stream-adapter-rxjava2/src/test/java/com/tinder/scarlet/streamadapter/rxjava2/FlowableTest.kt +++ b/scarlet-stream-adapter-rxjava2/src/test/java/com/tinder/scarlet/streamadapter/rxjava2/FlowableTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.streamadapter.rxjava2 diff --git a/scarlet-stream-adapter-rxjava2/src/test/java/com/tinder/scarlet/streamadapter/rxjava2/ObservableTest.kt b/scarlet-stream-adapter-rxjava2/src/test/java/com/tinder/scarlet/streamadapter/rxjava2/ObservableTest.kt index 28c36566..9cc0361a 100644 --- a/scarlet-stream-adapter-rxjava2/src/test/java/com/tinder/scarlet/streamadapter/rxjava2/ObservableTest.kt +++ b/scarlet-stream-adapter-rxjava2/src/test/java/com/tinder/scarlet/streamadapter/rxjava2/ObservableTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.streamadapter.rxjava2 @@ -140,5 +140,4 @@ class ObservableTest { @Send fun sendBytesAndConfirm(message: ByteArray): Boolean } - } diff --git a/scarlet-test-utils/build.gradle b/scarlet-test-utils/build.gradle index d633d7f0..9d7ae68b 100644 --- a/scarlet-test-utils/build.gradle +++ b/scarlet-test-utils/build.gradle @@ -37,7 +37,7 @@ artifacts { publishing { publications { mavenJava(MavenPublication) { - groupId 'com.tinder.scarlet' + groupId 'com.tinder' version version artifactId project.getName() artifact sourcesJar diff --git a/scarlet-test-utils/src/main/java/com/tinder/scarlet/testutils/TestStreamObserver.kt b/scarlet-test-utils/src/main/java/com/tinder/scarlet/testutils/TestStreamObserver.kt index 77caa35c..0057baf5 100644 --- a/scarlet-test-utils/src/main/java/com/tinder/scarlet/testutils/TestStreamObserver.kt +++ b/scarlet-test-utils/src/main/java/com/tinder/scarlet/testutils/TestStreamObserver.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.testutils diff --git a/scarlet-test-utils/src/main/java/com/tinder/scarlet/testutils/TestUtils.kt b/scarlet-test-utils/src/main/java/com/tinder/scarlet/testutils/TestUtils.kt index ff7d5760..7869e661 100644 --- a/scarlet-test-utils/src/main/java/com/tinder/scarlet/testutils/TestUtils.kt +++ b/scarlet-test-utils/src/main/java/com/tinder/scarlet/testutils/TestUtils.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ @file:JvmName("TestUtils") diff --git a/scarlet-test-utils/src/main/java/com/tinder/scarlet/testutils/ValueAssert.kt b/scarlet-test-utils/src/main/java/com/tinder/scarlet/testutils/ValueAssert.kt index 0967072b..478b1705 100644 --- a/scarlet-test-utils/src/main/java/com/tinder/scarlet/testutils/ValueAssert.kt +++ b/scarlet-test-utils/src/main/java/com/tinder/scarlet/testutils/ValueAssert.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.testutils diff --git a/scarlet-websocket-mockwebserver/build.gradle b/scarlet-websocket-mockwebserver/build.gradle index b0c22ae0..d6ab5691 100644 --- a/scarlet-websocket-mockwebserver/build.gradle +++ b/scarlet-websocket-mockwebserver/build.gradle @@ -36,7 +36,7 @@ artifacts { publishing { publications { mavenJava(MavenPublication) { - groupId 'com.tinder.scarlet' + groupId 'com.tinder' version version artifactId project.getName() artifact sourcesJar diff --git a/scarlet-websocket-mockwebserver/src/main/java/com/tinder/scarlet/websocket/mockwebserver/MockWebServerOkHttpWebSocketConnectionEstablisher.kt b/scarlet-websocket-mockwebserver/src/main/java/com/tinder/scarlet/websocket/mockwebserver/MockWebServerOkHttpWebSocketConnectionEstablisher.kt index bf2bc157..b6bff575 100644 --- a/scarlet-websocket-mockwebserver/src/main/java/com/tinder/scarlet/websocket/mockwebserver/MockWebServerOkHttpWebSocketConnectionEstablisher.kt +++ b/scarlet-websocket-mockwebserver/src/main/java/com/tinder/scarlet/websocket/mockwebserver/MockWebServerOkHttpWebSocketConnectionEstablisher.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.websocket.mockwebserver @@ -16,5 +16,4 @@ class MockWebServerOkHttpWebSocketConnectionEstablisher( override fun establishConnection(webSocketListener: WebSocketListener) { mockWebServer.enqueue(MockResponse().withWebSocketUpgrade(webSocketListener)) } - } diff --git a/scarlet-websocket-mockwebserver/src/main/java/com/tinder/scarlet/websocket/mockwebserver/MockWebServerUtils.kt b/scarlet-websocket-mockwebserver/src/main/java/com/tinder/scarlet/websocket/mockwebserver/MockWebServerUtils.kt index 9969265e..d471df33 100644 --- a/scarlet-websocket-mockwebserver/src/main/java/com/tinder/scarlet/websocket/mockwebserver/MockWebServerUtils.kt +++ b/scarlet-websocket-mockwebserver/src/main/java/com/tinder/scarlet/websocket/mockwebserver/MockWebServerUtils.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ @file:JvmName("MockWebServerUtils") @@ -12,4 +12,3 @@ import okhttp3.mockwebserver.MockWebServer fun MockWebServer.newWebSocketFactory(): WebSocket.Factory = OkHttpWebSocket.Factory(MockWebServerOkHttpWebSocketConnectionEstablisher(this)) - diff --git a/scarlet-websocket-okhttp/build.gradle b/scarlet-websocket-okhttp/build.gradle index 0b5940ed..af62581d 100644 --- a/scarlet-websocket-okhttp/build.gradle +++ b/scarlet-websocket-okhttp/build.gradle @@ -47,7 +47,7 @@ artifacts { publishing { publications { mavenJava(MavenPublication) { - groupId 'com.tinder.scarlet' + groupId 'com.tinder' version version artifactId project.getName() artifact sourcesJar diff --git a/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpClientUtils.kt b/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpClientUtils.kt index 03c58c2a..c28d7c8a 100644 --- a/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpClientUtils.kt +++ b/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpClientUtils.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ @file:JvmName("OkHttpClientUtils") diff --git a/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpClientWebSocketConnectionEstablisher.kt b/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpClientWebSocketConnectionEstablisher.kt index 5b901b11..f0a864f2 100644 --- a/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpClientWebSocketConnectionEstablisher.kt +++ b/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpClientWebSocketConnectionEstablisher.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.websocket.okhttp @@ -17,5 +17,4 @@ class OkHttpClientWebSocketConnectionEstablisher( val request = requestFactory.createRequest() okHttpClient.newWebSocket(request, webSocketListener) } - } diff --git a/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocket.kt b/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocket.kt index ddfd1890..0b1cd9dc 100644 --- a/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocket.kt +++ b/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocket.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.websocket.okhttp diff --git a/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketEventObserver.kt b/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketEventObserver.kt index f2596bdc..1e3e3bb8 100644 --- a/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketEventObserver.kt +++ b/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketEventObserver.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.websocket.okhttp @@ -37,5 +37,4 @@ internal class OkHttpWebSocketEventObserver : WebSocketListener() { override fun onFailure(webSocket: okhttp3.WebSocket, t: Throwable, response: Response?) = processor.onNext(WebSocket.Event.OnConnectionFailed(t)) - } diff --git a/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketHolder.kt b/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketHolder.kt index 604fe1de..f98f3e52 100644 --- a/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketHolder.kt +++ b/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketHolder.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.websocket.okhttp diff --git a/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/request/RequestFactory.kt b/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/request/RequestFactory.kt index e9942a2d..6bbe4fb0 100644 --- a/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/request/RequestFactory.kt +++ b/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/request/RequestFactory.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.websocket.okhttp.request diff --git a/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/request/StaticUrlRequestFactory.kt b/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/request/StaticUrlRequestFactory.kt index a9b80f14..71ab2fcb 100644 --- a/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/request/StaticUrlRequestFactory.kt +++ b/scarlet-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/request/StaticUrlRequestFactory.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.websocket.okhttp.request @@ -16,5 +16,4 @@ internal class StaticUrlRequestFactory( override fun createRequest(): Request = Request.Builder() .url(url) .build() - } diff --git a/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketEventObserverTest.kt b/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketEventObserverTest.kt index f35d120a..782cda3b 100644 --- a/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketEventObserverTest.kt +++ b/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketEventObserverTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.websocket.okhttp @@ -51,5 +51,4 @@ internal class OkHttpWebSocketEventObserverTest { WebSocket.Event.OnConnectionFailed(throwable) ) } - } diff --git a/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketHolderTest.kt b/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketHolderTest.kt index b2df9dea..cebd341b 100644 --- a/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketHolderTest.kt +++ b/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketHolderTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.websocket.okhttp diff --git a/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketIntegrationTest.kt b/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketIntegrationTest.kt index 7452591c..c588f207 100644 --- a/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketIntegrationTest.kt +++ b/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketIntegrationTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.websocket.okhttp @@ -233,5 +233,4 @@ internal class OkHttpWebSocketIntegrationTest { @Send fun sendBytesAndConfirm(message: ByteArray): Boolean } - } diff --git a/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketTest.kt b/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketTest.kt index 49b60c37..41be8553 100644 --- a/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketTest.kt +++ b/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.websocket.okhttp @@ -180,5 +180,4 @@ internal class OkHttpWebSocketTest { // Then then(webSocketHolder).should().cancel() } - } diff --git a/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/request/StaticUrlRequestFactoryTest.kt b/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/request/StaticUrlRequestFactoryTest.kt index a1bd9572..1fa676e9 100644 --- a/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/request/StaticUrlRequestFactoryTest.kt +++ b/scarlet-websocket-okhttp/src/test/java/com/tinder/scarlet/websocket/okhttp/request/StaticUrlRequestFactoryTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.websocket.okhttp.request @@ -21,5 +21,4 @@ internal class StaticUrlRequestFactoryTest { // Then assertThat(request1.url()).isEqualTo(request2.url()) } - } diff --git a/scarlet/build.gradle b/scarlet/build.gradle index f8895ec9..fc05b06c 100644 --- a/scarlet/build.gradle +++ b/scarlet/build.gradle @@ -53,7 +53,7 @@ artifacts { publishing { publications { mavenJava(MavenPublication) { - groupId 'com.tinder.scarlet' + groupId 'com.tinder' version version artifactId project.getName() artifact sourcesJar diff --git a/scarlet/src/main/java/com/tinder/scarlet/Event.kt b/scarlet/src/main/java/com/tinder/scarlet/Event.kt index ae94a77e..dc3dfdf6 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/Event.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/Event.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet diff --git a/scarlet/src/main/java/com/tinder/scarlet/Scarlet.kt b/scarlet/src/main/java/com/tinder/scarlet/Scarlet.kt index dbe5c893..1801e277 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/Scarlet.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/Scarlet.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet @@ -199,5 +199,4 @@ class Scarlet internal constructor( private val DEFAULT_SCHEDULER = Schedulers.computation() // TODO same thread option for debugging } } - } diff --git a/scarlet/src/main/java/com/tinder/scarlet/Session.kt b/scarlet/src/main/java/com/tinder/scarlet/Session.kt index 50fdc1d3..fe9770aa 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/Session.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/Session.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet diff --git a/scarlet/src/main/java/com/tinder/scarlet/State.kt b/scarlet/src/main/java/com/tinder/scarlet/State.kt index 52501699..ecd4dd1f 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/State.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/State.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet diff --git a/scarlet/src/main/java/com/tinder/scarlet/internal/Service.kt b/scarlet/src/main/java/com/tinder/scarlet/internal/Service.kt index 001ca584..bc9f8f5d 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/internal/Service.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/internal/Service.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal diff --git a/scarlet/src/main/java/com/tinder/scarlet/internal/connection/Connection.kt b/scarlet/src/main/java/com/tinder/scarlet/internal/connection/Connection.kt index 321667ab..f5cde9f7 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/internal/connection/Connection.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/internal/connection/Connection.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.connection @@ -218,5 +218,4 @@ internal class Connection( private fun createSharedLifecycle() = LifecycleRegistry() .apply { lifecycle.subscribe(this) } } - } diff --git a/scarlet/src/main/java/com/tinder/scarlet/internal/connection/subscriber/LifecycleStateSubscriber.kt b/scarlet/src/main/java/com/tinder/scarlet/internal/connection/subscriber/LifecycleStateSubscriber.kt index 09a0dfad..97744896 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/internal/connection/subscriber/LifecycleStateSubscriber.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/internal/connection/subscriber/LifecycleStateSubscriber.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.connection.subscriber diff --git a/scarlet/src/main/java/com/tinder/scarlet/internal/connection/subscriber/RetryTimerSubscriber.kt b/scarlet/src/main/java/com/tinder/scarlet/internal/connection/subscriber/RetryTimerSubscriber.kt index 146a2994..6f13eab7 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/internal/connection/subscriber/RetryTimerSubscriber.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/internal/connection/subscriber/RetryTimerSubscriber.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.connection.subscriber diff --git a/scarlet/src/main/java/com/tinder/scarlet/internal/connection/subscriber/WebSocketEventSubscriber.kt b/scarlet/src/main/java/com/tinder/scarlet/internal/connection/subscriber/WebSocketEventSubscriber.kt index fcf17908..83751be4 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/internal/connection/subscriber/WebSocketEventSubscriber.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/internal/connection/subscriber/WebSocketEventSubscriber.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.connection.subscriber diff --git a/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/EventMapper.kt b/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/EventMapper.kt index 5a27d25c..81f60058 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/EventMapper.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/EventMapper.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.servicemethod @@ -127,7 +127,8 @@ internal sealed class EventMapper { } private fun resolveMessageAdapter( - returnType: ParameterizedType, annotations: Array + returnType: ParameterizedType, + annotations: Array ): MessageAdapter { val receivingType = returnType.getFirstTypeArgument() val messageType = when (receivingType.getRawType()) { @@ -136,7 +137,6 @@ internal sealed class EventMapper { } return messageAdapterResolver.resolve(messageType, annotations) } - } companion object { diff --git a/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/MessageAdapterResolver.kt b/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/MessageAdapterResolver.kt index 34e3bbd5..f5141b95 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/MessageAdapterResolver.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/MessageAdapterResolver.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.servicemethod diff --git a/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/ServiceMethod.kt b/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/ServiceMethod.kt index 5fe4a7e6..21ba9cbb 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/ServiceMethod.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/ServiceMethod.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.servicemethod @@ -106,5 +106,4 @@ internal sealed class ServiceMethod { private fun Method.getFirstParameterAnnotations(): Array = parameterAnnotations.first() } - } diff --git a/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutor.kt b/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutor.kt index a822f8e6..bd3decc6 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutor.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutor.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.servicemethod @@ -53,6 +53,5 @@ internal class ServiceMethodExecutor( is Receive -> receiveServiceMethodFactory else -> null } - } } diff --git a/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/StreamAdapterResolver.kt b/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/StreamAdapterResolver.kt index a9fce1df..26b358f8 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/StreamAdapterResolver.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/internal/servicemethod/StreamAdapterResolver.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.servicemethod @@ -25,5 +25,4 @@ internal class StreamAdapterResolver( val compositeException = CompositeException(*throwables.toTypedArray()) throw IllegalStateException("Cannot resolve stream adapter for type $type.", compositeException) } - } diff --git a/scarlet/src/main/java/com/tinder/scarlet/internal/utils/RuntimePlatform.kt b/scarlet/src/main/java/com/tinder/scarlet/internal/utils/RuntimePlatform.kt index 29724141..990d51b7 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/internal/utils/RuntimePlatform.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/internal/utils/RuntimePlatform.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.utils @@ -12,7 +12,10 @@ internal sealed class RuntimePlatform { open fun isDefaultMethod(method: Method): Boolean = false open fun invokeDefaultMethod( - method: Method, declaringClass: Class<*>, proxy: Any, vararg args: Array? + method: Method, + declaringClass: Class<*>, + proxy: Any, + vararg args: Array? ): Any = throw UnsupportedOperationException() @@ -22,7 +25,10 @@ internal sealed class RuntimePlatform { override fun isDefaultMethod(method: Method): Boolean = method.isDefault override fun invokeDefaultMethod( - method: Method, declaringClass: Class<*>, proxy: Any, vararg args: Array? + method: Method, + declaringClass: Class<*>, + proxy: Any, + vararg args: Array? ): Any { // Because the service interface might not be public, we need to use a MethodHandle lookup // that ignores the visibility of the declaringClass. diff --git a/scarlet/src/main/java/com/tinder/scarlet/lifecycle/DefaultLifecycle.kt b/scarlet/src/main/java/com/tinder/scarlet/lifecycle/DefaultLifecycle.kt index bb0130cb..3e9e1f28 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/lifecycle/DefaultLifecycle.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/lifecycle/DefaultLifecycle.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.lifecycle @@ -13,5 +13,4 @@ internal class DefaultLifecycle( init { lifecycleRegistry.onNext(Lifecycle.State.Started) } - } diff --git a/scarlet/src/main/java/com/tinder/scarlet/lifecycle/FlowableLifecycle.kt b/scarlet/src/main/java/com/tinder/scarlet/lifecycle/FlowableLifecycle.kt index e007b882..6cd969fa 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/lifecycle/FlowableLifecycle.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/lifecycle/FlowableLifecycle.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.lifecycle @@ -26,5 +26,4 @@ internal class FlowableLifecycle( .map(List>::combine) return FlowableLifecycle(flowable, scheduler) } - } diff --git a/scarlet/src/main/java/com/tinder/scarlet/lifecycle/LifecycleRegistry.kt b/scarlet/src/main/java/com/tinder/scarlet/lifecycle/LifecycleRegistry.kt index 1d96726f..c3796b97 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/lifecycle/LifecycleRegistry.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/lifecycle/LifecycleRegistry.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.lifecycle @@ -78,4 +78,3 @@ class LifecycleRegistry internal constructor( } } } - diff --git a/scarlet/src/main/java/com/tinder/scarlet/lifecycle/LifecycleStateUtils.kt b/scarlet/src/main/java/com/tinder/scarlet/lifecycle/LifecycleStateUtils.kt index 9168aedc..bb8e13f2 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/lifecycle/LifecycleStateUtils.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/lifecycle/LifecycleStateUtils.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.lifecycle diff --git a/scarlet/src/main/java/com/tinder/scarlet/retry/BackoffStrategy.kt b/scarlet/src/main/java/com/tinder/scarlet/retry/BackoffStrategy.kt index 70c36d69..065089ac 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/retry/BackoffStrategy.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/retry/BackoffStrategy.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.retry diff --git a/scarlet/src/main/java/com/tinder/scarlet/retry/ExponentialBackoffStrategy.kt b/scarlet/src/main/java/com/tinder/scarlet/retry/ExponentialBackoffStrategy.kt index ee2753a5..41e8c0d4 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/retry/ExponentialBackoffStrategy.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/retry/ExponentialBackoffStrategy.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.retry @@ -21,5 +21,4 @@ class ExponentialBackoffStrategy( initialDurationMillis.toDouble() * Math.pow(2.0, retryCount.toDouble()) ) .toLong() - } diff --git a/scarlet/src/main/java/com/tinder/scarlet/retry/ExponentialWithJitterBackoffStrategy.kt b/scarlet/src/main/java/com/tinder/scarlet/retry/ExponentialWithJitterBackoffStrategy.kt index 1f3dfa24..bdb0a7b0 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/retry/ExponentialWithJitterBackoffStrategy.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/retry/ExponentialWithJitterBackoffStrategy.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.retry @@ -25,5 +25,4 @@ class ExponentialWithJitterBackoffStrategy( private fun Long.withJitter(): Long = (0..this).random() private fun ClosedRange.random() = random.nextInt((endInclusive - start).toInt()) + start - } diff --git a/scarlet/src/main/java/com/tinder/scarlet/retry/LinearBackoffStrategy.kt b/scarlet/src/main/java/com/tinder/scarlet/retry/LinearBackoffStrategy.kt index bfd449ed..2f4bfb76 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/retry/LinearBackoffStrategy.kt +++ b/scarlet/src/main/java/com/tinder/scarlet/retry/LinearBackoffStrategy.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.retry @@ -13,5 +13,4 @@ class LinearBackoffStrategy( } override fun backoffDurationMillisAt(retryCount: Int): Long = durationMillis - } diff --git a/scarlet/src/main/java/com/tinder/scarlet/ws/Receive.java b/scarlet/src/main/java/com/tinder/scarlet/ws/Receive.java index 7895f172..16b84bbb 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/ws/Receive.java +++ b/scarlet/src/main/java/com/tinder/scarlet/ws/Receive.java @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.ws; diff --git a/scarlet/src/main/java/com/tinder/scarlet/ws/Send.java b/scarlet/src/main/java/com/tinder/scarlet/ws/Send.java index 68f1d419..31f1739d 100644 --- a/scarlet/src/main/java/com/tinder/scarlet/ws/Send.java +++ b/scarlet/src/main/java/com/tinder/scarlet/ws/Send.java @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.ws; diff --git a/scarlet/src/test/java/com/tinder/scarlet/ScarletTest.kt b/scarlet/src/test/java/com/tinder/scarlet/ScarletTest.kt index b262b9eb..a98ae049 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/ScarletTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/ScarletTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/ServiceFactoryTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/ServiceFactoryTest.kt index 730c74fc..b13a98d0 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/ServiceFactoryTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/ServiceFactoryTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/ServiceTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/ServiceTest.kt index a3884803..7940b0f0 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/ServiceTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/ServiceTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/connection/ConnectionFactoryTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/connection/ConnectionFactoryTest.kt index 3e11ff7f..3b1e6d40 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/connection/ConnectionFactoryTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/connection/ConnectionFactoryTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.connection @@ -31,5 +31,4 @@ internal class ConnectionFactoryTest { // Then assertThat(connection1.stateManager.lifecycle).isEqualTo(connection2.stateManager.lifecycle) } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/connection/ConnectionStateManagerTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/connection/ConnectionStateManagerTest.kt index 2720d05c..b9a2bab4 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/connection/ConnectionStateManagerTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/connection/ConnectionStateManagerTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.connection diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/connection/ConnectionTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/connection/ConnectionTest.kt index 1aee4355..f1191c6a 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/connection/ConnectionTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/connection/ConnectionTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.connection @@ -61,5 +61,4 @@ internal class ConnectionTest { // Then then(webSocket).should().send(message) } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/connection/LifecycleStateSubscriberTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/connection/LifecycleStateSubscriberTest.kt index c4b81666..9866550c 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/connection/LifecycleStateSubscriberTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/connection/LifecycleStateSubscriberTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.connection @@ -80,5 +80,4 @@ internal class LifecycleStateSubscriberTest { assertThatExceptionOfType(RuntimeException::class.java) .isThrownBy { flowable.subscribe(lifecycleStateSubscriber) } } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/connection/RetryTimerSubscriberTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/connection/RetryTimerSubscriberTest.kt index 0b9a5c42..e0c9b40c 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/connection/RetryTimerSubscriberTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/connection/RetryTimerSubscriberTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.connection diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/connection/WebSocketEventSubscriberTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/connection/WebSocketEventSubscriberTest.kt index feec1ebe..cb66da34 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/connection/WebSocketEventSubscriberTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/connection/WebSocketEventSubscriberTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.connection @@ -56,5 +56,4 @@ internal class WebSocketEventSubscriberTest { assertThatExceptionOfType(RuntimeException::class.java) .isThrownBy { flowable.subscribe(webSocketEventSubscriber) } } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/EventMapperFactoryTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/EventMapperFactoryTest.kt index a254eaa1..30441816 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/EventMapperFactoryTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/EventMapperFactoryTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.servicemethod diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/EventMapperTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/EventMapperTest.kt index d8b84615..0dc59bd7 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/EventMapperTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/EventMapperTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.servicemethod @@ -389,6 +389,5 @@ internal class EventMapperTest { ON_LIFECYCLE_TERMINATED, ON_STATE_CHANGE_TO_DESTROYED ) - } } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/MessageAdapterResolverTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/MessageAdapterResolverTest.kt index 37e9f1cb..5941a8a2 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/MessageAdapterResolverTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/MessageAdapterResolverTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.servicemethod @@ -77,5 +77,4 @@ internal class MessageAdapterResolverTest { } .withMessageContaining("Cannot resolve message adapter") } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ReceiveServiceMethodFactoryTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ReceiveServiceMethodFactoryTest.kt index 09567041..2fa6a222 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ReceiveServiceMethodFactoryTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ReceiveServiceMethodFactoryTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.servicemethod @@ -196,5 +196,4 @@ internal class ReceiveServiceMethodFactoryTest { private inline fun param() = arrayOf(T::class.java.onlyMethod(), R::class.java) } } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ReceiveServiceMethodTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ReceiveServiceMethodTest.kt index c1e5e17d..13a161a7 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ReceiveServiceMethodTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ReceiveServiceMethodTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.servicemethod @@ -63,5 +63,4 @@ internal class ReceiveServiceMethodTest { then(eventMapper).should().mapToData(event2) testSubscriber.assertNotTerminated() } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/SendServiceMethodFactoryTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/SendServiceMethodFactoryTest.kt index dd9555eb..b10d1fd9 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/SendServiceMethodFactoryTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/SendServiceMethodFactoryTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.servicemethod @@ -140,5 +140,4 @@ internal class SendServiceMethodFactoryTest { private inline fun param() = arrayOf(T::class.java.onlyMethod()) } } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/SendServiceMethodTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/SendServiceMethodTest.kt index c1a584a2..0eda7ec4 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/SendServiceMethodTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/SendServiceMethodTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.servicemethod diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutorFactoryTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutorFactoryTest.kt index 1f2fcd53..a1b7c66f 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutorFactoryTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutorFactoryTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.servicemethod @@ -185,5 +185,4 @@ internal class ServiceMethodExecutorFactoryTest { arrayOf(T::class.java, numberOfSendMethods, numberOfReceiveMethods) } } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutorTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutorTest.kt index f0417f51..2c9151f7 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutorTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/ServiceMethodExecutorTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.servicemethod @@ -56,5 +56,4 @@ internal class ServiceMethodExecutorTest { serviceMethodExecutor.execute(notRegisteredMethod, arrayOf()) } } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/StreamAdapterResolverTest.kt b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/StreamAdapterResolverTest.kt index 21d2bfa4..e007ccfa 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/StreamAdapterResolverTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/internal/servicemethod/StreamAdapterResolverTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.internal.servicemethod diff --git a/scarlet/src/test/java/com/tinder/scarlet/lifecycle/DefaultLifecycleTest.kt b/scarlet/src/test/java/com/tinder/scarlet/lifecycle/DefaultLifecycleTest.kt index 35a70791..e77b21ce 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/lifecycle/DefaultLifecycleTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/lifecycle/DefaultLifecycleTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.lifecycle @@ -20,5 +20,4 @@ internal class DefaultLifecycleTest { // Then testSubscriber.assertValues(Lifecycle.State.Started) } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/lifecycle/FlowableLifecycleTest.kt b/scarlet/src/test/java/com/tinder/scarlet/lifecycle/FlowableLifecycleTest.kt index c81068d2..168a9c79 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/lifecycle/FlowableLifecycleTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/lifecycle/FlowableLifecycleTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.lifecycle @@ -46,5 +46,4 @@ class FlowableLifecycleTest { Lifecycle.State.Started ) } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/lifecycle/LifecycleRegistryBackpressureTest.kt b/scarlet/src/test/java/com/tinder/scarlet/lifecycle/LifecycleRegistryBackpressureTest.kt index a0dd7fbd..6cd2925f 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/lifecycle/LifecycleRegistryBackpressureTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/lifecycle/LifecycleRegistryBackpressureTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.lifecycle diff --git a/scarlet/src/test/java/com/tinder/scarlet/lifecycle/LifecycleRegistryTest.kt b/scarlet/src/test/java/com/tinder/scarlet/lifecycle/LifecycleRegistryTest.kt index 96c8988e..35887334 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/lifecycle/LifecycleRegistryTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/lifecycle/LifecycleRegistryTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.lifecycle @@ -235,5 +235,4 @@ internal class LifecycleRegistryTest { testSubscriber.assertValues(Lifecycle.State.Started, Lifecycle.State.Destroyed) testSubscriber.assertComplete() } - } diff --git a/scarlet/src/test/java/com/tinder/scarlet/retry/ExponentialBackoffStrategyTest.kt b/scarlet/src/test/java/com/tinder/scarlet/retry/ExponentialBackoffStrategyTest.kt index 8975fd20..1846bd06 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/retry/ExponentialBackoffStrategyTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/retry/ExponentialBackoffStrategyTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.retry @@ -44,7 +44,6 @@ internal class ExponentialBackoffStrategyTest { private fun param(baseDuration: Long, maxDuration: Long) = arrayOf(baseDuration, maxDuration) } - } @RunWith(Parameterized::class) diff --git a/scarlet/src/test/java/com/tinder/scarlet/retry/ExponentialBackoffWithJitterBackoffStrategyTest.kt b/scarlet/src/test/java/com/tinder/scarlet/retry/ExponentialBackoffWithJitterBackoffStrategyTest.kt index 48cbe234..6823114b 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/retry/ExponentialBackoffWithJitterBackoffStrategyTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/retry/ExponentialBackoffWithJitterBackoffStrategyTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.retry @@ -48,7 +48,6 @@ internal class ExponentialBackoffWithJitterBackoffStrategyTest { private fun param(baseDuration: Long, maxDuration: Long) = arrayOf(baseDuration, maxDuration) } - } @RunWith(Parameterized::class) @@ -227,7 +226,10 @@ internal class ExponentialBackoffWithJitterBackoffStrategyTest { ) private fun param( - baseDuration: Long, maxDuration: Long, jitterPercentage: Int, retryCount: Int, + baseDuration: Long, + maxDuration: Long, + jitterPercentage: Int, + retryCount: Int, expectedWaitDuration: Long ) = arrayOf(baseDuration, maxDuration, jitterPercentage, retryCount, expectedWaitDuration) diff --git a/scarlet/src/test/java/com/tinder/scarlet/retry/LinearBackoffStrategyTest.kt b/scarlet/src/test/java/com/tinder/scarlet/retry/LinearBackoffStrategyTest.kt index 69965386..0d852d9e 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/retry/LinearBackoffStrategyTest.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/retry/LinearBackoffStrategyTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.retry diff --git a/scarlet/src/test/java/com/tinder/scarlet/utils/ClassUtils.kt b/scarlet/src/test/java/com/tinder/scarlet/utils/ClassUtils.kt index 04902690..3096cd99 100644 --- a/scarlet/src/test/java/com/tinder/scarlet/utils/ClassUtils.kt +++ b/scarlet/src/test/java/com/tinder/scarlet/utils/ClassUtils.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.scarlet.utils diff --git a/settings.gradle b/settings.gradle index 083d08d2..a2d468d9 100644 --- a/settings.gradle +++ b/settings.gradle @@ -12,5 +12,6 @@ include ':scarlet-message-adapter-protobuf' include ':scarlet-message-adapter-gson' include ':scarlet-stream-adapter-rxjava' include ':scarlet-stream-adapter-rxjava2' +include ':scarlet-stream-adapter-coroutines' include ':scarlet-lifecycle-android' include ':demo' diff --git a/state-machine/build.gradle b/state-machine/build.gradle index a48f0bb1..f82245db 100644 --- a/state-machine/build.gradle +++ b/state-machine/build.gradle @@ -23,7 +23,7 @@ artifacts { publishing { publications { mavenJava(MavenPublication) { - groupId 'com.tinder.scarlet' + groupId 'com.tinder' version version artifactId project.getName() artifact sourcesJar diff --git a/state-machine/src/main/java/com/tinder/statemachine/StateMachine.kt b/state-machine/src/main/java/com/tinder/statemachine/StateMachine.kt index 8f7081ee..31abaca1 100644 --- a/state-machine/src/main/java/com/tinder/statemachine/StateMachine.kt +++ b/state-machine/src/main/java/com/tinder/statemachine/StateMachine.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.statemachine @@ -158,6 +158,4 @@ class StateMachine private constructor() { fun create(init: Builder.() -> Unit) = Builder().apply(init).build() } - } - diff --git a/state-machine/src/test/java/com/tinder/statemachine/StateMachineTest.kt b/state-machine/src/test/java/com/tinder/statemachine/StateMachineTest.kt index f8f11e21..82835f47 100644 --- a/state-machine/src/test/java/com/tinder/statemachine/StateMachineTest.kt +++ b/state-machine/src/test/java/com/tinder/statemachine/StateMachineTest.kt @@ -1,5 +1,5 @@ /* - * © 2013 - 2018 Tinder, Inc., ALL RIGHTS RESERVED + * © 2018 Match Group, LLC. */ package com.tinder.statemachine