Skip to content

Commit

Permalink
fix!: Rename package to match name inferred from git URL (#464)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbelkins authored Nov 9, 2022
1 parent e4285fe commit 60de8a4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PackageDescription


let package = Package(
name: "ClientRuntime",
name: "smithy-swift",
platforms: [
.macOS(.v10_15),
.iOS(.v13)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fun writePackageManifest(settings: SwiftSettings, fileManifest: FileManifest, de
writer.write("name: \"${settings.moduleName}Tests\",")
writer.openBlock("dependencies: [", "],") {
writer.write("\$S,", settings.moduleName)
writer.write(".product(name: \"SmithyTestUtil\", package: \"ClientRuntime\")")
writer.write(".product(name: \"SmithyTestUtil\", package: \"smithy-swift\")")
}
writer.write("path: \"./${settings.moduleName}Tests\"")
}
Expand All @@ -82,7 +82,7 @@ fun renderPackageDependenciesWithLocalPaths(writer: CodeWriter, distinctDependen
val target = dependency.expectProperty("target", String::class.java)

if (localPath.isNotEmpty()) {
writer.write(".package(name: \"${target}\", path: \"$localPath\"),")
writer.write(".package(path: \"$localPath\"),")
} else {
renderPackageWithUrl(writer, dependency)
}
Expand All @@ -102,7 +102,6 @@ fun renderPackageWithUrl(writer: CodeWriter, dependency: SymbolDependency) {
writer.openBlock(".package(", "),") {
val target = dependency.expectProperty("target", String::class.java)
val dependencyURL = dependency.expectProperty("url", String::class.java)
writer.write("name: \"$target\",")
writer.write("url: \"$dependencyURL\",")
val branch = dependency.getProperty("branch", String::class.java)
if (!branch.getOrNull().isNullOrEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ enum class SwiftDependency(
"0.1.0",
"https://github.com/awslabs/smithy-swift",
Resources.computeAbsolutePath("smithy-swift", "", "SMITHY_SWIFT_CI_DIR"),
"ClientRuntime"
"smithy-swift"
),
XCTest("XCTest", null, "", "", "", ""),
SMITHY_TEST_UTIL(
Expand All @@ -34,7 +34,7 @@ enum class SwiftDependency(
"0.1.0",
"https://github.com/awslabs/smithy-swift",
Resources.computeAbsolutePath("smithy-swift", "", "SMITHY_SWIFT_CI_DIR"),
"ClientRuntime"
"smithy-swift"
);

override fun getDependencies(): List<SymbolDependency> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class PackageManifestGeneratorTests {
assertNotNull(packageManifest)
val expectedContents = """
.package(
name: "ComplexModule",
url: "https://github.com/apple/swift-numerics",
from: "0.0.5"
),
Expand Down Expand Up @@ -82,7 +81,7 @@ class PackageManifestGeneratorTests {
" ),\n" +
" .product(\n" +
" name: \"ClientRuntime\",\n" +
" package: \"ClientRuntime\"\n" +
" package: \"smithy-swift\"\n" +
" ),\n" +
" ],\n" +
" path: \"./MockSDK\"\n" +
Expand All @@ -91,7 +90,7 @@ class PackageManifestGeneratorTests {
" name: \"MockSDKTests\",\n" +
" dependencies: [\n" +
" \"MockSDK\",\n" +
" .product(name: \"SmithyTestUtil\", package: \"ClientRuntime\")\n" +
" .product(name: \"SmithyTestUtil\", package: \"smithy-swift\")\n" +
" ],\n" +
" path: \"./MockSDKTests\"\n" +
" )\n" +
Expand All @@ -116,7 +115,7 @@ class PackageManifestGeneratorTests {
),
.product(
name: "ClientRuntime",
package: "ClientRuntime"
package: "smithy-swift"
),
],
path: "./MockSDK"
Expand Down

0 comments on commit 60de8a4

Please sign in to comment.