11lazy val `scala-tutorial` = (project in file(" ." ))
22 .enablePlugins(ExerciseCompilerPlugin )
3+ .settings(publishSettings:_* )
34 .settings(
45 organization := " org.scala-exercises" ,
56 name := " exercises-scalatutorial" ,
@@ -17,4 +18,32 @@ lazy val `scala-tutorial` = (project in file("."))
1718 " com.github.alexarchambault" %% " scalacheck-shapeless_1.12" % " 0.3.1" ,
1819 compilerPlugin(" org.spire-math" %% " kind-projector" % " 0.7.1" )
1920 )
20- )
21+ )
22+
23+ // Distribution
24+
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-scalatutorial" ), " https://github.com/scala-exercises/exercises-scalatutorial.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+ )
0 commit comments