Skip to content

Commit e46a133

Browse files
Merge pull request #22 from scala-exercises/updates-project
Updates Project
2 parents 3362789 + 6c7500a commit e46a133

File tree

11 files changed

+120
-64
lines changed

11 files changed

+120
-64
lines changed

.scalafmt.conf

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

.travis.yml

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

LICENSE renamed to LICENSE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,15 @@
178178
APPENDIX: How to apply the Apache License to your work.
179179

180180
To apply the Apache License to your work, attach the following
181-
boilerplate notice, with the fields enclosed by brackets "{}"
181+
boilerplate notice, with the fields enclosed by brackets "[]"
182182
replaced with your own identifying information. (Don't include
183183
the brackets!) The text should be enclosed in the appropriate
184184
comment syntax for the file format. We also recommend that a
185185
file or class name and description of purpose be included on the
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright {yyyy} {name of copyright owner}
189+
Copyright (C) 2016-2020 47 Degrees <https://47deg.com>
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.
@@ -198,4 +198,4 @@
198198
distributed under the License is distributed on an "AS IS" BASIS,
199199
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200200
See the License for the specific language governing permissions and
201-
limitations under the License.
201+
limitations under the License.

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Scala Exercises - template library
22

3-
------------------------
43

54
This repository hosts a template content library for the [Scala Exercises](https://www.scala-exercises.org/) platform, in order to make the creation process of content libraries easier.
65

build.sbt

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
1-
val scalaExercisesV = "0.5.0-SNAPSHOT"
1+
addCommandAlias("ci-test", "scalafmtCheckAll; scalafmtSbtCheck; test")
2+
addCommandAlias("ci-docs", "github; project-docs/mdoc; headerCreateAll")
23

3-
def dep(artifactId: String) = "org.scala-exercises" %% artifactId % scalaExercisesV
4-
5-
lazy val template = (project in file("."))
4+
lazy val exercises = (project in file("."))
5+
.settings(moduleName := "exercises-template")
6+
.settings(exercisesSettings)
67
.enablePlugins(ExerciseCompilerPlugin)
7-
.settings(
8-
organization := "org.scala-exercises",
9-
name := "exercises-template",
10-
scalaVersion := "2.12.10",
11-
version := "0.5.0-SNAPSHOT",
12-
resolvers ++= Seq(
13-
Resolver.sonatypeRepo("snapshots"),
14-
Resolver.sonatypeRepo("releases")
15-
),
16-
libraryDependencies ++= Seq(
17-
dep("exercise-compiler"),
18-
dep("definitions"),
19-
%%("shapeless", "2.3.3"),
20-
%%("scalatest", "3.1.1"),
21-
%%("scalacheck", "1.14.3"),
22-
"com.github.alexarchambault" %% "scalacheck-shapeless_1.14" % "1.2.5",
23-
"org.scalatestplus" %% "scalatestplus-scalacheck" % "3.1.0.0-RC2"
24-
),
25-
addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.11.0" cross CrossVersion.full)
26-
)
8+
9+
lazy val `project-docs` = (project in file(".docs"))
10+
.aggregate(exercises)
11+
.settings(moduleName := "exercises-project-docs")
12+
.settings(mdocIn := file(".docs"))
13+
.settings(mdocOut := file("."))
14+
.settings(skip in publish := true)
15+
.enablePlugins(MdocPlugin)

project/ProjectPlugin.scala

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import sbt.Keys._
2+
import sbt._
3+
import com.alejandrohdezma.sbt.github.SbtGithubPlugin
4+
5+
object ProjectPlugin extends AutoPlugin {
6+
7+
override def trigger: PluginTrigger = allRequirements
8+
9+
override def requires: Plugins = plugins.JvmPlugin && SbtGithubPlugin
10+
11+
object autoImport {
12+
13+
lazy val V = new {
14+
val shapeless: String = "2.3.3"
15+
val scala: String = "2.13.2"
16+
val scalaExercises: String = "0.6.0-SNAPSHOT"
17+
val scalacheck: String = "1.14.3"
18+
val scalacheckShapeless: String = "1.2.5"
19+
val scalatest: String = "3.1.1"
20+
val scalatestplusScheck: String = "3.1.1.1"
21+
}
22+
23+
def dep(artifactId: String) = "org.scala-exercises" %% artifactId % V.scalaExercises
24+
25+
lazy val exercisesSettings = Seq(
26+
libraryDependencies ++= Seq(
27+
dep("exercise-compiler"),
28+
dep("definitions"),
29+
"com.chuusai" %% "shapeless" % V.shapeless,
30+
"org.scalatest" %% "scalatest" % V.scalatest,
31+
"org.scalacheck" %% "scalacheck" % V.scalacheck,
32+
"org.scalatestplus" %% "scalacheck-1-14" % V.scalatestplusScheck,
33+
"com.github.alexarchambault" %% "scalacheck-shapeless_1.14" % V.scalacheckShapeless
34+
)
35+
)
36+
}
37+
38+
override def projectSettings: Seq[Def.Setting[_]] =
39+
Seq(
40+
organization := "org.scala-exercises",
41+
organizationName := "47 Degrees",
42+
organizationHomepage := Some(url("https://47deg.com")),
43+
scalaVersion := autoImport.V.scala,
44+
resolvers ++= Seq(
45+
Resolver.sonatypeRepo("snapshots"),
46+
Resolver.sonatypeRepo("releases")
47+
)
48+
)
49+
}

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version = 1.3.8
1+
sbt.version = 1.3.10

project/plugins.sbt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
resolvers += Resolver.sonatypeRepo("snapshots")
2-
addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.13.3")
3-
addSbtPlugin("org.scala-exercises" % "sbt-exercise" % "0.5.0-SNAPSHOT")
2+
addSbtPlugin("org.scala-exercises" % "sbt-exercise" % "0.6.0-SNAPSHOT")
3+
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.3")
4+
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.1.5")
5+
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.4")
6+
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0")
7+
addSbtPlugin("com.alejandrohdezma" %% "sbt-github" % "0.8.0")
8+
addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "0.8.0")
9+
addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "0.8.0")
10+
addSbtPlugin("com.alejandrohdezma" % "sbt-mdoc-toc" % "0.2")

src/main/scala/templatelib/MyLibrary.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ package templatelib
1818
import org.scalaexercises.definitions._
1919

2020
/** This is the description of the library as it will appear in the Scala Exercises website.
21-
*
22-
* @param name template
23-
*/
21+
*
22+
* @param name template
23+
*/
2424
object MyLibrary extends Library {
25-
override def owner = "scala-exercises"
25+
override def owner = "scala-exercises"
2626
override def repository = "scala-exercises"
27-
override def color = Some("#323232")
27+
override def color = Some("#323232")
2828

2929
override def sections = List(
3030
SectionA

src/main/scala/templatelib/SectionA.scala

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,25 @@ import org.scalaexercises.definitions._
2121
import org.scalatest.flatspec.AnyFlatSpec
2222

2323
/** @param name section_title
24-
*/
24+
*/
2525
object SectionA extends AnyFlatSpec with Matchers with Section {
2626

2727
/** = Exercise block title =
28-
*
29-
* Text describing background about the exercise, can be as long as needed.
30-
*
31-
* {{{
32-
* // Scala code blocks can also be added to enhance your documentation.
33-
* }}}
34-
*
35-
* Also, documentation can be broken in as many paragraphs as necessary.
36-
*/
37-
def functionAssert(res0: Boolean): Unit = {
28+
*
29+
* Text describing background about the exercise, can be as long as needed.
30+
*
31+
* {{{
32+
* // Scala code blocks can also be added to enhance your documentation.
33+
* }}}
34+
*
35+
* Also, documentation can be broken in as many paragraphs as necessary.
36+
*/
37+
def functionAssert(res0: Boolean): Unit =
3838
true shouldBe res0
39-
}
4039

4140
/** And obviously you can add as many documentation and exercises as you need
42-
* to make your point ;-).
43-
*/
44-
def functionFalseAssert(res0: Boolean): Unit = {
41+
* to make your point ;-).
42+
*/
43+
def functionFalseAssert(res0: Boolean): Unit =
4544
false shouldBe res0
46-
}
4745
}

0 commit comments

Comments
 (0)