Skip to content

Commit 373d93d

Browse files
Integrates sbt-org-policies plugin (#34)
1 parent 0aee9c5 commit 373d93d

38 files changed

+2811
-2593
lines changed

.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: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,3 @@ after_success:
1515
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then
1616
sbt compile publishSigned;
1717
fi
18-
- if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then
19-
echo "Not in master branch, skipping deploy and release";
20-
fi

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
#Scala Exercises - "Functional Programming in Scala" library
2-
1+
# Scala Exercises - "Functional Programming in Scala" library
32
------------------------
43

54
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.
65
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).
76

8-
##About Scala exercises
7+
## About Scala exercises
98

109
"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.
1110

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

14-
##Contributing
13+
## Contributing
1514

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

19-
##License
18+
## License
2019

2120
Copyright (C) 2012 Manning Publications, Co.
2221
Copyright (C) 2015-2016 47 Degrees, LLC.

build.sbt

Lines changed: 17 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,22 @@
1+
val scalaExerciesV = "0.4.0-SNAPSHOT"
2+
3+
def dep(artifactId: String) = "org.scala-exercises" %% artifactId % scalaExerciesV
4+
15
lazy val fpinscala = (project in file("."))
2-
.settings(publishSettings:_*)
3-
.enablePlugins(ExerciseCompilerPlugin)
4-
.settings(
5-
organization := "org.scala-exercises",
6-
name := "exercises-fpinscala",
7-
scalaVersion := "2.11.8",
8-
version := "0.3.0-SNAPSHOT",
9-
resolvers ++= Seq(
10-
Resolver.sonatypeRepo("snapshots"),
11-
Resolver.sonatypeRepo("releases")
12-
),
13-
libraryDependencies ++= Seq(
14-
"org.scalatest" %% "scalatest" % "2.2.4",
15-
"org.scala-exercises" %% "exercise-compiler" % version.value,
16-
"org.scala-exercises" %% "definitions" % version.value,
17-
"org.scalacheck" %% "scalacheck" % "1.12.5",
18-
"com.github.alexarchambault" %% "scalacheck-shapeless_1.12" % "0.3.1",
19-
compilerPlugin("org.spire-math" %% "kind-projector" % "0.9.0")
6+
.enablePlugins(ExerciseCompilerPlugin)
7+
.settings(
8+
name := "exercises-fpinscala",
9+
libraryDependencies ++= Seq(
10+
dep("exercise-compiler"),
11+
dep("definitions"),
12+
%%("scalatest"),
13+
%%("scalacheck"),
14+
%%("scheckShapeless")
15+
)
2016
)
21-
)
2217

2318
// Distribution
2419

25-
lazy val gpgFolder = sys.env.getOrElse("PGP_FOLDER", ".")
26-
27-
lazy val publishSettings = Seq(
28-
organizationName := "Scala Exercises",
29-
organizationHomepage := Some(new URL("http://scala-exercises.org")),
30-
startYear := Some(2016),
31-
description := "Scala Exercises: The path to enlightenment",
32-
homepage := Some(url("http://scala-exercises.org")),
33-
pgpPassphrase := Some(sys.env.getOrElse("PGP_PASSPHRASE", "").toCharArray),
34-
pgpPublicRing := file(s"$gpgFolder/pubring.gpg"),
35-
pgpSecretRing := file(s"$gpgFolder/secring.gpg"),
36-
credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", sys.env.getOrElse("PUBLISH_USERNAME", ""), sys.env.getOrElse("PUBLISH_PASSWORD", "")),
37-
scmInfo := Some(ScmInfo(url("https://github.com/scala-exercises/exercises-fpinscala"), "https://github.com/scala-exercises/exercises-fpinscala.git")),
38-
licenses := Seq("Apache License, Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")),
39-
publishMavenStyle := true,
40-
publishArtifact in Test := false,
41-
pomIncludeRepository := Function.const(false),
42-
publishTo := {
43-
val nexus = "https://oss.sonatype.org/"
44-
if (isSnapshot.value)
45-
Some("Snapshots" at nexus + "content/repositories/snapshots")
46-
else
47-
Some("Releases" at nexus + "service/local/staging/deploy/maven2")
48-
}
49-
)
20+
pgpPassphrase := Some(getEnvVar("PGP_PASSPHRASE").getOrElse("").toCharArray)
21+
pgpPublicRing := file(s"$gpgFolder/pubring.gpg")
22+
pgpSecretRing := file(s"$gpgFolder/secring.gpg")

project/ProjectPlugin.scala

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import de.heikoseeberger.sbtheader.HeaderPattern
2+
import de.heikoseeberger.sbtheader.HeaderPlugin.autoImport._
3+
import sbt.Keys._
4+
import sbt._
5+
import sbtorgpolicies._
6+
import sbtorgpolicies.model._
7+
import sbtorgpolicies.OrgPoliciesPlugin.autoImport._
8+
9+
object ProjectPlugin extends AutoPlugin {
10+
11+
override def trigger: PluginTrigger = allRequirements
12+
13+
override def requires: Plugins = plugins.JvmPlugin && OrgPoliciesPlugin
14+
15+
override def projectSettings: Seq[Def.Setting[_]] =
16+
Seq(
17+
description := "Scala Exercises: The path to enlightenment",
18+
startYear := Option(2016),
19+
orgGithubSetting := GitHubSettings(
20+
organization = "scala-exercises",
21+
project = name.value,
22+
organizationName = "Scala Exercises",
23+
groupId = "org.scala-exercises",
24+
organizationHomePage = url("https://www.scala-exercises.org"),
25+
organizationEmail = "[email protected]"
26+
),
27+
orgLicenseSetting := ApacheLicense,
28+
scalaVersion := "2.11.8",
29+
scalaOrganization := "org.scala-lang",
30+
crossScalaVersions := Seq("2.11.8"),
31+
resolvers ++= Seq(
32+
Resolver.mavenLocal,
33+
Resolver.sonatypeRepo("snapshots"),
34+
Resolver.sonatypeRepo("releases")
35+
),
36+
scalacOptions := scalacCommonOptions ++ scalacLanguageOptions,
37+
headers := Map(
38+
"scala" -> (HeaderPattern.cStyleBlockComment,
39+
s"""|/*
40+
| * scala-exercises - ${name.value}
41+
| * Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com>
42+
| */
43+
|
44+
|""".stripMargin)
45+
)
46+
)
47+
}

project/build.properties

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
sbt.version=0.13.12
2-
1+
sbt.version=0.13.13

project/plugins.sbt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
resolvers += Resolver.sonatypeRepo("snapshots")
2-
addSbtPlugin("org.scala-exercises" % "sbt-exercise" % "0.3.0-SNAPSHOT", "0.13", "2.10")
3-
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
1+
resolvers ++= Seq(
2+
Resolver.sonatypeRepo("snapshots")
3+
)
4+
5+
addSbtPlugin("org.scala-exercises" % "sbt-exercise" % "0.4.0-SNAPSHOT", "0.13", "2.10")
6+
addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.3.2")

0 commit comments

Comments
 (0)