Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Commit

Permalink
Refactor build (#562)
Browse files Browse the repository at this point in the history
* Fix build

* Refactor build
  • Loading branch information
hseeberger authored Mar 26, 2021
1 parent 156395a commit 1046ae7
Show file tree
Hide file tree
Showing 31 changed files with 124 additions and 156 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ on:

jobs:
publish:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- uses: olafurpg/setup-scala@v2
- uses: olafurpg/setup-gpg@v2
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: olafurpg/setup-scala@v10
- uses: olafurpg/setup-gpg@v3
- name: Publish ${{ github.ref }}
run: sbt ci-release
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
Expand Down
1 change: 1 addition & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ unindentTopLevelOperators = true
spaces.inImportCurlyBraces = true
rewrite.rules = ["AsciiSortImports", "RedundantBraces", "RedundantParens"]
docstrings.blankFirstLine = true
trailingCommas = preserve
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ import akka.http.scaladsl.util.FastFuture
import akka.stream.scaladsl.{ Flow, Source }
import akka.util.ByteString
import argonaut.{ DecodeJson, EncodeJson, Json, Parse, PrettyParams }

import scala.collection.immutable.Seq
import scala.concurrent.Future
import scala.util.Try
import scala.util.control.NonFatal

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ import akka.http.scaladsl.unmarshalling.Unmarshaller.UnsupportedContentTypeExcep
import akka.stream.scaladsl.{ Sink, Source }
import argonaut.Argonaut._
import org.scalatest.BeforeAndAfterAll

import scala.concurrent.Await
import scala.concurrent.duration.DurationInt
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AsyncWordSpec
import scala.concurrent.Await
import scala.concurrent.duration.DurationInt

object ArgonautSupportSpec {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,24 @@

package de.heikoseeberger.akkahttpavro4s

import java.io.ByteArrayOutputStream

import akka.http.javadsl.common.JsonEntityStreamingSupport
import akka.http.scaladsl.common.EntityStreamingSupport
import akka.http.scaladsl.marshalling.{ Marshaller, Marshalling, ToEntityMarshaller }
import akka.http.scaladsl.model.MediaTypes.`application/json`
import akka.http.scaladsl.model._
import akka.http.scaladsl.model.MediaTypes.`application/json`
import akka.http.scaladsl.unmarshalling.{ FromEntityUnmarshaller, Unmarshal, Unmarshaller }
import akka.http.scaladsl.util.FastFuture
import akka.stream.scaladsl.{ Flow, Source }
import akka.util.ByteString
import com.sksamuel.avro4s._

import com.sksamuel.avro4s.{
AvroInputStream,
AvroOutputStream,
AvroSchema,
Decoder,
Encoder,
SchemaFor
}
import java.io.ByteArrayOutputStream
import scala.collection.immutable.Seq
import scala.concurrent.Future
import scala.util.Try
Expand Down Expand Up @@ -70,7 +75,7 @@ trait AvroSupport {

private def jsonSource[A: SchemaFor: Encoder](entitySource: SourceOf[A])(implicit
support: JsonEntityStreamingSupport
): SourceOf[ByteString] = {
): SourceOf[ByteString] =
entitySource
.map { obj =>
val baos = new ByteArrayOutputStream()
Expand All @@ -81,7 +86,6 @@ trait AvroSupport {
}
.map(ByteString(_))
.via(support.framingRenderer)
}

def unmarshallerContentTypes: Seq[ContentTypeRange] = defaultContentTypes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,17 @@ package de.heikoseeberger.akkahttpavro4s

import akka.actor.ActorSystem
import akka.http.scaladsl.marshalling.Marshal
import akka.http.scaladsl.model.ContentTypes.{ `application/json`, `text/plain(UTF-8)` }
import akka.http.scaladsl.model._
import akka.http.scaladsl.unmarshalling.Unmarshaller.UnsupportedContentTypeException
import akka.http.scaladsl.model.ContentTypes.{ `application/json`, `text/plain(UTF-8)` }
import akka.http.scaladsl.unmarshalling.{ Unmarshal, Unmarshaller }
import akka.http.scaladsl.unmarshalling.Unmarshaller.UnsupportedContentTypeException
import akka.stream.scaladsl.{ Sink, Source }
import com.sksamuel.avro4s.{ Decoder, Encoder, SchemaFor }
import org.scalatest.BeforeAndAfterAll

import scala.concurrent.Await
import scala.concurrent.duration.DurationInt
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AsyncWordSpec
import scala.concurrent.Await
import scala.concurrent.duration.DurationInt

object AvroSupportSpec {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import akka.http.scaladsl.server.Directives
import akka.http.scaladsl.unmarshalling.Unmarshal
import akka.stream.scaladsl.Source
import com.sksamuel.avro4s.{ FromRecord, SchemaFor, ToRecord }

import scala.concurrent.Await
import scala.concurrent.duration._
import scala.io.StdIn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,12 @@ import akka.http.scaladsl.util.FastFuture
import akka.stream.scaladsl.{ Flow, Source }
import akka.util.ByteString
import cats.data.{ NonEmptyList, ValidatedNel }
import cats.syntax.show.toShow
import cats.syntax.either.catsSyntaxEither
import cats.syntax.show.toShow
import io.circe.{ Decoder, DecodingFailure, Encoder, Json, Printer, jawn }
import io.circe.parser.parse

import scala.collection.immutable.Seq
import scala.concurrent.Future
import scala.util.Try
import scala.util.control.NonFatal

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ import io.circe.{ DecodingFailure, Encoder, ParsingFailure, Printer }
import io.circe.CursorOp.DownField
import org.scalatest.{ BeforeAndAfterAll, EitherValues }
import org.scalatest.concurrent.ScalaFutures

import scala.concurrent.Await
import scala.concurrent.duration.DurationInt
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AsyncWordSpec
import scala.concurrent.Await
import scala.concurrent.duration.DurationInt

object CirceSupportSpec {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ import akka.http.scaladsl.model.{ HttpRequest, RequestEntity }
import akka.http.scaladsl.server.Directives
import akka.http.scaladsl.unmarshalling.Unmarshal
import akka.stream.scaladsl.Source

import scala.io.StdIn
import scala.concurrent.duration._
import scala.io.StdIn

object ExampleApp {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package de.heikoseeberger.akkahttpjackson

import java.lang.reflect.{ ParameterizedType, Type => JType }

import akka.http.javadsl.common.JsonEntityStreamingSupport
import akka.http.javadsl.marshallers.jackson.Jackson
import akka.http.scaladsl.common.EntityStreamingSupport
Expand All @@ -31,7 +29,7 @@ import akka.util.ByteString
import com.fasterxml.jackson.core.`type`.TypeReference
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.scala.DefaultScalaModule

import java.lang.reflect.{ ParameterizedType, Type => JType }
import scala.collection.immutable.Seq
import scala.concurrent.Future
import scala.reflect.runtime.universe._
Expand Down Expand Up @@ -77,11 +75,9 @@ trait JacksonSupport {
mirror.runtimeClass(t)
else
new ParameterizedType {
def getRawType = mirror.runtimeClass(t)

def getActualTypeArguments = t.typeArgs.map(mapType).toArray

def getOwnerType = null
def getRawType() = mirror.runtimeClass(t)
def getActualTypeArguments() = t.typeArgs.map(mapType).toArray
def getOwnerType() = null
}

new TypeReference[T] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import akka.http.scaladsl.model.HttpRequest
import akka.http.scaladsl.server.Directives
import akka.http.scaladsl.unmarshalling.Unmarshal
import akka.stream.scaladsl.Source

import scala.concurrent.Await
import scala.concurrent.duration._
import scala.io.StdIn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@ package de.heikoseeberger.akkahttpjackson

import akka.actor.ActorSystem
import akka.http.scaladsl.marshalling.Marshal
import akka.http.scaladsl.model.ContentTypes.{ `application/json`, `text/plain(UTF-8)` }
import akka.http.scaladsl.model._
import akka.http.scaladsl.unmarshalling.Unmarshaller.UnsupportedContentTypeException
import akka.http.scaladsl.model.ContentTypes.{ `application/json`, `text/plain(UTF-8)` }
import akka.http.scaladsl.unmarshalling.{ Unmarshal, Unmarshaller }
import akka.http.scaladsl.unmarshalling.Unmarshaller.UnsupportedContentTypeException
import akka.stream.scaladsl.{ Sink, Source }
import org.scalatest.BeforeAndAfterAll

import scala.concurrent.Await
import scala.concurrent.duration.DurationInt
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AsyncWordSpec
import scala.concurrent.Await
import scala.concurrent.duration.DurationInt

object JacksonSupportSpec {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package de.heikoseeberger.akkahttpjson4s

import java.lang.reflect.InvocationTargetException

import akka.http.javadsl.common.JsonEntityStreamingSupport
import akka.http.scaladsl.common.EntityStreamingSupport
import akka.http.scaladsl.marshalling.{ Marshaller, Marshalling, ToEntityMarshaller }
Expand All @@ -29,8 +27,8 @@ import akka.stream.Materializer
import akka.stream.scaladsl.{ Flow, Source }
import akka.util.ByteString
import de.heikoseeberger.akkahttpjson4s.Json4sSupport.ShouldWritePretty.False
import java.lang.reflect.InvocationTargetException
import org.json4s.{ Formats, MappingException, Serialization }

import scala.collection.immutable.Seq
import scala.concurrent.{ ExecutionContext, Future }
import scala.util.Try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import akka.http.scaladsl.server.Directives
import akka.http.scaladsl.unmarshalling.Unmarshal
import akka.stream.scaladsl.Source
import org.json4s.{ DefaultFormats, jackson }

import scala.concurrent.Await
import scala.concurrent.duration._
import scala.io.StdIn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,17 @@ package de.heikoseeberger.akkahttpjson4s

import akka.actor.ActorSystem
import akka.http.scaladsl.marshalling.Marshal
import akka.http.scaladsl.model.ContentTypes.{ `application/json`, `text/plain(UTF-8)` }
import akka.http.scaladsl.model._
import akka.http.scaladsl.unmarshalling.Unmarshaller.UnsupportedContentTypeException
import akka.http.scaladsl.model.ContentTypes.{ `application/json`, `text/plain(UTF-8)` }
import akka.http.scaladsl.unmarshalling.{ Unmarshal, Unmarshaller }
import akka.http.scaladsl.unmarshalling.Unmarshaller.UnsupportedContentTypeException
import akka.stream.scaladsl.{ Sink, Source }
import org.json4s.{ DefaultFormats, jackson, native }
import org.scalatest.BeforeAndAfterAll

import scala.concurrent.Await
import scala.concurrent.duration.DurationInt
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AsyncWordSpec
import scala.concurrent.Await
import scala.concurrent.duration.DurationInt

object Json4sSupportSpec {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import akka.http.scaladsl.util.FastFuture
import akka.stream.scaladsl.{ Flow, Source }
import akka.util.ByteString
import com.github.plokhotnyuk.jsoniter_scala.core._

import scala.collection.immutable.Seq
import scala.concurrent.Future
import scala.util.Try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import akka.http.scaladsl.model.HttpRequest
import akka.http.scaladsl.server.{ Directives, Route }
import akka.http.scaladsl.unmarshalling.Unmarshal
import akka.stream.scaladsl.Source

import scala.concurrent.Await
import scala.concurrent.duration._
import scala.io.StdIn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,18 @@ package de.heikoseeberger.akkahttpjsoniterscala

import akka.actor.ActorSystem
import akka.http.scaladsl.marshalling.Marshal
import akka.http.scaladsl.model.ContentTypes.{ `application/json`, `text/plain(UTF-8)` }
import akka.http.scaladsl.model._
import akka.http.scaladsl.unmarshalling.Unmarshaller.UnsupportedContentTypeException
import akka.http.scaladsl.model.ContentTypes.{ `application/json`, `text/plain(UTF-8)` }
import akka.http.scaladsl.unmarshalling.{ Unmarshal, Unmarshaller }
import akka.http.scaladsl.unmarshalling.Unmarshaller.UnsupportedContentTypeException
import akka.stream.scaladsl.{ Sink, Source }
import com.github.plokhotnyuk.jsoniter_scala.core.JsonValueCodec
import com.github.plokhotnyuk.jsoniter_scala.macros._
import org.scalatest.BeforeAndAfterAll

import scala.concurrent.Await
import scala.concurrent.duration.DurationInt
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AsyncWordSpec
import scala.concurrent.Await
import scala.concurrent.duration.DurationInt

object JsoniterScalaSupportSpec {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@

package de.heikoseeberger.akkahttpninny

import java.nio.charset.StandardCharsets

import akka.http.javadsl.common.JsonEntityStreamingSupport
import akka.http.scaladsl.common.EntityStreamingSupport
import akka.http.scaladsl.marshalling.{ Marshaller, Marshalling, ToEntityMarshaller }
import akka.http.scaladsl.model.MediaTypes.`application/json`
import akka.http.scaladsl.model.{ ContentTypeRange, HttpEntity, MediaType, MessageEntity }
import akka.http.scaladsl.model.MediaTypes.`application/json`
import akka.http.scaladsl.unmarshalling.{ FromEntityUnmarshaller, Unmarshal, Unmarshaller }
import akka.http.scaladsl.util.FastFuture
import akka.stream.scaladsl.{ Flow, Source }
import akka.util.ByteString
import io.github.kag0.ninny._

import java.nio.charset.StandardCharsets
import scala.collection.immutable.Seq
import scala.concurrent.Future
import scala.util.control.NonFatal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,17 @@ package de.heikoseeberger.akkahttpninny

import akka.actor.ActorSystem
import akka.http.scaladsl.marshalling.Marshal
import akka.http.scaladsl.model.ContentTypes.{ `application/json`, `text/plain(UTF-8)` }
import akka.http.scaladsl.model._
import akka.http.scaladsl.unmarshalling.Unmarshaller.UnsupportedContentTypeException
import akka.http.scaladsl.model.ContentTypes.{ `application/json`, `text/plain(UTF-8)` }
import akka.http.scaladsl.unmarshalling.{ Unmarshal, Unmarshaller }
import akka.http.scaladsl.unmarshalling.Unmarshaller.UnsupportedContentTypeException
import akka.stream.scaladsl.{ Sink, Source }
import io.github.kag0.ninny.JsonException
import org.scalatest.BeforeAndAfterAll

import scala.collection.immutable.Seq
import scala.concurrent.Await
import scala.concurrent.duration.DurationInt
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AsyncWordSpec
import scala.concurrent.Await
import scala.concurrent.duration.DurationInt

object NinnySupportSpec {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import akka.http.scaladsl.util.FastFuture
import akka.stream.scaladsl.{ Flow, Source }
import akka.util.ByteString
import play.api.libs.json.{ JsError, JsResultException, JsValue, Json, Reads, Writes }

import scala.collection.immutable.Seq
import scala.concurrent.Future
import scala.util.Try
Expand Down
Loading

0 comments on commit 1046ae7

Please sign in to comment.