Skip to content

Commit

Permalink
Merge 3189ee8 into 6532c4d
Browse files Browse the repository at this point in the history
  • Loading branch information
aldemirenes committed Jun 10, 2020
2 parents 6532c4d + 3189ee8 commit c1db92a
Show file tree
Hide file tree
Showing 40 changed files with 233 additions and 107 deletions.
18 changes: 10 additions & 8 deletions .travis.yml
@@ -1,25 +1,27 @@
language: scala
scala:
- 2.11.12
- 2.12.8
- 2.12.8
- 2.13.2
jdk:
- openjdk8
- openjdk8
addons:
# Fix OpenJDK builds
# https://github.com/travis-ci/travis-ci/issues/5227
hostname: short-hostname
script:
- sbt test
- sbt clean coverage +test
- sbt coverageReport
after_success: "sbt coveralls"
deploy:
skip_cleanup: true
provider: script
script: ./.travis/deploy.sh $TRAVIS_TAG
script: "./.travis/deploy.sh $TRAVIS_TAG"
on:
condition: '"${TRAVIS_SCALA_VERSION}" == "2.12.8" && "${TRAVIS_JDK_VERSION}" == "openjdk8"'
condition: '"${TRAVIS_SCALA_VERSION}" == "2.12.8"'
tags: true
env:
global:
- secure: Qf1FGe4SzvvSr5mQzKzTVfdz5jjyKrFp6nCa8QDm1Uj+spuL4v17szzfhHdJqy5ELqowrf97z2ciESjBjajzrh5cdLpLqmMICMjbWEWDCVh3LQPXTxc4/Bv1sw4DY/saQUw2vt46K/O89oP2tKBruYjwLpgPnPUgnWZ284P5P4M=
- secure: R3N94P7noue7/K2KOLjfxNVZV6Eft2emrU0zfh/qbkAwW6CF6w3gjVxRJwBzOhrsy5W4SU7r18Dft9/YS1QQOKw5HuBGNKnVytJxhkHPRB7EE/KrDnlQ0uHK9LAlQnwQzb74+iyQv6ONcrCF1M7xEnnkst8buZp4zoB8JXUA8bM=
- secure: jh4RLrx+HoTmzgfvsxle8hWdAsz6m5M0qvaBu3VAGPnrM4NmRPyfyb08btlN+qLJOTEBilZGIKh+cYSE8NRJHXR+8iAKHikop8rOh6HqwaEl8A7SFy/Nx6RMys3Cy3yX5AVLHhgpu4absok4QlVplYhn2aK6EbYsM0VS1uyOztQ=
- secure: ZdJH16Iz79TTwPCha92BuekZP07QsLAxMqaG4liH45ncK4TE+xfEE0lAmt2SqonPodXDbx94cFwjTEum0xFsEOp1ASsz393i265+qVKT+WwumpMe1/4Ta9UF6bAZMBQSeikgW7Qnh7uN2DVUKJ9LNrCg3xlBReWeqJC/1AjD+TM=
- ENCRYPTION_LABEL: "<placeholder>"
- secure: PQ/P9MzZt5vczMZBgrKQD2+lvFkwJJI644MxxUf1xX0SBocvyuB5xkjdlgmbQHtRW90WgiSJJ2AO+lj/SNc61zHyZaC1YrrPzbJZPTNzihcsWvKBJKdMOX3OpN3+eXmY5JgKcZ7MRiCIetuRkZ8LkdThl8DCFGvtPmNHayqpCOk=
1 change: 1 addition & 0 deletions .travis/deploy.sh
Expand Up @@ -16,6 +16,7 @@ pwd

project_version=$(sbt version -Dsbt.log.noformat=true | perl -ne 'print $1 if /(\d+\.\d+\.\d+[^\r\n]*)/')
if [ "${project_version}" == "${tag_version}" ]; then
./.travis/deploy_docs.sh
sbt +publish
sbt +bintraySyncMavenCentral
else
Expand Down
17 changes: 17 additions & 0 deletions .travis/deploy_docs.sh
@@ -0,0 +1,17 @@
#!/bin/bash

ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}

git config --global user.name "$USER"
git config --global user.email "$TRAVIS_BUILD_NUMBER@$TRAVIS_COMMIT"

openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in project/travis-deploy-key.enc -out project/travis-deploy-key -d
chmod 600 project/travis-deploy-key

eval "$(ssh-agent -s)"
ssh-add project/travis-deploy-key

sbt ghpagesPushSite
12 changes: 11 additions & 1 deletion CHANGELOG
@@ -1,4 +1,14 @@
Version 0.6.2 (2012-12-13)
Version 1.0.0 (2020-06-10)
--------------------------
Add Scala 2.13 support (#134)
Use sbt-coveralls (#137)
Integrate sbt-gh-pages to create GH Pages from Scaladoc (#120)
Integrate scoverage (#119)
Integrate MiMa (#118)
Bump json-schema-validator to 1.0.39 (#135)
Extend copyright notice to 2020 (#138)

Version 0.6.2 (2020-12-13)
--------------------------
Make model mandatory for listSchemas (#128)

Expand Down
2 changes: 1 addition & 1 deletion LICENSE-2.0.txt
Expand Up @@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2014-2019 Snowplow Analytics Ltd.
Copyright 2014-2020 Snowplow Analytics Ltd.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
12 changes: 7 additions & 5 deletions README.md
Expand Up @@ -3,6 +3,7 @@
[![Build Status][travis-image]][travis]
[![Release][release-image]][releases]
[![License][license-image]][license]
[![Coverage Status][coveralls-image]][coveralls]

A Scala client and resolver for **[Iglu schema repositories][iglu-wiki]** from the team at **[Snowplow Analytics][snowplow-website]**.

Expand All @@ -12,16 +13,14 @@ Iglu Scala Client is used extensively in **[Snowplow][snowplow-repo]** to valida

## Installation

The latest version of Iglu Scala Client is 0.6.2, which currently works with Scala 2.11 and 2.12.
The latest version of Iglu Scala Client is 1.0.0, which currently works with Scala 2.12 and 2.13.

If you're using SBT, add the following lines to your build file:

```scala
val igluClient = "com.snowplowanalytics" %% "iglu-scala-client" % "0.6.2"
val igluClient = "com.snowplowanalytics" %% "iglu-scala-client" % "1.0.0"
```

Note the double percent (`%%`) between the group and artifactId. That'll ensure you get the right package for your Scala version.

## API

Iglu Scala Client has "tagless final"-friendly API, allowing end-users to abstract over effects they use:
Expand Down Expand Up @@ -105,7 +104,7 @@ or there some kind of resolution problems, or simply nothing (`Unit`) in case of

## Copyright and license

Iglu Scala Client is copyright 2014-2019 Snowplow Analytics Ltd.
Iglu Scala Client is copyright 2014-2020 Snowplow Analytics Ltd.

Licensed under the **[Apache License, Version 2.0][license]** (the "License");
you may not use this software except in compliance with the License.
Expand Down Expand Up @@ -143,3 +142,6 @@ limitations under the License.

[license]: http://www.apache.org/licenses/LICENSE-2.0
[license-image]: http://img.shields.io/badge/license-Apache--2-blue.svg?style=flat

[coveralls]: https://coveralls.io/github/snowplow/iglu-scala-client?branch=master
[coveralls-image]: https://coveralls.io/repos/github/snowplow/iglu-scala-client/badge.svg?branch=master
10 changes: 7 additions & 3 deletions build.sbt
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2019 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2014-2020 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand All @@ -14,12 +14,16 @@
lazy val root = (project in file("."))
.settings(
name := "iglu-scala-client",
version := "0.6.2",
version := "1.0.0",
description := "Scala client and resolver for Iglu schema repositories"
)
.enablePlugins(SiteScaladocPlugin, GhpagesPlugin, PreprocessPlugin)
.settings(BuildSettings.buildSettings)
.settings(BuildSettings.publishSettings)
.settings(BuildSettings.mavenCentralExtras)
.settings(BuildSettings.mimaSettings)
.settings(BuildSettings.scoverageSettings)
.settings(BuildSettings.ghPagesSettings)
.settings(
libraryDependencies ++= Seq(
// Java
Expand All @@ -29,10 +33,10 @@ lazy val root = (project in file("."))
Dependencies.Libraries.igluCore,
Dependencies.Libraries.igluCoreCirce,
Dependencies.Libraries.cats,
Dependencies.Libraries.circeTime,
Dependencies.Libraries.circeParser,
Dependencies.Libraries.lruMap,
Dependencies.Libraries.scalaj,
Dependencies.Libraries.collectionCompat,
// Scala (test only)
Dependencies.Libraries.circeLiteral,
Dependencies.Libraries.specs2,
Expand Down
77 changes: 57 additions & 20 deletions project/BuildSettings.scala
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2019 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2014-2020 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand All @@ -19,28 +19,28 @@ import Keys._
import bintray.BintrayPlugin._
import bintray.BintrayKeys._

// Mima plugin
import com.typesafe.tools.mima.plugin.MimaKeys._
import com.typesafe.tools.mima.plugin.MimaPlugin

// Scoverage plugin
import scoverage.ScoverageKeys._

// GHPages plugin
import com.typesafe.sbt.sbtghpages.GhpagesPlugin.autoImport._
import com.typesafe.sbt.site.SitePlugin.autoImport.{makeSite, siteSubdirName}
import com.typesafe.sbt.SbtGit.GitKeys.{gitBranch, gitRemoteRepo}
import com.typesafe.sbt.site.SiteScaladocPlugin.autoImport._
import com.typesafe.sbt.site.preprocess.PreprocessPlugin.autoImport._

object BuildSettings {

lazy val buildSettings = Seq[Setting[_]](
organization := "com.snowplowanalytics",
scalaVersion := "2.12.8",
crossScalaVersions := Seq("2.11.12", "2.12.8"),
scalacOptions := Seq(
"-Ypartial-unification",
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-unchecked",
"-Ywarn-dead-code",
"-Ywarn-inaccessible",
"-Ywarn-nullary-override",
"-Ywarn-nullary-unit",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard",
"-language:higherKinds"
),

addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.8"),
organization := "com.snowplowanalytics",
scalaVersion := "2.13.2",
crossScalaVersions := Seq("2.12.8", "2.13.2"),

addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.11.0" cross CrossVersion.full),

addCompilerPlugin("com.olegpy" %% "better-monadic-for" % "0.3.0"),

Expand Down Expand Up @@ -70,4 +70,41 @@ object BuildSettings {
</developer>
</developers>)
)

// If new version introduces breaking changes,
// clear-out mimaBinaryIssueFilters and mimaPreviousVersions.
// Otherwise, add previous version to set without
// removing other versions.
val mimaPreviousVersions = Set()

val mimaSettings = MimaPlugin.mimaDefaultSettings ++ Seq(
mimaPreviousArtifacts := mimaPreviousVersions.map { organization.value %% name.value % _ },
mimaBinaryIssueFilters ++= Seq(),
test in Test := {
mimaReportBinaryIssues.value
(test in Test).value
}
)

val scoverageSettings = Seq(
coverageEnabled := true,
coverageMinimum := 50,
coverageFailOnMinimum := true,
coverageHighlighting := false,
(test in Test) := {
(coverageReport dependsOn (test in Test)).value
}
)

val ghPagesSettings = Seq(
ghpagesPushSite := (ghpagesPushSite dependsOn makeSite).value,
ghpagesNoJekyll := false,
gitRemoteRepo := "git@github.com:snowplow/iglu-scala-client.git",
gitBranch := Some("gh-pages"),
siteSubdirName in SiteScaladoc := s"${version.value}",
preprocessVars in Preprocess := Map("VERSION" -> version.value),
excludeFilter in ghpagesCleanSite := new FileFilter {
def accept(f: File) = true
}
)
}
23 changes: 11 additions & 12 deletions project/Dependencies.scala
@@ -1,5 +1,4 @@
/*
* Copyright (c) 2014-2019 Snowplow Analytics Ltd. All rights reserved.
/* Copyright (c) 2014-2020 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand All @@ -15,17 +14,17 @@ import sbt._
object Dependencies {
object V {
// Java
val validator = "1.0.28"
val slf4j = "1.7.26"
val validator = "1.0.39"
val slf4j = "1.7.26"
// Scala
val igluCore = "0.5.1"
val cats = "1.6.1"
val circe = "0.11.2"
val circeJava8 = "0.11.1"
val lruMap = "0.3.0"
val scalaj = "2.4.2"
val igluCore = "1.0.0"
val cats = "2.1.1"
val circe = "0.13.0"
val lruMap = "0.4.0"
val scalaj = "2.4.2"
val collectionCompat = "2.1.6"
// Scala (test only)
val specs2 = "4.3.3"
val specs2 = "4.9.4"
}

object Libraries {
Expand All @@ -40,9 +39,9 @@ object Dependencies {
val igluCoreCirce = "com.snowplowanalytics" %% "iglu-core-circe" % V.igluCore
val cats = "org.typelevel" %% "cats-core" % V.cats
val circeParser = "io.circe" %% "circe-parser" % V.circe
val circeTime = "io.circe" %% "circe-java8" % V.circeJava8
val lruMap = "com.snowplowanalytics" %% "scala-lru-map" % V.lruMap
val scalaj = "org.scalaj" %% "scalaj-http" % V.scalaj
val collectionCompat = "org.scala-lang.modules" %% "scala-collection-compat" % V.collectionCompat
// Scala (test only)
val circeLiteral = "io.circe" %% "circe-literal" % V.circe % Test
val specs2 = "org.specs2" %% "specs2-core" % V.specs2 % Test
Expand Down
8 changes: 7 additions & 1 deletion project/plugins.sbt
@@ -1,3 +1,9 @@
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4")

addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.12")
addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.15")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.7.0")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.4.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3")
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.2.7")
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2019 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2014-2020 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand All @@ -13,7 +13,6 @@
package com.snowplowanalytics.iglu.client

import cats.Monad
import cats.syntax.either._
import cats.data.EitherT
import cats.effect.{Clock, IO}

Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2019 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2014-2020 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand All @@ -19,7 +19,6 @@ import cats.syntax.show._
import cats.syntax.either._

import io.circe.{Decoder, DecodingFailure, Encoder, Json}
import io.circe.java8.time._
import io.circe.syntax._

import validator.ValidatorError
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2019 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2014-2020 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2019 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2014-2020 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand All @@ -17,10 +17,8 @@ import java.time.Instant
import cats.Semigroup
import cats.instances.set._
import cats.syntax.semigroup._
import cats.syntax.either._

import io.circe.{Decoder, Encoder, Json}
import io.circe.java8.time._
import io.circe.syntax._

import registries.RegistryError
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2019 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2014-2020 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down Expand Up @@ -253,7 +253,7 @@ object Resolver {

/** Ensure that every names encountered only once */
private[client] def validateRefs[F[_]](refs: List[Registry]): Either[DecodingFailure, Unit] =
refs.map(_.config.name).groupBy(identity).mapValues(_.size).filter(_._2 > 1).toList match {
refs.map(_.config.name).groupBy(identity).filter(_._2.size > 1).toList match {
case Nil =>
().asRight
case some =>
Expand Down

0 comments on commit c1db92a

Please sign in to comment.