Skip to content

Commit

Permalink
Fixed warts
Browse files Browse the repository at this point in the history
  • Loading branch information
laughedelic committed Aug 17, 2016
1 parent 71675ef commit 15ba582
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ organization := "ohnosequences"
description := "SBT plugin which provides Amazon S3 bucket resolvers"

javaVersion := "1.7"
scalaVersion := "2.10.5"
scalaVersion := "2.10.6"

bucketSuffix := "era7.com"

libraryDependencies += "ohnosequences" % "ivy-s3-resolver" % "0.9.0"

// dependencyOverrides += "commons-codec" % "commons-codec" % "1.6"
wartremoverErrors in (Compile, compile) --= Seq(Wart.Any, Wart.NonUnitStatements)
17 changes: 10 additions & 7 deletions src/main/scala/SBTS3Resolver.scala
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ object SbtS3Resolver extends AutoPlugin {

// Converting S3Resolver to the standard sbt Resolver
implicit def toSbtResolver(s3r: S3Resolver): Resolver = {
if (s3r.getIvyPatterns.isEmpty || s3r.getArtifactPatterns.isEmpty)
if (s3r.getIvyPatterns.isEmpty || s3r.getArtifactPatterns.isEmpty) {
s3r withPatterns Resolver.defaultPatterns
}
new sbt.RawRepository(s3r)
}

Expand Down Expand Up @@ -88,7 +89,7 @@ object SbtS3Resolver extends AutoPlugin {
override def trigger: PluginTrigger = allRequirements

// Default settings
override lazy val projectSettings = Seq[Setting[_]](
override def projectSettings: Seq[Setting[_]] = Seq(
awsProfile := "default",
s3credentials :=
new ProfileCredentialsProvider(awsProfile.value) |
Expand All @@ -99,11 +100,13 @@ object SbtS3Resolver extends AutoPlugin {
s3sse := false,
s3acl := com.amazonaws.services.s3.model.CannedAccessControlList.PublicRead,
s3resolver := S3Resolver(s3credentials.value, s3overwrite.value, s3region.value, s3acl.value,s3sse.value),
showS3Credentials <<= (s3credentials, streams) map { (provider, str) =>
val creds = provider.getCredentials
str.log.info("AWS credentials loaded in 's3credentials' setting key:")
str.log.info("Access key: " + creds.getAWSAccessKeyId)
str.log.info("Secret key: " + creds.getAWSSecretKey)
showS3Credentials := {
val log = streams.value.log
val creds = s3credentials.value.getCredentials

log.info("AWS credentials loaded in 's3credentials' setting key:")
log.info("Access key: " + creds.getAWSAccessKeyId)
log.info("Secret key: " + creds.getAWSSecretKey)
}
)

Expand Down

0 comments on commit 15ba582

Please sign in to comment.