Skip to content

Commit fad7f57

Browse files
Integrates sbt-org-policies and (#63)
* Provides cross versioning with scala 2.12
1 parent 724d1b3 commit fad7f57

29 files changed

Lines changed: 363 additions & 215 deletions

.scalafmt

Lines changed: 0 additions & 2 deletions
This file was deleted.

.scalafmt.conf

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
style = defaultWithAlign
2+
maxColumn = 100
3+
4+
continuationIndent.callSite = 2
5+
6+
newlines {
7+
sometimesBeforeColonInMethodReturnType = false
8+
}
9+
10+
align {
11+
arrowEnumeratorGenerator = false
12+
ifWhileOpenParen = false
13+
openParenCallSite = false
14+
openParenDefnSite = false
15+
}
16+
17+
docstrings = JavaDoc
18+
19+
rewrite {
20+
rules = [SortImports, RedundantBraces]
21+
redundantBraces.maxLines = 1
22+
}
23+

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ language: scala
22
scala:
33
- 2.10.6
44
- 2.11.8
5+
- 2.12.1
56
jdk:
67
- oraclejdk8
78
before_install:

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
Changelog
22
=============
33

4+
## 2017/03/22 - Version 0.12.0
5+
6+
This release:
7+
8+
* Makes the library compatible with Scala 2.12.
9+
* It also integrates `sbt-org-policies` plugin to make easier its maintainability.
10+
* Upgrades the dependencies (through sbt-org-policies plugin).
11+
12+
## 2017/03/22 - Version 0.11.1
13+
14+
Adds these new fields to the User model:
15+
16+
* `company`: Option[String]
17+
* `blog`: Option[String]
18+
* `location`: Option[String]
19+
* `bio`: Option[String]
20+
21+
Thanks @fedefernandez for your time!
22+
423
## 2017/03/16 - Version 0.11.0
524

625
This release brings:

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ Github4s
66

77
**Github4s** is a GitHub API wrapper written in Scala.
88

9+
## Installation
10+
11+
To get started with SBT, simply add the following to your build.sbt file:
12+
13+
```
14+
libraryDependencies += "com.47deg" %% "github4s" % "0.12.0"
15+
```
916

1017
# License
1118

build.sbt

Lines changed: 9 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,23 @@
1-
import de.heikoseeberger.sbtheader.license.MIT
2-
import PgpKeys.gpgCommand
3-
4-
pgpPassphrase := Some(sys.env.getOrElse("PGP_PASSPHRASE", "").toCharArray)
5-
pgpPublicRing := file(s"${sys.env.getOrElse("PGP_FOLDER", ".")}/pubring.gpg")
6-
pgpSecretRing := file(s"${sys.env.getOrElse("PGP_FOLDER", ".")}/secring.gpg")
7-
8-
val dev = Seq(Dev("47 Degrees (twitter: @47deg)", "47 Degrees"))
9-
val gh = GitHubSettings("com.47deg", "github4s", "47 Degrees", mit)
10-
11-
lazy val buildSettings = Seq(
12-
name := gh.proj,
13-
organization := gh.org,
14-
organizationName := gh.publishOrg,
15-
description := "Github API wrapper written in Scala",
16-
startYear := Option(2016),
17-
homepage := Option(url("http://47deg.github.io/github4s/")),
18-
organizationHomepage := Option(new URL("http://47deg.com")),
19-
scalaVersion := "2.11.8",
20-
crossScalaVersions := Seq("2.10.6", scalaVersion.value),
21-
scalacOptions ++= (scalaBinaryVersion.value match {
22-
case "2.10" => Seq("-Xdivergence211")
23-
case _ => Nil
24-
}),
25-
scalafmtConfig in ThisBuild := Some(file(".scalafmt")),
26-
headers := Map(
27-
"scala" -> MIT("2016", "47 Degrees, LLC. <http://www.47deg.com>")
28-
)
29-
) ++ reformatOnCompileSettings ++
30-
sharedCommonSettings ++
31-
miscSettings ++
32-
sharedReleaseProcess ++
33-
credentialSettings ++
34-
sharedPublishSettings(gh, dev)
35-
36-
lazy val micrositeSettings = Seq(
37-
micrositeName := "github4s",
38-
micrositeDescription := "Github API wrapper written in Scala",
39-
micrositeBaseUrl := "github4s",
40-
micrositeDocumentationUrl := "/github4s/docs.html",
41-
micrositeGithubOwner := "47deg",
42-
micrositeGithubRepo := "github4s",
43-
includeFilter in makeSite := "*.html" | "*.css" | "*.png" | "*.jpg" | "*.gif" | "*.js" | "*.swf" | "*.md"
44-
)
45-
46-
lazy val commonDeps =
47-
Seq(
48-
libraryDependencies ++= Seq(
49-
"org.typelevel" %%% "cats" % "0.9.0",
50-
"io.circe" %%% "circe-core" % "0.7.0",
51-
"io.circe" %%% "circe-generic" % "0.7.0",
52-
"io.circe" %%% "circe-parser" % "0.7.0",
53-
"org.scalatest" %%% "scalatest" % "3.0.0" % "test",
54-
"com.github.marklister" %%% "base64" % "0.2.3",
55-
compilerPlugin(
56-
"org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full
57-
)
58-
))
59-
60-
lazy val jvmDeps = Seq(
61-
libraryDependencies ++= Seq(
62-
"org.scalaj" %% "scalaj-http" % "2.3.0",
63-
"org.mock-server" % "mockserver-netty" % "3.10.4" % "test"
64-
))
65-
66-
lazy val jsDeps = Seq(
67-
libraryDependencies ++= Seq(
68-
"fr.hmil" %%% "roshttp" % "2.0.0-RC1"
69-
)
70-
)
71-
72-
lazy val docsDependencies = libraryDependencies ++= Seq(
73-
"com.ironcorelabs" %% "cats-scalatest" % "1.1.2" % "test",
74-
"org.mock-server" % "mockserver-netty" % "3.10.4" % "test"
75-
)
76-
77-
lazy val scalazDependencies = Seq(
78-
libraryDependencies +=
79-
"org.scalaz" %% "scalaz-concurrent" % "7.2.9"
80-
)
1+
pgpPassphrase := Some(getEnvVar("PGP_PASSPHRASE").getOrElse("").toCharArray)
2+
pgpPublicRing := file(s"$gpgFolder/pubring.gpg")
3+
pgpSecretRing := file(s"$gpgFolder/secring.gpg")
814

825
lazy val root = (project in file("."))
83-
.settings(buildSettings: _*)
6+
.dependsOn(github4sJVM, github4sJS, scalaz, docs)
847
.aggregate(github4sJVM, github4sJS, scalaz, docs)
8+
.settings(noPublishSettings: _*)
859

86-
/** github4s - cross project that provides cross platform support.*/
8710
lazy val github4s = (crossProject in file("github4s"))
8811
.settings(moduleName := "github4s")
8912
.enablePlugins(AutomateHeaderPlugin)
9013
.enablePlugins(BuildInfoPlugin)
9114
.settings(
92-
buildInfoKeys := Seq[BuildInfoKey](name,
93-
version,
94-
"token" -> sys.env.getOrElse("GITHUB4S_ACCESS_TOKEN", "")),
15+
buildInfoKeys := Seq[BuildInfoKey](
16+
name,
17+
version,
18+
"token" -> sys.env.getOrElse("GITHUB4S_ACCESS_TOKEN", "")),
9519
buildInfoPackage := "github4s"
9620
)
97-
.settings(buildSettings: _*)
9821
.settings(commonDeps: _*)
9922
.jvmSettings(jvmDeps: _*)
10023
.jsSettings(sharedJsSettings: _*)
@@ -107,19 +30,13 @@ lazy val github4sJS = github4s.js
10730
lazy val docs = (project in file("docs"))
10831
.dependsOn(scalaz)
10932
.settings(moduleName := "github4s-docs")
110-
.settings(buildSettings: _*)
11133
.settings(micrositeSettings: _*)
11234
.settings(docsDependencies: _*)
11335
.settings(noPublishSettings: _*)
11436
.enablePlugins(MicrositesPlugin)
11537

11638
lazy val scalaz = (project in file("scalaz"))
11739
.settings(moduleName := "github4s-scalaz")
118-
.settings(buildSettings: _*)
11940
.settings(scalazDependencies: _*)
12041
.dependsOn(github4sJVM)
12142
.enablePlugins(AutomateHeaderPlugin)
122-
123-
lazy val testSettings = Seq(
124-
fork in Test := false
125-
)

docs/src/main/tut/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Github4s is a GitHub API wrapper written in Scala.
1515
To get started with SBT, simply add the following to your build.sbt file:
1616

1717
```
18-
libraryDependencies += "com.47deg" %% "github4s" % "0.11.0"
18+
libraryDependencies += "com.47deg" %% "github4s" % "0.12.0"
1919
```
2020

2121
## License

github4s/js/src/main/scala/github4s/HttpRequestBuilderExtensionJS.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ import monix.reactive.Observable
4444
import scala.util.{Failure, Success}
4545

4646
case class CirceJSONBody(value: String) extends BulkBodyPart {
47-
override def contentType: String = s"application/json; charset=utf-8"
48-
override def contentData: ByteBuffer = ByteBuffer.wrap(value.getBytes("utf-8"))
47+
override def contentType: String = s"application/json; charset=utf-8"
48+
override def contentData: ByteBuffer =
49+
ByteBuffer.wrap(value.getBytes("utf-8"))
4950
}
5051

5152
trait HttpRequestBuilderExtensionJS {
@@ -79,7 +80,8 @@ trait HttpRequestBuilderExtensionJS {
7980
.getOrElse(request.send())
8081
.map(toEntity[A])
8182
.recoverWith {
82-
case e => Future.successful(Either.left(UnexpectedException(e.getMessage)))
83+
case e =>
84+
Future.successful(Either.left(UnexpectedException(e.getMessage)))
8385
}
8486
}
8587
}

github4s/js/src/main/scala/github4s/js/ImplicitsJS.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import scala.concurrent.Future
3131

3232
trait ImplicitsJS extends FutureInstances with HttpRequestBuilderExtensionJS {
3333

34-
implicit val intInstanceFutureRosHttp = new Interpreters[Future, SimpleHttpResponse]
34+
implicit val intInstanceFutureRosHttp =
35+
new Interpreters[Future, SimpleHttpResponse]
3536

3637
}

github4s/js/src/main/scala/github4s/util/URLEncoder.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ package github4s.util
2323

2424
object URLEncoder {
2525

26-
def encode(string: String): String = fr.hmil.roshttp.util.Utils.encodeQueryString(string)
26+
def encode(string: String): String =
27+
fr.hmil.roshttp.util.Utils.encodeQueryString(string)
2728

2829
}

0 commit comments

Comments
 (0)