Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
dependency upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
bbstilson committed Dec 2, 2023
1 parent 514a1cd commit 3fee9a4
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 20 deletions.
22 changes: 15 additions & 7 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
version = "2.7.5"
version = "3.7.17"
runner.dialect = "scala213"
maxColumn = 100
docstrings = "ScalaDoc"
docstrings {
style = SpaceAsterisk
}
assumeStandardLibraryStripMargin = true
continuationIndent.callSite = 2
continuationIndent.defnSite = 2
newlines.alwaysBeforeTopLevelStatements = true
rewrite.rules = [AvoidInfix, PreferCurlyFors, SortImports, SortModifiers]
spaces.inImportCurlyBraces = true
continuationIndent {
callSite = 2
defnSite = 2
}
rewrite {
rules = [AvoidInfix, PreferCurlyFors, SortImports, SortModifiers]
}
spaces {
inImportCurlyBraces = true
}
12 changes: 6 additions & 6 deletions core/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ enablePlugins(SbtPlugin)
name := "sbt-codeartifact-core"

libraryDependencies ++= Seq(
"software.amazon.awssdk" % "sso" % "2.17.103",
"software.amazon.awssdk" % "codeartifact" % "2.17.103",
"software.amazon.awssdk" % "sts" % "2.17.103",
"com.lihaoyi" %% "requests" % "0.6.9",
"com.lihaoyi" %% "os-lib" % "0.7.8",
"com.lihaoyi" %% "utest" % "0.7.10" % Test
"software.amazon.awssdk" % "sso" % "2.21.37",
"software.amazon.awssdk" % "codeartifact" % "2.21.37",
"software.amazon.awssdk" % "sts" % "2.21.37",
"com.lihaoyi" %% "requests" % "0.8.0",
"com.lihaoyi" %% "os-lib" % "0.9.2",
"com.lihaoyi" %% "utest" % "0.8.2" % Test
)

testFrameworks += new TestFramework("utest.runner.Framework")
6 changes: 3 additions & 3 deletions core/src/main/scala/codeartifact/CodeArtifactRepo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ object CodeArtifactRepo {

// Url looks like:
// https://<domain>-<owner>.d.codeartifact.us-west-2.amazonaws.com/maven/<repository>
val jurl = new java.net.URL(url)
val juri = new java.net.URI(url)

// Split on slashes, and get the last element: <repository>.
val name = jurl.getPath().split('/').last
val name = juri.getPath().split('/').last

// Split on dots. Take the head, which is the <domain>-<owner> section.
// Split on dashes.
val host = jurl.getHost()
val host = juri.getHost()
val parts = host.split('.').head.split('-')
// Last element is <owner>.
val owner = parts.last
Expand Down
22 changes: 22 additions & 0 deletions core/src/test/scala/codeartifact/CodeArtifactRepoSpec.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package codeartifact

import utest._

object CodeArtifactRepoSpec extends TestSuite {
val tests = Tests {
test("fromUrl") {
val raw =
"https://com-example-1234567890.d.codeartifact.us-west-2.amazonaws.com/maven/private"

val repo = CodeArtifactRepo.fromUrl(raw)

assert(repo.name == "private")
assert(repo.domain == "com-example")
assert(repo.host == "com-example-1234567890.d.codeartifact.us-west-2.amazonaws.com")
assert(repo.owner == "1234567890")
assert(repo.url == raw)
assert(repo.realm == "com-example/private")
}
}

}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.6.1
sbt.version=1.9.7
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.20")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.4.4")

addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.3")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")

addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ trait CodeArtifactKeys {

///////////
// Tasks //
//////////.
////////// .

val codeArtifactPublish: TaskKey[Unit] =
taskKey[Unit]("Publish to AWS CodeArtifact.")
Expand Down

0 comments on commit 3fee9a4

Please sign in to comment.