Skip to content

Commit

Permalink
Merge pull request #8 from Iterable/MOB-8614
Browse files Browse the repository at this point in the history
Update error message.
  • Loading branch information
douglasthomsen authored Aug 22, 2024
2 parents eac4a50 + a4ed8c1 commit dcac308
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ trait CodeArtifactKeys {

val codeArtifactResolvers: SettingKey[List[String]] =
settingKey[List[String]]("Additional CodeArtifact repos from which to consume packages.")

val codeArtifactGetTokenInstructions =
settingKey[Option[String]]("Instructions on how to get a token for CodeArtifact")
}

trait InternalCodeArtifactKeys {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ object CodeArtifactPlugin extends AutoPlugin {

def buildPublishSettings: Seq[Setting[_]] = Seq(
ThisBuild / codeArtifactUrl := "",
ThisBuild / codeArtifactGetTokenInstructions := None,
ThisBuild / codeArtifactResolvers := Nil
)

Expand All @@ -43,7 +44,20 @@ object CodeArtifactPlugin extends AutoPlugin {
),
credentials ++= {
val token = codeArtifactToken.value.getOrElse {
streams.value.log.warn("Unable to get AWS CodeArtifact auth token.")
streams.value.log.warn(
"""
| ___ ______ ____ _ _ _ _ __ _
| / \ \ / / ___| / ___|___ __| | ___ / \ _ __| |_(_)/ _| __ _ ___| |_
| / _ \ \ /\ / /\___ \ | | / _ \ / _` |/ _ \ / _ \ | '__| __| | |_ / _` |/ __| __|
| / ___ \ V V / ___) | | |__| (_) | (_| | __// ___ \| | | |_| | _| (_| | (__| |_
|/_/ \_\_/\_/ |____/ \____\___/ \__,_|\___/_/ \_\_| \__|_|_| \__,_|\___|\__|
|
|
|The AWS CodeArtifact sbt plugin was not able to get a valid auth token. If you recieve and error due to
|the a dependency not being found then it could be caused by this.""".stripMargin
)
val instructions = codeArtifactGetTokenInstructions.value.map("\n" + _ + "\n").getOrElse("")
streams.value.log.warn(instructions)
""
}
val repos = codeArtifactRepo.value +: codeArtifactResolvers.value
Expand Down

0 comments on commit dcac308

Please sign in to comment.