Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
y9vad9 committed Sep 27, 2023
1 parent 4b063bf commit ec9df37
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rsocket-engine/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,8 @@ deployLibrary {

version = System.getenv("TIMEMATES_SDK_VERSION")
}
}

tasks.withType<Test> {
useJUnitPlatform()
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,24 @@ internal fun SerializableTimerState.sdk(): Timer.State {
publishTime = publishTime,
)
}
}

internal fun Timer.State.serializable(): SerializableTimerState {
return when (this) {
is Timer.State.ConfirmationWaiting -> SerializableTimerState.Confirmation(
endsAt.toEpochMilliseconds(), publishTime.toEpochMilliseconds(),
)
is Timer.State.Inactive -> SerializableTimerState.Inactive(
publishTime.toEpochMilliseconds(),
)
is Timer.State.Paused -> SerializableTimerState.Pause(
publishTime.toEpochMilliseconds(),
)
is Timer.State.Rest -> SerializableTimerState.Rest(
endsAt.toEpochMilliseconds(), publishTime.toEpochMilliseconds(),
)
is Timer.State.Running -> SerializableTimerState.Running(
endsAt.toEpochMilliseconds(), publishTime.toEpochMilliseconds(),
)
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.timemates.api.rsocket.timers.types

import io.timemates.api.rsocket.timers.sessions.types.SerializableTimerState
import io.timemates.api.rsocket.timers.sessions.types.sdk
import io.timemates.sdk.common.constructor.createOrThrow
import io.timemates.sdk.common.types.value.Count
import io.timemates.sdk.timers.types.Timer
Expand Down Expand Up @@ -29,5 +30,6 @@ internal fun SerializableTimer.sdk(): Timer {
ownerId = UserId.createOrThrow(ownerId),
membersCount = Count.createOrThrow(membersCount),
settings = settings.sdk(),
state = state.sdk()
)
}
4 changes: 4 additions & 0 deletions sdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@ deployLibrary {

version = System.getenv("TIMEMATES_SDK_VERSION")
}
}

tasks.withType<Test> {
useJUnitPlatform()
}

0 comments on commit ec9df37

Please sign in to comment.