-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from viktor-podzigun/fix_10_migrate_to_sbt_1_x
Migrated to sbt 1.x, fixed #10
- Loading branch information
Showing
30 changed files
with
243 additions
and
238 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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
|
||
# idea | ||
.idea | ||
*.iml | ||
|
||
# configuration files | ||
config.sbt | ||
|
||
# workflow stuff | ||
.gitignore | ||
target |
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,15 +1,27 @@ | ||
language: scala | ||
sudo: false | ||
scala: | ||
- "2.10.7" | ||
- "2.12.1" | ||
jdk: | ||
- oraclejdk7 | ||
script: sbt ++${TRAVIS_SCALA_VERSION} test publishM2 scripted | ||
- oraclejdk8 | ||
dist: trusty | ||
script: | ||
- sbt ++${TRAVIS_SCALA_VERSION} test publishM2 scripted | ||
env: | ||
global: | ||
- TRAVIS_SBT_VERSION="1.2.8" | ||
- secure: "adngy4wHe+DLnkLW0K7S8KFe+GR2mTMHx3VPs4YFooXSkJlRZMzhMzd2nJN0VNb2U7zkIrtLvsykLGIaeKF3u02iheHt3RCpRoKmxOjAkFXSRm6V7Z1J+EMVHqAG/72L2P2KkjJEaXrQqE3yG6e6elRk+qp2V3zKpQ6E5sS/g3c=" | ||
- secure: "fjMyfWi+UndcsT+Voqxt1NVvIbqPKwDzipxK18zd+eEgASam+L4fgtmDsIXjbgdBaTX59w+Q1DNnAOT7x34XpneU+GDASDmoNdj6oCoZOHiQb/odu2WOBWf/iINCTpJtPMMr8cLQaQ3CsnSyOojaJiFERDMcO9i58kDfU1gXa/4=" | ||
branches: | ||
only: | ||
- master | ||
notifications: | ||
slack: storm-enroute:GnbA8DEy3mL3Pyp3cbptr7F2 | ||
cache: | ||
directories: | ||
- "$HOME/.ivy2/cache" | ||
- "$HOME/.sbt" | ||
before_cache: | ||
# Cleanup the cached directories to avoid unnecessary cache updates | ||
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete | ||
- find $HOME/.sbt -name "*.lock" -print -delete |
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,25 +1,81 @@ | ||
|
||
// set environment variables to publish | ||
// in newer SBT versions, this apparently has to go to `build.sbt` | ||
import java.io._ | ||
|
||
{ | ||
val publishUser = "SONATYPE_USER" | ||
val publishPass = "SONATYPE_PASS" | ||
val userPass = for { | ||
user <- sys.env.get(publishUser) | ||
pass <- sys.env.get(publishPass) | ||
} yield (user, pass) | ||
val publishCreds: Seq[Setting[_]] = Seq(userPass match { | ||
case Some((user, pass)) => | ||
println(s"Username and password for Sonatype picked up: '$user', '${if (pass != "") "******" else ""}'") | ||
credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", user, pass) | ||
case None => | ||
// prevent publishing | ||
val errorMessage = | ||
"Publishing to Sonatype is disabled since the \"" + | ||
publishUser + "\" and/or \"" + publishPass + "\" environment variables are not set." | ||
println(errorMessage) | ||
publish <<= streams.map(_.log.info(errorMessage)) | ||
}) | ||
publishCreds | ||
} | ||
val ideExcludedDirectories = SettingKey[Seq[File]]("ide-excluded-directories") | ||
|
||
lazy val mecha = (project in file(".")) | ||
.enablePlugins(SbtPlugin) | ||
.settings( | ||
scriptedLaunchOpts := { scriptedLaunchOpts.value ++ | ||
Seq("-Xmx1024M", "-XX:MaxPermSize=256M", "-Dplugin.version=" + version.value) | ||
}, | ||
scriptedBufferLog := false | ||
) | ||
.settings( | ||
sbtPlugin := true, | ||
name := "mecha", | ||
scalaVersion := "2.12.1", | ||
version := { | ||
def versionFromFile(filename: String): String = { | ||
val fis = new FileInputStream(filename) | ||
val props = new java.util.Properties() | ||
try props.load(fis) | ||
finally fis.close() | ||
|
||
val major = props.getProperty("mecha_major") | ||
val minor = props.getProperty("mecha_minor") | ||
s"$major.$minor" | ||
} | ||
|
||
versionFromFile(baseDirectory.value + File.separator + "version.conf") | ||
}, | ||
organization := "com.storm-enroute", | ||
libraryDependencies ++= Seq( | ||
"com.typesafe" % "config" % "1.2.1", | ||
"commons-io" % "commons-io" % "2.4", | ||
"com.decodified" %% "scala-ssh" % "0.8.0", | ||
"com.github.pathikrit" %% "better-files" % "2.17.1", | ||
//test | ||
"org.specs2" %% "specs2-core" % "3.8.6" % "test", | ||
"org.specs2" %% "specs2-junit" % "3.8.6" % "test", | ||
"junit" % "junit" % "4.12" % "test" | ||
), | ||
ideExcludedDirectories := { | ||
val base = baseDirectory.value | ||
List( | ||
base / ".idea", | ||
base / "target" | ||
) | ||
}, | ||
publishMavenStyle := true, | ||
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") | ||
}, | ||
publishArtifact in Test := false, | ||
pomIncludeRepository := { _ => false }, | ||
pomExtra := { | ||
<url>http://storm-enroute.com/</url> | ||
<licenses> | ||
<license> | ||
<name>BSD-style</name> | ||
<url>http://opensource.org/licenses/BSD-3-Clause</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
<scm> | ||
<url>git@github.com:storm-enroute/mecha.git</url> | ||
<connection>scm:git:git@github.com:storm-enroute/mecha.git</connection> | ||
</scm> | ||
<developers> | ||
<developer> | ||
<id>axel22</id> | ||
<name>Aleksandar Prokopec</name> | ||
<url>http://axel22.github.com/</url> | ||
</developer> | ||
</developers> | ||
} | ||
) |
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 @@ | ||
2.10.7 | ||
2.12.1 |
This file was deleted.
Oops, something went wrong.
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.17 | ||
sbt.version=1.2.8 |
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,4 +1,2 @@ | ||
|
||
addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.1") | ||
|
||
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.6.0") | ||
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0") |
This file was deleted.
Oops, something went wrong.
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,12 @@ | ||
|
||
val maybeCredentials = for { | ||
username <- Option(System.getenv().get("SONATYPE_USER")) | ||
password <- Option(System.getenv().get("SONATYPE_PASS")) | ||
} yield Credentials( | ||
"Sonatype Nexus Repository Manager", | ||
"oss.sonatype.org", | ||
username, | ||
password | ||
) | ||
|
||
credentials ++= maybeCredentials.toSeq |
Oops, something went wrong.