<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 29, 2016, at 11:10 AM, Daniel Dunbar &lt;<a href="mailto:daniel_dunbar@apple.com" class="">daniel_dunbar@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; 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;" class=""><blockquote type="cite" class=""><div class=""><br class="Apple-interchange-newline">On Aug 29, 2016, at 9:00 AM, Paul Cantrell &lt;<a href="mailto:cantrell@pobox.com" class="">cantrell@pobox.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><blockquote type="cite" class="">On Aug 29, 2016, at 12:07 AM, Daniel Dunbar &lt;<a href="mailto:daniel_dunbar@apple.com" class="">daniel_dunbar@apple.com</a>&gt; wrote:<br class=""><br class="">I completely agree with your original email, and agree the target-access control proposal amounts to a variant&nbsp;of #2.<br class=""><br class="">We definitely need a per-target dependency solution, and if we got one that included some kind of solution for&nbsp;managing the duplicate declaration, that would solve the con you list with #2. That might suggest that one&nbsp;approach here is to add it the list of reasons we should do a per-target dependency proposal.<br class=""><br class="">…<br class=""></blockquote><blockquote type="cite" class=""><br class=""></blockquote><blockquote type="cite" class="">My leaning here is towards trying to figure out a good approach for #2 first, and see where that leaves us<br class=""></blockquote><br class=""></div><div class="">I’m not up on all the discussion, but that certainly seems to me like the right direction.</div></div></div></blockquote></div></div></blockquote><div><br class=""></div><div>One way to remove the redundant declarations from #2:</div><div><br class=""></div><div>(1) Allow virtual targets that have no corresponding source directory, but declare external dependencies.</div><div><br class=""></div><div>(2) Allow other targets to depend on virtual targets.</div><div><br class=""></div><div>So, for this directory structure:</div><div><br class=""></div><div><div>&nbsp; &nbsp; Source/</div><div>&nbsp; &nbsp; &nbsp; &nbsp; ...</div><div>&nbsp; &nbsp; Tests/</div><div>&nbsp; &nbsp; &nbsp; &nbsp; FooTests/</div><div>&nbsp; &nbsp; &nbsp; &nbsp; BarTests/</div><div class=""><br class=""></div><div class="">…a manifest could declare:</div><div class=""><br class=""></div></div><div><div class=""><div class=""><font face="HelveticaNeue" class="">&nbsp; &nbsp; targets: [</font></div><div class=""><font face="HelveticaNeue" class="">&nbsp; &nbsp; &nbsp; Target(</font></div><div class=""><font face="HelveticaNeue" class="">&nbsp; &nbsp; &nbsp; &nbsp; name: "Tests", &nbsp; // Note that /Tests/Tests does not exist!</font></div><div class=""><font face="HelveticaNeue" class="">&nbsp; &nbsp; &nbsp; &nbsp; dependencies: [</font></div><div class=""><font face="HelveticaNeue" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Package(url: "<a href="https://github.com/Quick/Quick" class="">https://github.com/Quick/Quick</a>", majorVersion: 0)</font></div><div class=""><font face="HelveticaNeue" class="">&nbsp; &nbsp; &nbsp; &nbsp; ]),</font></div><div class=""><font face="HelveticaNeue" class="">&nbsp; &nbsp; &nbsp; Target(</font></div><div class=""><font face="HelveticaNeue" class="">&nbsp; &nbsp; &nbsp; &nbsp; name: "FooTests",</font></div><div class=""><font face="HelveticaNeue" class="">&nbsp; &nbsp; &nbsp; &nbsp; dependencies: ["Tests"])</font></div><div class=""><font face="HelveticaNeue" class="">&nbsp; &nbsp; &nbsp; Target(</font></div><div class=""><font face="HelveticaNeue" class="">&nbsp; &nbsp; &nbsp; &nbsp; name: "BarTests",</font></div><div class=""><font face="HelveticaNeue" class="">&nbsp; &nbsp; &nbsp; &nbsp; dependencies: ["Tests"]),</font></div><div class=""><font face="HelveticaNeue" class="">&nbsp; &nbsp; ],</font></div><div style="font-family: HelveticaNeue;" class=""><br class=""></div><div style="font-family: HelveticaNeue;" class="">To that, you could also add:</div><div style="font-family: HelveticaNeue;" class=""><br class=""></div><div style="font-family: HelveticaNeue;" class="">(3) All test targets implicitly depend on a virtual target named “Tests.”</div><div style="font-family: HelveticaNeue;" class=""><br class=""></div><div style="font-family: HelveticaNeue;" class="">…which would allow this simplification:</div><div style="font-family: HelveticaNeue;" class=""><br class=""></div><div class=""><div class=""><font face="HelveticaNeue" class="">&nbsp; &nbsp; targets: [</font></div><div class=""><font face="HelveticaNeue" class="">&nbsp; &nbsp; &nbsp; Target(</font></div><div class=""><font face="HelveticaNeue" class="">&nbsp; &nbsp; &nbsp; &nbsp; name: "Tests”,</font></div><div class=""><font face="HelveticaNeue" class="">&nbsp; &nbsp; &nbsp; &nbsp; dependencies: [</font></div><div class=""><font face="HelveticaNeue" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Package(url: "<a href="https://github.com/Quick/Quick" class="">https://github.com/Quick/Quick</a>", majorVersion: 0)</font></div><div class=""><font face="HelveticaNeue" class="">&nbsp; &nbsp; &nbsp; &nbsp; ])</font></div><div class=""><span style="font-family: HelveticaNeue;" class="">&nbsp; &nbsp; ],</span></div><div style="font-family: HelveticaNeue;" class=""><br class=""></div></div><div style="font-family: HelveticaNeue;" class=""><div style="font-family: 'Helvetica Neue';" class=""><span style="font-family: HelveticaNeue;" class="">Note that there’s no longer any need to override convention-based&nbsp;</span><span style="font-family: HelveticaNeue;" class="">defaults for FooTests and&nbsp;</span><span style="font-family: HelveticaNeue;" class="">BarTests.</span></div><div class=""><span style="font-family: HelveticaNeue;" class=""><br class=""></span></div><div class=""><span style="font-family: HelveticaNeue;" class="">What do you think?</span></div></div></div></div><br class=""><blockquote type="cite" class=""><div class=""><div style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; 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;" class=""><blockquote type="cite" class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Aug 29, 2016, at 10:36 AM, Daniel Dunbar &lt;<a href="mailto:daniel_dunbar@apple.com" class="">daniel_dunbar@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; 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;"><blockquote type="cite" class=""><div class="">On Aug 29, 2016, at 2:35 AM, Honza Dvorsky &lt;<a href="mailto:jan.dvorsky@me.com" class="">jan.dvorsky@me.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Not sure if already mentioned, but the issue of duplicated dependencies in targets can be easily handled like this:<div class=""><br class=""></div><div class=""><div class="">import PackageDescription</div><div class=""><br class=""></div><div class="">let sharedDependency: Package.Dependency = .Package(url: "...", majorVersion: 1)</div></div></div></div></blockquote></div></div></blockquote><blockquote type="cite" class=""><blockquote type="cite" class="">…<br class=""></blockquote></blockquote><blockquote type="cite" class=""><div class=""><div class="" style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; 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;"><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class="">&nbsp; &nbsp; &nbsp; &nbsp; .Target(name: "Second", dependencies: ["First", sharedDependency]),</div></div></div></div></blockquote><div class=""><br class=""></div>I'm not sure that is a syntax we want to support per the long term plans to split the manifest into a "leading package specification" which, while Swift, is a restricted subset we know we can parse into a machine editable form.</div></div></blockquote><br class=""></div><div class="">It’s a tangent, but … doesn’t that defeat the advantage of having the syntax be Swift, namely being able to execute code within the package declaration to eliminate redundancy and conditionally declare things?</div></div></div></blockquote><div class=""><br class=""></div>No, the intent was to support both cases, but to prioritize the leading package specification being able to describe most scenarios. See:</div><div style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; 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;" class="">&nbsp;&nbsp;<a href="https://github.com/apple/swift-package-manager/blob/master/Documentation/Internals/SwiftBasedManifestFormat.md" class="">https://github.com/apple/swift-package-manager/blob/master/Documentation/Internals/SwiftBasedManifestFormat.md</a></div></div></blockquote><div><br class=""></div><div>Thanks for the link. The “Editor Support” section did clarify things quite a bit.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; 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;" class=""><div class="">If you have concrete examples of things you think are finicky or spelled badly, that is worth raising separately and feeding into a discussion of cleaning up the manifest API.</div></div></div></blockquote><br class=""></div><div>The obvious one is knowing which things are enums and which are structs. It’s hard to know when to include the leading dots.</div><div><br class=""></div><div>I’ll give this some separate thought in another thread, as you suggest.</div><div><br class=""></div><div>Cheers,</div><div><br class=""></div><div>Paul</div><div><br class=""></div><div><br class=""></div><br class=""></body></html>