<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 Paul,</div><div class=""><br class=""></div><div class="">Thanks for opening this discussion.</div><br class=""><div><blockquote type="cite" class=""><div class="">On 29-Aug-2016, at 1:36 AM, Paul Cantrell via swift-build-dev <<a href="mailto:swift-build-dev@swift.org" class="">swift-build-dev@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I’ve been working on getting Siesta up and running with SwiftPM, and have hit snags running the tests. At Ankit Aggarwal’s encouragement, I’m opening a discussion thread here.<div class=""><br class=""></div><div class="">By “test-only dependencies,” I mean external packages required by a package’s tests, but not by the package's exported targets. For example, Siesta’s tests depend on Quick, Nimble, and Nocilla, but apps that use Siesta should not have to build those dependencies and would very much not want them baked into the resulting binary.</div></div></div></blockquote><div><br class=""></div><div>I agree that building test specific dependencies is not useful for packages which just uses the some package, however I think that should be controlled by some other general mechanism like specifying exact external package/target the target in question depends on. That way all the unused targets in an external package will not build. See thread “Proposal: SwiftPM Target Access Control“ for some more discussion on this idea.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">Proper support for test-only dependencies would have three essential features:</div><div class=""><br class=""></div><div class=""><ul class="MailOutline"><li class="">They are not downloaded or built by “swift build,” but <i class="">are</i> downloaded and built by “swift test.”</li><li class="">Any modules they define do not end up in the compiled binary, and are not available for the package’s non-test targets to import.</li><li class="">A package ignores the test-only dependencies of its dependencies.</li></ul></div></div></div></blockquote><div><br class=""></div><div>I think instead of it being test-only dependency this could be a feature which lets you define dependencies to be used only by the current package (including test targets) which will be helpful for developers to try or play with some external dependency. And in that case it should probably be called something else like for e.g.: `localDependencies`</div><div><br class=""></div><div>What do you think?</div><div><br class=""></div><div>—</div><div><br class=""></div><div>Ankit</div></div></body></html>