Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
malliina committed Sep 7, 2023
1 parent db4cd51 commit 8deed0b
Show file tree
Hide file tree
Showing 91 changed files with 362 additions and 347 deletions.
35 changes: 16 additions & 19 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import java.nio.file.{Files, Path, Paths, StandardCopyOption}

import com.malliina.appbundler.FileMapping
import com.malliina.sbt.GenericKeys._
import com.malliina.sbt.filetree.DirMap
import com.malliina.sbt.mac.MacKeys._
import com.malliina.sbt.mac.MacPlugin.{Mac, macSettings}
import com.malliina.sbt.unix.LinuxKeys.{appHome, ciBuild, httpPort, httpsPort}
import com.malliina.sbt.unix.{LinuxPlugin => LinusPlugin}
import com.malliina.sbt.win.WinKeys.{msiMappings, useTerminateProcess, winSwExe, minJavaVersion}
import com.malliina.sbt.win.WinKeys.{minJavaVersion, msiMappings, useTerminateProcess, winSwExe}
import com.malliina.sbt.win.{WinKeys, WinPlugin}
import com.typesafe.sbt.SbtNativePackager.Windows
import com.typesafe.sbt.packager.Keys.{maintainer, packageSummary, rpmVendor}
import play.sbt.PlayImport
import play.sbt.routes.RoutesKeys
import sbt.Keys.scalaVersion
import sbt.util
import sbtbuildinfo.BuildInfoKey
import sbtbuildinfo.BuildInfoKeys.{buildInfoKeys, buildInfoPackage}
import sbtcrossproject.CrossPlugin.autoImport.{
Expand Down Expand Up @@ -45,7 +45,7 @@ val utilPlayVersion = "6.0.0"
val httpVersion = "4.5.13"
val mysqlVersion = "5.1.49"
val nvWebSocketVersion = "2.10"
val munitVersion = "0.7.20"
val munitVersion = "0.7.29"
val akkaStreamsVersion = "2.6.1"

val malliinaGroup = "com.malliina"
Expand All @@ -55,7 +55,7 @@ val logstreamsDep = malliinaGroup %% "logstreams-client" % "1.10.1"

val httpGroup = "org.apache.httpcomponents"

scalaVersion in ThisBuild := "2.13.2"
ThisBuild / scalaVersion := "2.13.12"

val utilAudio = Project("util-audio", file("util-audio"))
.enablePlugins(MavenCentralPlugin)
Expand Down Expand Up @@ -96,7 +96,7 @@ val crossJvm = cross.jvm
val crossJs = cross.js
.enablePlugins(ScalaJSBundlerPlugin, ScalaJSWeb)
.settings(
npmDependencies in Compile ++= Seq(
Compile / npmDependencies ++= Seq(
"jquery" -> "3.3.1",
"jquery-ui" -> "1.12.1"
)
Expand Down Expand Up @@ -195,9 +195,9 @@ val musicmeta = project
Linux / httpPort := Option("disabled"),
Linux / httpsPort := Option("8460"),
maintainer := "Michael Skogberg <[email protected]>",
javaOptions in Universal ++= {
val linuxName = (name in Linux).value
val metaHome = (appHome in Linux).value
Universal / javaOptions ++= {
val linuxName = (Linux / name).value
val metaHome = (Linux / appHome).value
Seq(
s"-Ddiscogs.oauth=/etc/$linuxName/discogs-oauth.key",
s"-Dgoogle.oauth=/etc/$linuxName/google-oauth.key",
Expand All @@ -210,7 +210,7 @@ val musicmeta = project
},
pipelineStages := Seq(digest, gzip),
buildInfoKeys ++= Seq[BuildInfoKey](
"frontName" -> (name in musicmetaFrontend).value
"frontName" -> (musicmetaFrontend / name).value
),
buildInfoPackage := "com.malliina.musicmeta",
linuxPackageSymlinks := linuxPackageSymlinks.value.filterNot(_.link == "/usr/bin/starter")
Expand Down Expand Up @@ -389,12 +389,12 @@ lazy val pimpMacSettings = macSettings ++ Seq(
mainClass := Some("play.core.server.ProdServerStart"),
jvmOptions ++= Seq("-Dhttp.port=8456"),
launchdConf := Some(defaultLaunchd.value.copy(plistDir = Paths get "/Library/LaunchDaemons")),
Mac / appIcon := Some((pkgHome in Mac).value.resolve("guitar.icns")),
pkgIcon := Some((pkgHome in Mac).value.resolve("guitar.png")),
Mac / appIcon := Some((Mac / pkgHome).value.resolve("guitar.icns")),
pkgIcon := Some((Mac / pkgHome).value.resolve("guitar.png")),
hideDock := true,
extraDmgFiles := Seq(
FileMapping((pkgHome in Mac).value.resolve("guitar.png"), Paths get ".background/.bg.png"),
FileMapping((pkgHome in Mac).value.resolve("DS_Store"), Paths get ".DS_Store")
FileMapping((Mac / pkgHome).value.resolve("guitar.png"), Paths get ".background/.bg.png"),
FileMapping((Mac / pkgHome).value.resolve("DS_Store"), Paths get ".DS_Store")
)
)

Expand Down Expand Up @@ -456,9 +456,9 @@ lazy val pimpcloudLinuxSettings = Seq(
lazy val artifactSettings = Seq(
libs ++= Seq(
(Assets / packageBin).value.toPath,
(packageBin in shared in Compile).value.toPath,
(packageBin in crossJvm in Compile).value.toPath,
(packageBin in utilAudio in Compile).value.toPath
(shared / Compile / packageBin).value.toPath,
(crossJvm / Compile / packageBin).value.toPath,
(utilAudio / Compile / packageBin).value.toPath
)
)

Expand Down Expand Up @@ -537,7 +537,6 @@ def scalajsProject(name: String, path: File) =
scalaJSUseMainModuleInitializer := true,
webpackBundlingMode := BundlingMode.LibraryOnly(),
Compile / npmDependencies ++= Seq(
// "jquery" -> "3.3.1",
"popper.js" -> "1.14.6",
"bootstrap" -> "4.2.1"
),
Expand All @@ -552,13 +551,11 @@ def scalajsProject(name: String, path: File) =
"postcss-import" -> "12.0.1",
"postcss-loader" -> "3.0.0",
"postcss-preset-env" -> "6.5.0",
// "source-map-loader" -> "4.0.1",
"style-loader" -> "3.3.3",
"url-loader" -> "4.1.1",
"webpack-merge" -> "4.1.5"
),
Compile / additionalNpmConfig := Map(
// "engines" -> JSON.obj("node" -> JSON.str("10.x")),
"private" -> JSON.bool(true),
"license" -> JSON.str("BSD")
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ object PlayState {
def withName(name: String): PlayState =
all.find(_.name.toLowerCase == name.toLowerCase).getOrElse(Unknown)

implicit val json = Format[PlayState](
implicit val json: Format[PlayState] = Format[PlayState](
Reads(_.validate[String].map(withName)),
Writes(state => Json.toJson(state.name))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ sealed trait ServerMessage

case object PingEvent extends ServerMessage {
val Key = "ping"
implicit val json = evented(Key, CrossFormats.pure(PingEvent))
implicit val json: OFormat[PingEvent.type] = evented(Key, CrossFormats.pure(PingEvent))
}

case object WelcomeMessage extends ServerMessage {
implicit val json = evented(Welcome, CrossFormats.pure(WelcomeMessage))
implicit val json: OFormat[WelcomeMessage.type] = evented(Welcome, CrossFormats.pure(WelcomeMessage))
}

case class StatusMessage(status: StatusEvent) extends ServerMessage

object StatusMessage {
implicit val reader = Reads[StatusMessage] { json =>
implicit val reader: Reads[StatusMessage] = Reads[StatusMessage] { json =>
(json \ EventKey).validate[String].filter(_ == Status).flatMap { _ =>
json.validate[StatusEvent].map(apply)
}
Expand Down Expand Up @@ -59,7 +59,7 @@ object PlaylistIndexChangedMessage {
Reads(json => (json \ PlaylistIndex).validate[Int].map(apply)),
writer
)
implicit val json = evented(PlaylistIndexChanged, format)
implicit val json: OFormat[PlaylistIndexChangedMessage] = evented(PlaylistIndexChanged, format)
}

case class PlaylistModifiedMessage(playlist: Seq[TrackMeta]) extends ServerMessage
Expand All @@ -72,25 +72,25 @@ object PlaylistModifiedMessage {
case class TimeUpdatedMessage(position: Duration) extends ServerMessage

object TimeUpdatedMessage {
implicit val json = evented(TimeUpdated, Json.format[TimeUpdatedMessage])
implicit val json: OFormat[TimeUpdatedMessage] = evented(TimeUpdated, Json.format[TimeUpdatedMessage])
}

case class PlayStateChangedMessage(state: PlayState) extends ServerMessage

object PlayStateChangedMessage {
implicit val json = evented(PlaystateChanged, Json.format[PlayStateChangedMessage])
implicit val json: OFormat[PlayStateChangedMessage] = evented(PlaystateChanged, Json.format[PlayStateChangedMessage])
}

case class VolumeChangedMessage(volume: Volume) extends ServerMessage

object VolumeChangedMessage {
implicit val json = evented(VolumeChanged, Json.format[VolumeChangedMessage])
implicit val json: OFormat[VolumeChangedMessage] = evented(VolumeChanged, Json.format[VolumeChangedMessage])
}

case class MuteToggledMessage(mute: Boolean) extends ServerMessage

object MuteToggledMessage {
implicit val json = evented(MuteToggled, Json.format[MuteToggledMessage])
implicit val json: OFormat[MuteToggledMessage] = evented(MuteToggled, Json.format[MuteToggledMessage])
}

object ServerMessage {
Expand Down Expand Up @@ -123,7 +123,7 @@ object ServerMessage {
}

implicit val reader: Reads[ServerMessage] = Reads { json =>
implicit val trackFormat = JsonHelpers.dummyTrackFormat
implicit val trackFormat: Format[TrackMeta] = JsonHelpers.dummyTrackFormat
json.validate[TrackChangedMessage]
.orElse(json.validate[PlaylistModifiedMessage])
.orElse(json.validate[PlaylistIndexChangedMessage])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.malliina.musicpimp.audio

import com.malliina.musicpimp.json.CrossFormats
import com.malliina.musicpimp.models.Volume
import play.api.libs.json.Json
import play.api.libs.json.{Json, OFormat}

import scala.concurrent.duration.Duration

Expand All @@ -15,6 +15,6 @@ case class StatusEvent(track: FullTrack,
index: Int)

object StatusEvent {
implicit val dur = CrossFormats.duration
implicit val json = Json.format[StatusEvent]
implicit val dur: CrossFormats.duration.type = CrossFormats.duration
implicit val json: OFormat[StatusEvent] = Json.format[StatusEvent]
}
Loading

0 comments on commit 8deed0b

Please sign in to comment.