<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Thanks for taking the initiative for this, Ankit. It's a very welcome improvement.</div><div class=""><br class=""></div><div class="">Comments inline.</div><div class=""><br class=""></div>On 2016-07-12, at 11.15, Ankit Agarwal via swift-build-dev <<a href="mailto:swift-build-dev@swift.org" class="">swift-build-dev@swift.org</a>> wrote:<div><blockquote type="cite" class=""><div dir="ltr" class=""><div class=""><p style="margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px;" class="">To mark a target as exported/public I propose <code style="margin:0px 2px;padding:0px 5px;white-space:nowrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">PackageDescription</code>'s <code style="margin:0px 2px;padding:0px 5px;white-space:nowrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">Target</code> gains a <code style="margin:0px 2px;padding:0px 5px;white-space:nowrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">flags</code> property which would be a <code style="margin:0px 2px;padding:0px 5px;white-space:nowrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">Set</code> of the following <code style="margin:0px 2px;padding:0px 5px;white-space:nowrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">Flag</code> enum declared inside <code style="margin:0px 2px;padding:0px 5px;white-space:nowrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">Target</code> class:</p><pre class="" style="margin-top: 0.5em; margin-bottom: 0.5em; background-color: rgb(245, 242, 240); border: 1px solid rgb(204, 204, 204); font-size: 13px; line-height: 1.5; overflow: auto; padding: 1em; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; direction: ltr; word-wrap: normal;"><code class="" style="margin:0px;padding:0px;border:none;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;direction:ltr;word-spacing:normal;word-wrap:normal;line-height:1.5"><span class="" style="color:rgb(0,119,170)">public</span> <span class="" style="color:rgb(0,119,170)">enum</span> <span class="" style="color:rgb(102,153,0)">Flag</span> <span class="" style="color:rgb(153,153,153)">{</span>
<span class="" style="color:rgb(112,128,144)">/// Makes the target public or "exported" for other packages to use.</span>
<span class="" style="color:rgb(0,119,170)">case</span> <span class="" style="color:rgb(0,119,170)">public</span>
<span class="" style="color:rgb(153,153,153)">}</span></code></pre><p style="margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px;" class="">The <code style="margin:0px 2px;padding:0px 5px;white-space:nowrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">Flag</code> enum will be flexible in case we need to add more attributes in future as opposed to a boolean property to mark the public nature of the target.</p></div></div></blockquote><div>I would prefer that this be a boolean parameter rather than a generic `flags` parameter, since it makes the manifest read more naturally, and, importantly, is no less extensible than an enum. Additional parameters with default values can as easily be added as more enum cases can, and in either case, a manifest written to assume the existence of `public` will be equally incompatible with older versions of the package manager.</div><div><br class=""></div>So, for example:</div><div><br class=""></div><div><div class=""><div dir="ltr" class=""><div class=""><pre class="" style="margin-top: 0.5em; margin-bottom: 0.5em; background-color: rgb(245, 242, 240); border: 1px solid rgb(204, 204, 204); font-size: 13px; line-height: 1.5; overflow: auto; padding: 1em; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; direction: ltr; word-wrap: normal;"><code class="" style="margin: 0px; padding: 0px; border: none; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; direction: ltr; word-spacing: normal; word-wrap: normal; line-height: 1.5;"><span class="" style="color: rgb(0, 119, 170);">let</span> package <span class="" style="color: rgb(166, 127, 89); background-color: rgba(255, 255, 255, 0.498039);">=</span> <span class="" style="color: rgb(221, 74, 104);">Package</span><span class="" style="color: rgb(153, 153, 153);">(</span>
name<span class="" style="color: rgb(153, 153, 153);">:</span> <span class="" style="color: rgb(102, 153, 0);">"FooLibrary"</span><span class="" style="color: rgb(153, 153, 153);">,</span>
targets<span class="" style="color: rgb(153, 153, 153);">:</span> <span class="" style="color: rgb(153, 153, 153);">[</span>
<span class="" style="color: rgb(221, 74, 104);">Target</span><span class="" style="color: rgb(153, 153, 153);">(</span>name<span class="" style="color: rgb(153, 153, 153);">:</span> <span class="" style="color: rgb(102, 153, 0);">"FooLibrary"</span><span class="" style="color: rgb(153, 153, 153);">,</span> public: <span style="color: rgb(0, 119, 170); word-spacing: normal;" class="">true</span><span class="" style="color: rgb(153, 153, 153);">)</span><span class="" style="color: rgb(153, 153, 153);">,</span>
<span class="" style="color: rgb(221, 74, 104);">Target</span><span class="" style="color: rgb(153, 153, 153);">(</span>name<span class="" style="color: rgb(153, 153, 153);">:</span> <span class="" style="color: rgb(102, 153, 0);">"SampleCLI"</span><span class="" style="color: rgb(153, 153, 153);">,</span> dependencies<span class="" style="color: rgb(153, 153, 153);">:</span> <span class="" style="color: rgb(153, 153, 153);">[</span><span class="" style="color: rgb(102, 153, 0);">"FooLibrary"</span><span class="" style="color: rgb(153, 153, 153);">]</span><span class="" style="color: rgb(153, 153, 153);">)</span><span class="" style="color: rgb(153, 153, 153);">,</span>
<span class="" style="color: rgb(153, 153, 153);">]</span><span class="" style="color: rgb(153, 153, 153);">)</span></code></pre></div></div></div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><p style="margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px;" class="">We can keep some obvious defaults for targets which can be implicitly public for e.g. </p><ol style="margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; font-size: 14px;" class=""><li style="margin:0px" class="">Package has only one target.</li><li style="margin:0px" class="">Target with same name as package.</li></ol></div></div></div></blockquote>I'm a bit wary of magic here. I think it would be clearer to have the manifest declare what is public and what is not. With magic naming conventions it's too easy to accidentally change semantics just by renaming a target.<br class=""><blockquote type="cite" class=""><div dir="ltr" class=""><div class=""><p style="margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px;" class="">I propose that enum <code class="" style="margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">Target.Dependency</code> gains a new case <code class="" style="margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">External(package: String, target: String)</code> to declare dependency on an external package's target.</p></div></div></blockquote><div>Since it's the same fundamental kind of dependency in either case, would it be better to have `package` be an optional parameter to Target?</div><div><br class=""></div><div>So that `Target(name: "Foo")` is local but `Target(name: "Foo", package: "Bar")` external? That would seem more logical.</div><br class=""></div><div>Anders</div><div><br class=""></div><br class=""></body></html>