Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
22 changed files
with
245 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,25 @@ | ||
val scalaExerciesV = "0.4.0-SNAPSHOT" | ||
|
||
def dep(artifactId: String) = "org.scala-exercises" %% artifactId % scalaExerciesV | ||
|
||
lazy val fetch = (project in file(".")) | ||
.settings(publishSettings:_*) | ||
.enablePlugins(ExerciseCompilerPlugin) | ||
.settings( | ||
organization := "org.scala-exercises", | ||
name := "exercises-fetch", | ||
scalaVersion := "2.11.8", | ||
version := "0.3.0-SNAPSHOT", | ||
resolvers ++= Seq( | ||
Resolver.sonatypeRepo("snapshots"), | ||
Resolver.sonatypeRepo("releases") | ||
), | ||
libraryDependencies ++= Seq( | ||
"com.fortysevendeg" %% "fetch" % "0.4.0", | ||
"com.fortysevendeg" %% "fetch-monix" % "0.4.0", | ||
"com.chuusai" %% "shapeless" % "2.2.5", | ||
"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.3") | ||
.enablePlugins(ExerciseCompilerPlugin) | ||
.settings( | ||
name := "exercises-fetch", | ||
libraryDependencies ++= Seq( | ||
dep("exercise-compiler"), | ||
dep("definitions"), | ||
%%("fetch"), | ||
%%("fetch-monix"), | ||
%%("shapeless"), | ||
%%("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-fetch"), "https://github.com/scala-exercises/exercises-fetch.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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 := sbtorgpolicies.model.scalacCommonOptions, | ||
headers := Map( | ||
"scala" -> (HeaderPattern.cStyleBlockComment, | ||
s"""|/* | ||
| * scala-exercises - ${name.value} | ||
| * Copyright (C) 2015-2016 47 Degrees, LLC. <http://www.47deg.com> | ||
| */ | ||
| | ||
|""".stripMargin) | ||
) | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=0.13.12 | ||
sbt.version=0.13.13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
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") | ||
addSbtPlugin("org.scala-exercises" % "sbt-exercise" % "0.4.0-SNAPSHOT", "0.13", "2.10") | ||
addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.3.2") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.