Skip to content
Permalink
Browse files

Integrates sbt-org-policies plugin (#34)

  • Loading branch information
juanpedromoreno committed Mar 28, 2017
1 parent 0aee9c5 commit 373d93d867a22538d2736f99c00f32214d136089
Showing with 2,811 additions and 2,593 deletions.
  1. +23 −0 .scalafmt.conf
  2. +0 −3 .travis.yml
  3. +4 −5 README.md
  4. +17 −44 build.sbt
  5. +47 −0 project/ProjectPlugin.scala
  6. +1 −2 project/build.properties
  7. +6 −3 project/plugins.sbt
  8. +259 −260 src/main/scala/fpinscalalib/ErrorHandlingSection.scala
  9. +9 −4 src/main/scala/fpinscalalib/FPinScalaLibrary.scala
  10. +329 −326 src/main/scala/fpinscalalib/FunctionalDataStructuresSection.scala
  11. +149 −146 src/main/scala/fpinscalalib/FunctionalParallelismSection.scala
  12. +196 −192 src/main/scala/fpinscalalib/FunctionalStateSection.scala
  13. +52 −47 src/main/scala/fpinscalalib/GettingStartedWithFPSection.scala
  14. +338 −331 src/main/scala/fpinscalalib/ParserCombinatorsSection.scala
  15. +263 −265 src/main/scala/fpinscalalib/PropertyBasedTestingSection.scala
  16. +278 −279 src/main/scala/fpinscalalib/StrictnessAndLazinessSection.scala
  17. +21 −16 src/main/scala/fpinscalalib/customlib/errorhandling/EitherHelper.scala
  18. +14 −9 src/main/scala/fpinscalalib/customlib/errorhandling/ExampleHelper.scala
  19. +27 −25 src/main/scala/fpinscalalib/customlib/errorhandling/OptionHelper.scala
  20. +101 −94 src/main/scala/fpinscalalib/customlib/functionaldatastructures/ListHelper.scala
  21. +26 −22 src/main/scala/fpinscalalib/customlib/functionaldatastructures/TreeHelper.scala
  22. +29 −23 src/main/scala/fpinscalalib/customlib/functionalparallelism/ParHelper.scala
  23. +7 −1 src/main/scala/fpinscalalib/customlib/laziness/ExampleHelper.scala
  24. +73 −66 src/main/scala/fpinscalalib/customlib/laziness/StreamHelper.scala
  25. +20 −17 src/main/scala/fpinscalalib/customlib/parsing/JSON.scala
  26. +63 −59 src/main/scala/fpinscalalib/customlib/parsing/ParsersHelper.scala
  27. +63 −53 src/main/scala/fpinscalalib/customlib/parsing/Reference.scala
  28. +49 −39 src/main/scala/fpinscalalib/customlib/state/StateHelper.scala
  29. +91 −78 src/main/scala/fpinscalalib/customlib/testing/GenHelper.scala
  30. +61 −20 src/test/scala/fpinscalalib/ErrorHandlingSpec.scala
  31. +82 −49 src/test/scala/fpinscalalib/FunctionalDataStructuresSpec.scala
  32. +13 −16 src/test/scala/fpinscalalib/FunctionalParalellismSpec.scala
  33. +12 −14 src/test/scala/fpinscalalib/FunctionalStateSpec.scala
  34. +12 −9 src/test/scala/fpinscalalib/GettingStartedWithFPSpec.scala
  35. +14 −17 src/test/scala/fpinscalalib/ParserCombinatorsSpec.scala
  36. +21 −21 src/test/scala/fpinscalalib/PropertyBasedTestingSpec.scala
  37. +40 −38 src/test/scala/fpinscalalib/StrictnessAndLazinessSpec.scala
  38. +1 −0 version.sbt
@@ -0,0 +1,23 @@
style = defaultWithAlign
maxColumn = 100

continuationIndent.callSite = 2

newlines {
sometimesBeforeColonInMethodReturnType = false
}

align {
arrowEnumeratorGenerator = false
ifWhileOpenParen = false
openParenCallSite = false
openParenDefnSite = false
}

docstrings = JavaDoc

rewrite {
rules = [SortImports, RedundantBraces]
redundantBraces.maxLines = 1
}

@@ -15,6 +15,3 @@ after_success:
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then
sbt compile publishSigned;
fi
- if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then
echo "Not in master branch, skipping deploy and release";
fi
@@ -1,22 +1,21 @@
#Scala Exercises - "Functional Programming in Scala" library

# Scala Exercises - "Functional Programming in Scala" library
------------------------

This repository hosts a content library for the [Scala Exercises](https://www.scala-exercises.org/) platform, that includes interactive exercises related to the "Functional Programming in Scala" book by written by Paul Chiusano and Rúnar Bjarnason and published by Manning.
This content library is meant to be used in tandem with the book, although excerpts of the theory needed to complete them have been added to guide you. For more information about "Functional Programming in Scala" please visit its [official website](https://www.manning.com/books/functional-programming-in-scala).

##About Scala exercises
## About Scala exercises

"Scala Exercises" brings exercises for the Stdlib, Cats, Shapeless and many other great libraries for Scala to your browser. Offering hundreds of solvable exercises organized into several categories covering the basics of the Scala language and its most important libraries.

Scala Exercises is available at [scala-exercises.org](https://scala-exercises.org).

##Contributing
## Contributing

Contributions are welcome! Please join our [Gitter channel](https://gitter.im/scala-exercises/scala-exercises)
to get involved, or visit our [GitHub site](https://github.com/scala-exercises).

##License
## License

Copyright (C) 2012 Manning Publications, Co.
Copyright (C) 2015-2016 47 Degrees, LLC.
@@ -1,49 +1,22 @@
val scalaExerciesV = "0.4.0-SNAPSHOT"

def dep(artifactId: String) = "org.scala-exercises" %% artifactId % scalaExerciesV

lazy val fpinscala = (project in file("."))
.settings(publishSettings:_*)
.enablePlugins(ExerciseCompilerPlugin)
.settings(
organization := "org.scala-exercises",
name := "exercises-fpinscala",
scalaVersion := "2.11.8",
version := "0.3.0-SNAPSHOT",
resolvers ++= Seq(
Resolver.sonatypeRepo("snapshots"),
Resolver.sonatypeRepo("releases")
),
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "2.2.4",
"org.scala-exercises" %% "exercise-compiler" % version.value,
"org.scala-exercises" %% "definitions" % version.value,
"org.scalacheck" %% "scalacheck" % "1.12.5",
"com.github.alexarchambault" %% "scalacheck-shapeless_1.12" % "0.3.1",
compilerPlugin("org.spire-math" %% "kind-projector" % "0.9.0")
.enablePlugins(ExerciseCompilerPlugin)
.settings(
name := "exercises-fpinscala",
libraryDependencies ++= Seq(
dep("exercise-compiler"),
dep("definitions"),
%%("scalatest"),
%%("scalacheck"),
%%("scheckShapeless")
)
)
)

// Distribution

lazy val gpgFolder = sys.env.getOrElse("PGP_FOLDER", ".")

lazy val publishSettings = Seq(
organizationName := "Scala Exercises",
organizationHomepage := Some(new URL("http://scala-exercises.org")),
startYear := Some(2016),
description := "Scala Exercises: The path to enlightenment",
homepage := Some(url("http://scala-exercises.org")),
pgpPassphrase := Some(sys.env.getOrElse("PGP_PASSPHRASE", "").toCharArray),
pgpPublicRing := file(s"$gpgFolder/pubring.gpg"),
pgpSecretRing := file(s"$gpgFolder/secring.gpg"),
credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", sys.env.getOrElse("PUBLISH_USERNAME", ""), sys.env.getOrElse("PUBLISH_PASSWORD", "")),
scmInfo := Some(ScmInfo(url("https://github.com/scala-exercises/exercises-fpinscala"), "https://github.com/scala-exercises/exercises-fpinscala.git")),
licenses := Seq("Apache License, Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")),
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := Function.const(false),
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("Snapshots" at nexus + "content/repositories/snapshots")
else
Some("Releases" at nexus + "service/local/staging/deploy/maven2")
}
)
pgpPassphrase := Some(getEnvVar("PGP_PASSPHRASE").getOrElse("").toCharArray)
pgpPublicRing := file(s"$gpgFolder/pubring.gpg")
pgpSecretRing := file(s"$gpgFolder/secring.gpg")
@@ -0,0 +1,47 @@
import de.heikoseeberger.sbtheader.HeaderPattern
import de.heikoseeberger.sbtheader.HeaderPlugin.autoImport._
import sbt.Keys._
import sbt._
import sbtorgpolicies._
import sbtorgpolicies.model._
import sbtorgpolicies.OrgPoliciesPlugin.autoImport._

object ProjectPlugin extends AutoPlugin {

override def trigger: PluginTrigger = allRequirements

override def requires: Plugins = plugins.JvmPlugin && OrgPoliciesPlugin

override def projectSettings: Seq[Def.Setting[_]] =
Seq(
description := "Scala Exercises: The path to enlightenment",
startYear := Option(2016),
orgGithubSetting := GitHubSettings(
organization = "scala-exercises",
project = name.value,
organizationName = "Scala Exercises",
groupId = "org.scala-exercises",
organizationHomePage = url("https://www.scala-exercises.org"),
organizationEmail = "hello@47deg.com"
),
orgLicenseSetting := ApacheLicense,
scalaVersion := "2.11.8",
scalaOrganization := "org.scala-lang",
crossScalaVersions := Seq("2.11.8"),
resolvers ++= Seq(
Resolver.mavenLocal,
Resolver.sonatypeRepo("snapshots"),
Resolver.sonatypeRepo("releases")
),
scalacOptions := scalacCommonOptions ++ scalacLanguageOptions,
headers := Map(
"scala" -> (HeaderPattern.cStyleBlockComment,
s"""|/*
| * scala-exercises - ${name.value}
| * Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
| */
|
|""".stripMargin)
)
)
}
@@ -1,2 +1 @@
sbt.version=0.13.12

sbt.version=0.13.13
@@ -1,3 +1,6 @@
resolvers += Resolver.sonatypeRepo("snapshots")
addSbtPlugin("org.scala-exercises" % "sbt-exercise" % "0.3.0-SNAPSHOT", "0.13", "2.10")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
resolvers ++= Seq(
Resolver.sonatypeRepo("snapshots")
)

addSbtPlugin("org.scala-exercises" % "sbt-exercise" % "0.4.0-SNAPSHOT", "0.13", "2.10")
addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.3.2")

0 comments on commit 373d93d

Please sign in to comment.
You can’t perform that action at this time.