<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi, all</div><div class=""><br class=""></div><div class="">It seems currently there is no way to update a dependency to a compatible version unless we remove the cloned dependency folder from Packages manually.</div><div class=""><br class=""></div><div class="">Take example, consider the Package.swift file as follows:</div><div class=""><br class=""></div><div class=""><div class="">let package = Package(</div><div class=""> name: "Dealer",</div><div class=""> dependencies: [</div><div class=""> .Package(url: "<a href="https://github.com/apple/example-package-deckofplayingcards.git" class="">https://github.com/apple/example-package-deckofplayingcards.git</a>", majorVersion: 1),</div><div class=""> ]</div><div class="">)</div></div><div class=""><br class=""></div><div class="">It will clone and build the latest 1.x.y (currently 1.0.2, <a href="https://github.com/apple/example-package-deckofplayingcards/releases" class="">https://github.com/apple/example-package-deckofplayingcards/releases</a>) for me. Let’s assume later a new compatible version 1.0.3 is released. However, even I run `swift build` again, it seems the package manager will not update this dependency, since the existing version is already match the requirement. ( <a href="https://github.com/apple/swift-package-manager/blob/master/Sources/dep/get.swift#L260-L270" class="">https://github.com/apple/swift-package-manager/blob/master/Sources/dep/get.swift#L260-L270</a> ).</div><div class=""><br class=""></div><div class="">Even I run a `swift build -k` before building the package, the dependency wouldn’t get updated. The only way to update to a most recent compatible version seems to be a `rm -rf Packages` before build.</div><div class=""><br class=""></div><div class="">As I specified the major version should be 1, IMO, it means I may want the latest version before 2.0.0. Is current behavior expected, or is there any plan to provide a better way to upgrade the dependencies? Maybe we need some options like `swift build —clean_all` or `swift build upgrade`?</div><div class=""><br class=""></div><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class="" style="font-family: helvetica, Arial; font-size: 13px; background-color: rgb(255, 255, 255); word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font face="Helvetica" class=""><span style="color: rgb(81, 81, 81); font-family: Tahoma; font-size: 12px;" class="">Best regards.</span></font></div><div class="" style="font-family: helvetica, Arial; font-size: 13px; background-color: rgb(255, 255, 255); word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font face="Helvetica" class="">---</font></div><div class="" style="font-size: 13px; background-color: rgb(255, 255, 255); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font color="#515151" face="Tahoma" class=""><span class="" style="font-size: 12px;"><span class="" style="line-height: 15px;">Sincerely,</span> <br class="" style="line-height: 15px;"><span class="name" style="margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: baseline;">Wei Wang (王巍, @onevcat)<br class=""></span></span></font><a href="http://im.onevcat.com/" class="" style="font-family: Tahoma; font-size: 12px; background-color: inherit; color: rgb(65, 131, 196); text-decoration: none; margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: baseline;">im.onevcat.com</a></div></div></div>
</div>
<br class=""></body></html>