Skip to content

Commit

Permalink
Updating for iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasthomsen committed Aug 13, 2024
1 parent 99e7a8b commit fe3b082
Showing 1 changed file with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name := "resolver-test"
scalaVersion := "2.13.5"

// This is a real url, and it must be, but only I'll be able to
// use it since only I have the aws creds to get an auth token.
val repoUrl = "https://bbstilson-968410040515.d.codeartifact.us-west-2.amazonaws.com/maven/test/"

codeArtifactUrl := repoUrl
// Adding the same repo again.
// We should see the same credentials and resolvers twice.
codeArtifactResolvers := List(repoUrl)

lazy val checkResolversAndCredentials = taskKey[Unit](
"Ensures that resolvers and credentials are added for the" +
"codeArtifactUrl repo and any repos added via codeArtifactResolvers."
)

checkResolversAndCredentials := {
val repos = resolvers.value.map(_.name)
val creds = credentials.value.map(_.toString())

assert(repos.size == 2, "CodeArtifact resolvers were not added.")
assert(creds.size == 2, "CodeArtifact credentials were not added.")
assert(creds.head == creds.last, "Credentials did not match.")
assert(repos.head == repos.last, "Resolvers did not match.")

streams.value.log.success("Added credentials and resolvers.")
}
//name := "resolver-test"
//scalaVersion := "2.13.5"
//
//// This is a real url, and it must be, but only I'll be able to
//// use it since only I have the aws creds to get an auth token.
//val repoUrl = "https://bbstilson-968410040515.d.codeartifact.us-west-2.amazonaws.com/maven/test/"
//
//codeArtifactUrl := repoUrl
//// Adding the same repo again.
//// We should see the same credentials and resolvers twice.
//codeArtifactResolvers := List(repoUrl)
//
//lazy val checkResolversAndCredentials = taskKey[Unit](
// "Ensures that resolvers and credentials are added for the" +
// "codeArtifactUrl repo and any repos added via codeArtifactResolvers."
//)
//
//checkResolversAndCredentials := {
// val repos = resolvers.value.map(_.name)
// val creds = credentials.value.map(_.toString())
//
// assert(repos.size == 2, "CodeArtifact resolvers were not added.")
// assert(creds.size == 2, "CodeArtifact credentials were not added.")
// assert(creds.head == creds.last, "Credentials did not match.")
// assert(repos.head == repos.last, "Resolvers did not match.")
//
// streams.value.log.success("Added credentials and resolvers.")
//}

0 comments on commit fe3b082

Please sign in to comment.