Good point, I forgot about that. <br><div class="gmail_quote"><div dir="ltr">On Mon, Aug 29, 2016 at 5:36 PM Daniel Dunbar &lt;<a href="mailto:daniel_dunbar@apple.com">daniel_dunbar@apple.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div>On Aug 29, 2016, at 2:35 AM, Honza Dvorsky &lt;<a href="mailto:jan.dvorsky@me.com" target="_blank">jan.dvorsky@me.com</a>&gt; wrote:</div><br><div><div dir="ltr">Not sure if already mentioned, but the issue of duplicated dependencies in targets can be easily handled like this:<div><br></div><div><div>import PackageDescription</div><div><br></div><div>let sharedDependency: Package.Dependency = .Package(url: &quot;...&quot;, majorVersion: 1)</div><div><br></div><div>let package = Package(</div><div>    name: &quot;MyPkg&quot;,</div><div>    targets: [</div><div>        .Target(name: &quot;First&quot;),</div><div>        .Target(name: &quot;Second&quot;, dependencies: [&quot;First&quot;, sharedDependency]),</div><div>        .Target(name: &quot;Third&quot;, dependencies: [sharedDependency])</div><div>    ]</div><div>)</div></div><div><br></div><div>That&#39;s assuming we&#39;ll be able to add external deps to targets.</div></div></div></blockquote><div><br></div></div></div><div style="word-wrap:break-word"><div>I&#39;m not sure that is a syntax we want to support per the long term plans to split the manifest into a &quot;leading package specification&quot; which, while Swift, is a restricted subset we know we can parse into a machine editable form.</div><div><br></div><div>I would like it if the syntax for all common things was representable as a readable declarative initializer.</div></div><div style="word-wrap:break-word"><div><br></div><div> - Daniel</div></div><div style="word-wrap:break-word"><div><br><blockquote type="cite"><div><div dir="ltr"><div><br></div><div>- Honza</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Aug 29, 2016 at 7:07 AM Daniel Dunbar via swift-build-dev &lt;<a href="mailto:swift-build-dev@swift.org" target="_blank">swift-build-dev@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I completely agree with your original email, and agree the target-access control proposal amounts to a variant of #2.<br>
<br>
We definitely need a per-target dependency solution, and if we got one that included some kind of solution for managing the duplicate declaration, that would solve the con you list with #2. That might suggest that one approach here is to add it the list of reasons we should do a per-target dependency proposal.<br>
<br>
On the other hand, that has proven more complicated than approach #1, and is likely to take longer to get right. I wonder if there are reasons we might end up wanting #1 even if we had a working #2 (one reason might be if we couldn&#39;t solve the duplicate declaration problem).<br>
<br>
My leaning here is towards trying to figure out a good approach for #2 first, and see where that leaves us, but I could probably be persuaded that the problem is pressing enough we should consider a more targeted fix sooner.<br>
<br>
 - Daniel<br>
<br>
&gt; On Aug 28, 2016, at 7:48 PM, Paul Cantrell via swift-build-dev &lt;<a href="mailto:swift-build-dev@swift.org" target="_blank">swift-build-dev@swift.org</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;&gt; On Aug 28, 2016, at 9:23 PM, Ankit Aggarwal &lt;<a href="mailto:ankit_aggarwal@apple.com" target="_blank">ankit_aggarwal@apple.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; 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.<br>
&gt;<br>
&gt; That’s what I had in mind with “Approach 2” in my original message. Approach 3 is a related but different alternative.<br>
&gt;<br>
&gt; Please see remarks in the original message for my take on the pros and cons.<br>
&gt;<br>
&gt;&gt; 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.<br>
&gt;<br>
&gt; That proposal is getting warm — especially if test packages are _not_ exposed by default, something it seems to me that proposal should specify.<br>
&gt;<br>
&gt; The new “External” in that proposal has the right semantics, but seems to me to add yet more complexity to a package DSL whose readability is already a bit strained. In particular, this seems likely to cause confusion:<br>
&gt;<br>
&gt;&gt; An external package dependency declaration implicitly becomes dependency of each target in the package. We propose this behaviour should be retained but if a target dependency contains an External declaration then all other targets which wants to use that external dependency should explicitly state their dependency on that external package using External.<br>
&gt;<br>
&gt; Cheers,<br>
&gt;<br>
&gt; Paul<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; swift-build-dev mailing list<br>
&gt; <a href="mailto:swift-build-dev@swift.org" target="_blank">swift-build-dev@swift.org</a><br>
&gt; <a href="https://lists.swift.org/mailman/listinfo/swift-build-dev" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-build-dev</a><br>
<br>
_______________________________________________<br>
swift-build-dev mailing list<br>
<a href="mailto:swift-build-dev@swift.org" target="_blank">swift-build-dev@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-build-dev" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-build-dev</a><br>
</blockquote></div>
</div></blockquote></div><br></div></blockquote></div>