Skip to content

Library Settings and CI Configuration #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@ bin/
.DS_Store

# PGP keys
pubring.gpg
secring.gpg
13 changes: 10 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
language: scala
scala:
- 2.11.8
- 2.11.8
jdk:
- oraclejdk8
- oraclejdk8
script:
- sbt test
- sbt test
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then
openssl aes-256-cbc -K $encrypted_40545b9562dd_key -iv $encrypted_40545b9562dd_iv
-in secring.gpg.enc -out secring.gpg -d;
fi
after_success:
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then sbt
compile publishSigned; fi
31 changes: 30 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
lazy val `scala-tutorial` = (project in file("."))
.enablePlugins(ExerciseCompilerPlugin)
.settings(publishSettings:_*)
.settings(
organization := "org.scala-exercises",
name := "exercises-scalatutorial",
Expand All @@ -17,4 +18,32 @@ lazy val `scala-tutorial` = (project in file("."))
"com.github.alexarchambault" %% "scalacheck-shapeless_1.12" % "0.3.1",
compilerPlugin("org.spire-math" %% "kind-projector" % "0.7.1")
)
)
)

// 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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make all these frequently copied and pasted settings a common setting shared among exercise projects

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-scalatutorial"), "https://github.com/scala-exercises/exercises-scalatutorial.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")
}
)
3 changes: 2 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
resolvers += Resolver.sonatypeRepo("snapshots")
addSbtPlugin("org.scala-exercises" % "sbt-exercise" % "0.3.0-SNAPSHOT", "0.13", "2.10")
addSbtPlugin("org.scala-exercises" % "sbt-exercise" % "0.3.0-SNAPSHOT", "0.13", "2.10")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
18 changes: 18 additions & 0 deletions pubring.gpg
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: BCPG v1.51

mQENBFgGJjoBCACkQzvPI+1VtMYz252a3i3wm1dKrsF5v/E//IsYLMsXx/4BICES
bjZchmCbaIqjaNrfBxRAR20KbWVXbUptDJgXA/WOyGEUfDvS6Kfm1F6A34qVyCIr
NPEIeDVM64nLpQFrNuIiFPlTj9eXbKPRbV0eUrtKH59iplB4DCboK4ysGX3Hk/A3
nzmAf9+Lt9N8vuzO8ymYvdWfdzQsVPCSXkKhK2qpT+ORIPAPWGdXmZ6Rr1wAGwqY
+x0iVSL2IFs5MqDvBbDoyfnt14UVffJlI6O0C+flIY+kSCp86pYQrHHaCnWrnALU
L8Cb/DJ7DODpd99bDHtkuMHUn4BO4WmoI69zABEBAAG0JXNjYWxhLWV4ZXJjaXNl
cyA8ZGV2ZWxvcGVyQDQ3ZGVnLmNvbT6JARwEEwECAAYFAlgGJjoACgkQT9ktcdDT
ZI66CQgAkGDi0EOapqJbFMiNTH85IelGs2c04aNPnEGZh+dUHqpJvA785PduXtzT
XEP8DVP4zgjfGoDyiaJWBVXyg6Ch7XZ6gNodgOS7oQu5nFsA6ZBtwVy0qfRjfK2E
NEIvRuNjQuAlDTDHRfDtZmFIDSd4YR/smJL7BVrO5eT+qsbeluZGGi54TY/zwLbe
TefcUmTixDhm5LGyVPKiEdZwk6o385+9IAFycFozb9K/1NSTBM1GbZBMR/WuACbT
K+DDtqUnGk1cZmNbWzoVabNnubVhGnhMC9AW24pzHu+xEk13yXsPWVikB6NbVg50
TBkuFf9IEXMEzanKMDDMOatih3a8bg==
=fR5S
-----END PGP PUBLIC KEY BLOCK-----
Binary file added secring.gpg.enc
Binary file not shown.