Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
551 additions
and 435 deletions.
- +23 −0 .scalafmt.conf
- +0 −3 .travis.yml
- +3 −4 README.md
- +18 −44 build.sbt
- +47 −0 project/ProjectPlugin.scala
- +1 −1 project/build.properties
- +2 −2 project/plugins.sbt
- +45 −37 src/main/scala/scalachecklib/ArbitrarySection.scala
- +5 −0 src/main/scala/scalachecklib/GeneratorsHelper.scala
- +113 −105 src/main/scala/scalachecklib/GeneratorsSection.scala
- +157 −139 src/main/scala/scalachecklib/PropertiesSection.scala
- +88 −80 src/main/scala/scalachecklib/ScalacheckDatetimeSection.scala
- +9 −4 src/main/scala/scalachecklib/ScalacheckLibrary.scala
- +5 −0 src/test/scala/scalachecklib/ArbitrarySpec.scala
- +5 −0 src/test/scala/scalachecklib/GeneratorsSpec.scala
- +5 −0 src/test/scala/scalachecklib/PropertiesSpec.scala
- +5 −0 src/test/scala/scalachecklib/ScalacheckDatetimeSpec.scala
- +19 −16 src/test/scala/scalachecklib/Test.scala
- +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 | ||
} | ||
|
@@ -1,49 +1,23 @@ | ||
val scalaExerciesV = "0.4.0-SNAPSHOT" | ||
|
||
def dep(artifactId: String) = "org.scala-exercises" %% artifactId % scalaExerciesV | ||
|
||
lazy val scalacheck = (project in file(".")) | ||
.settings(publishSettings:_*) | ||
.enablePlugins(ExerciseCompilerPlugin) | ||
.settings( | ||
organization := "org.scala-exercises", | ||
name := "exercises-scalacheck", | ||
scalaVersion := "2.11.8", | ||
version := "0.3.0-SNAPSHOT", | ||
resolvers ++= Seq( | ||
Resolver.sonatypeRepo("snapshots"), | ||
Resolver.sonatypeRepo("releases") | ||
), | ||
libraryDependencies ++= Seq( | ||
"org.scalatest" %% "scalatest" % "3.0.1" exclude("org.scalacheck", "scalacheck"), | ||
"org.scala-exercises" %% "exercise-compiler" % version.value excludeAll ExclusionRule("com.github.alexarchambault"), | ||
"org.scala-exercises" %% "definitions" % version.value excludeAll ExclusionRule("com.github.alexarchambault"), | ||
"com.fortysevendeg" %% "scalacheck-datetime" % "0.2.0", | ||
"com.github.alexarchambault" %% "scalacheck-shapeless_1.13" % "1.1.3", | ||
compilerPlugin("org.spire-math" %% "kind-projector" % "0.9.0") | ||
.enablePlugins(ExerciseCompilerPlugin) | ||
.settings( | ||
name := "exercises-scalacheck", | ||
libraryDependencies ++= Seq( | ||
dep("exercise-compiler"), | ||
dep("definitions"), | ||
%%("scalatest"), | ||
%%("scalacheck"), | ||
%%("scheckShapeless"), | ||
"com.fortysevendeg" %% "scalacheck-datetime" % "0.2.0" | ||
) | ||
) | ||
) | ||
|
||
// Distribution | ||
|
||
lazy val gpgFolder = sys.env.getOrElse("PGP_FOLDER", ".") | ||
|
||
lazy val publishSettings = Seq( | ||
organizationName := "Scala Exercises", | ||
organizationHomepage := Some(new URL("https://scala-exercises.org")), | ||
startYear := Some(2016), | ||
description := "Scala Exercises: The path to enlightenment", | ||
homepage := Some(url("https://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-scalacheck"), "https://github.com/scala-exercises/exercises-scalacheck.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 := 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) | ||
) | ||
) | ||
} |
@@ -1 +1 @@ | ||
sbt.version=0.13.12 | ||
sbt.version=0.13.13 |
Oops, something went wrong.