Unverified Commit 1df4c126 authored by Zelda Hessler's avatar Zelda Hessler Committed by GitHub
Browse files

fix: normalize generated cargo dependency paths (#877)



* fix: normalize generated cargo dependency paths

* Update codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/rustlang/CargoDependency.kt

Co-authored-by: default avatarJohn DiSanti <jdisanti@amazon.com>

* update: based on PR suggestion

Co-authored-by: default avatarJohn DiSanti <jdisanti@amazon.com>
parent f2b05cf4
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ import software.amazon.smithy.codegen.core.SymbolDependencyContainer
import software.amazon.smithy.rust.codegen.smithy.RuntimeConfig
import software.amazon.smithy.rust.codegen.smithy.RuntimeType
import software.amazon.smithy.rust.codegen.util.dq
import java.nio.file.Path

sealed class DependencyScope {
    object Dev : DependencyScope()
@@ -150,8 +151,8 @@ data class CargoDependency(
            when (this) {
                is CratesIo -> attribs["version"] = version
                is Local -> {
                    val fullPath = "$basePath/$name"
                    attribs["path"] = fullPath
                    val fullPath = Path.of("$basePath/$name")
                    attribs["path"] = fullPath.normalize().toString()
                    version?.also { attribs["version"] = version }
                }
            }