<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="">Hi,<br class=""><br class="">We would love to get some feedback on a draft proposal for defining custom target layouts in the Package Manager. This proposal allows overriding the target layout rules set by the Package Manager and simplifies some complex "magic" behaviours.&nbsp;<br class=""><br class="">You can find the proposal at the link below. The text is also included in the email.<br class=""><br class=""><a href="https://github.com/aciidb0mb3r/swift-evolution/blob/custom-targets-layout/proposals/NNNN-package-manager-custom-targets-layout.md" class="">https://github.com/aciidb0mb3r/swift-evolution/blob/custom-targets-layout/proposals/NNNN-package-manager-custom-targets-layout.md</a><br class=""><div class=""><br class="">Thanks,<br class="">Ankit<div class=""><br class=""></div><div class="">--</div><div class=""><br class=""></div><div class=""><h1 id="toc_0" style="-webkit-print-color-adjust: exact; margin: 0px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 28px; font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class="">Package Manager Custom Targets Layout</h1><ul style="-webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class=""><li style="-webkit-print-color-adjust: exact; margin: 0px;" class="">Proposal:&nbsp;<a href="file:///Users/ankit/NNNN-package-manager-custom-targets-layout.md" style="-webkit-print-color-adjust: exact; color: rgb(65, 131, 196); margin-top: 0px;" class="">SE-NNNN</a></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class="">Author:&nbsp;<a href="https://github.com/aciidb0mb3r" style="-webkit-print-color-adjust: exact; color: rgb(65, 131, 196); margin-top: 0px;" class="">Ankit Aggarwal</a></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class="">Review Manager: TBD</li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class="">Status:&nbsp;<strong style="-webkit-print-color-adjust: exact; margin-top: 0px;" class="">Discussion</strong></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class="">Bug:&nbsp;<a href="https://bugs.swift.org/browse/SR-29" style="-webkit-print-color-adjust: exact; color: rgb(65, 131, 196); margin-top: 0px;" class="">SR-29</a></li></ul><h2 id="toc_1" style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(204, 204, 204); font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class="">Introduction</h2><p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class="">This proposal enhances the&nbsp;<code style="-webkit-print-color-adjust: exact; 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="">Package.swift</code>&nbsp;manifest APIs to support custom target layouts, and removes a convention which allowed omission of targets from the manifest.</p><h2 id="toc_2" style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(204, 204, 204); font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class="">Motivation</h2><p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class="">The Package Manager uses a convention system to infer targets structure from disk layout. This works well for most packages, which can easily adopt the conventions, and frees users from needing to update their&nbsp;<code style="-webkit-print-color-adjust: exact; 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="">Package.swift</code>&nbsp;file every time they add or remove sources. Adopting the conventions is more difficult for some packages, however – especially existing C libraries or large projects, which would be difficult to reorganize. We intend to give users a way to make such projects into packages without needing to conform to our conventions.</p><p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class="">The current convention rules make it very convenient to add new targets and source files by inferring them automatically from disk, but they also can be confusing, overly-implicit, and difficult to debug; for example, if the user does not follow the conventions correctly which determine their targets, they may wind up with targets they don't expect, or not having targets they did expect, and either way their clients can't easily see which targets are available by looking at the&nbsp;<code style="-webkit-print-color-adjust: exact; 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="">Package.swift</code>&nbsp;manifest. We want to retain convenience where it really matters, such as easy addition of new source files, but require explicit declarations where being explicit adds significant value. We also want to make sure that the implicit conventions we keep are straightforward and easy to remember.</p><h2 id="toc_3" style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(204, 204, 204); font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class="">Proposed solution</h2><ul style="-webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class=""><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">We propose to stop inferring targets from disk. They must be explicitly declared in the manifest file. The inference was not very useful, as targets eventually need to be declared in order to use common features such as product and target dependencies, or build settings (which are planned for Swift 4). Explicit target declarations make a package easier to understand by clients, and allow us to provide good diagnostics when the layout on disk does not match the declarations.</p></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">We propose to remove the requirement that name of a test target must have suffix "Tests". Instead, test targets will be explicitly declared as such in the manifest file.</p></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">We propose a list of pre-defined search paths for declared targets.</p><p style="-webkit-print-color-adjust: exact; margin: 15px 0px;" class="">When a target does not declare an explicit path, these directories will be used to search for the target. The name of the directory must match the name of the target. The search will be done in order and will be case-sensitive.</p><p style="-webkit-print-color-adjust: exact; margin: 15px 0px;" class="">Regular targets: package root, Sources, Source, src, srcs. Test targets: Tests, package root, Sources, Source, src, srcs.</p><p style="-webkit-print-color-adjust: exact; margin: 15px 0px;" class="">It is an error if a target is found in more than one of these paths. In such cases, the path should be explicitly declared using the path property proposed below.</p></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">We propose to add a factory method&nbsp;<code style="-webkit-print-color-adjust: exact; 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="">testTarget</code>&nbsp;to the&nbsp;<code style="-webkit-print-color-adjust: exact; 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>&nbsp;class, to define test targets.</p><div style="-webkit-print-color-adjust: exact;" class=""><pre class=" language-swift" style="-webkit-print-color-adjust: exact; 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; text-shadow: white 0px 1px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; word-spacing: normal; word-break: normal; word-wrap: normal; tab-size: 4; -webkit-hyphens: none;"><code class=" language-swift" style="-webkit-print-color-adjust: exact; 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; background-image: none; text-shadow: white 0px 1px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; word-spacing: normal; word-break: normal; word-wrap: normal; line-height: 1.5; tab-size: 4; -webkit-hyphens: none;"><span class="token punctuation" style="-webkit-print-color-adjust: exact; margin-top: 0px; color: rgb(153, 153, 153);">.</span><span class="token function" style="-webkit-print-color-adjust: exact; color: rgb(221, 74, 104);">testTarget</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">(</span>name<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"FooTests"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span> dependencies<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">[</span><span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"Foo"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">]</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">)</span></code></pre></div></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">We propose to add three properties to the&nbsp;<code style="-webkit-print-color-adjust: exact; 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>&nbsp;class:&nbsp;<code style="-webkit-print-color-adjust: exact; 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="">path</code>,&nbsp;<code style="-webkit-print-color-adjust: exact; 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="">sources</code>&nbsp;and<code style="-webkit-print-color-adjust: exact; 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="">exclude</code>.</p><ul style="-webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px;" class=""><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class=""><code style="-webkit-print-color-adjust: exact; 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="">path</code>: This property defines the path to the top-level directory containing the target's sources, relative to the package root. It is not legal for this path to escape the package root, i.e., values like "../Foo", "/Foo" are invalid. The default value of this property will be&nbsp;<code style="-webkit-print-color-adjust: exact; 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="">nil</code>, which means the target will be searched for in the pre-defined paths. The empty string ("") or dot (".") implies that the target's sources are directly inside the package root.</p></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class=""><code style="-webkit-print-color-adjust: exact; 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="">sources</code>: This property defines the source files to be included in the target, relative to the target path. The default value of this property will be an empty array, which means all valid source files found in the target's path will be included. This can contain directories and individual source files. Directories will be searched recursively for valid source files. Paths specified are relative to the target path.</p><p style="-webkit-print-color-adjust: exact; margin: 15px 0px;" class="">Each source file will be represented by String type. In future, we will consider upgrading this to its own type to allow per-file build settings. The new type would conform to&nbsp;<code style="-webkit-print-color-adjust: exact; 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="">CustomStringConvertible</code>, so existing declarations would continue to work (except where the strings were constructed programatically).</p></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class=""><code style="-webkit-print-color-adjust: exact; 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="">exclude</code>: This property can be used to exclude certain files and directories from being picked up as sources. Exclude paths are relative to the target path. This property has more precedence than&nbsp;<code style="-webkit-print-color-adjust: exact; 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="">sources</code>&nbsp;property.</p><p style="-webkit-print-color-adjust: exact; margin: 15px 0px;" class=""><em style="-webkit-print-color-adjust: exact; margin-top: 0px;" class="">Note: We plan to support globbing in future, but to keep this proposal short we are not proposing it right now.</em></p></li></ul></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">It is an error if the paths of two targets overlap (unless resolved with&nbsp;<code style="-webkit-print-color-adjust: exact; 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="">exclude</code>).</p><div style="-webkit-print-color-adjust: exact;" class=""><pre class=" language-swift" style="-webkit-print-color-adjust: exact; 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; text-shadow: white 0px 1px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; word-spacing: normal; word-break: normal; word-wrap: normal; tab-size: 4; -webkit-hyphens: none;"><code class=" language-swift" style="-webkit-print-color-adjust: exact; 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; background-image: none; text-shadow: white 0px 1px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; word-spacing: normal; word-break: normal; word-wrap: normal; line-height: 1.5; tab-size: 4; -webkit-hyphens: none;"><span class="token comment" spellcheck="true" style="-webkit-print-color-adjust: exact; margin-top: 0px; color: slategray;">// This is an error:</span>
<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">.</span><span class="token function" style="-webkit-print-color-adjust: exact; color: rgb(221, 74, 104);">target</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">(</span>name<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"Bar"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span> path<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"Sources/Bar"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">)</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">.</span><span class="token function" style="-webkit-print-color-adjust: exact; color: rgb(221, 74, 104);">testTarget</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">(</span>name<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"BarTests"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span> dependencies<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">[</span><span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"Bar"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">]</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span> path<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"Sources/Bar/Tests"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">)</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>

<span class="token comment" spellcheck="true" style="-webkit-print-color-adjust: exact; color: slategray;">// This works:</span>
<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">.</span><span class="token function" style="-webkit-print-color-adjust: exact; color: rgb(221, 74, 104);">target</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">(</span>name<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"Bar"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span> path<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"Sources/Bar"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span> exclude<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">[</span><span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"Tests"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">]</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">)</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">.</span><span class="token function" style="-webkit-print-color-adjust: exact; color: rgb(221, 74, 104);">testTarget</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">(</span>name<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"BarTests"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span> dependencies<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">[</span><span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"Bar"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">]</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span> path<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"Sources/Bar/Tests"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">)</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span></code></pre></div></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">For C family library targets, we propose to add a&nbsp;<code style="-webkit-print-color-adjust: exact; 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="">publicHeadersPath</code>&nbsp;property.</p><p style="-webkit-print-color-adjust: exact; margin: 15px 0px;" class="">This property defines the path to the directory containing public headers of a C target. This path is relative to the target path and default value of this property is&nbsp;<code style="-webkit-print-color-adjust: exact; 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="">include</code>. This mechanism should be further improved in the future, but there are several behaviors, such as modulemap generation, which currently depend of having only one public headers directory. We will address those issues separately in a future proposal.</p><p style="-webkit-print-color-adjust: exact; margin: 15px 0px;" class=""><em style="-webkit-print-color-adjust: exact; margin-top: 0px;" class="">All existing rules related to custom and automatic modulemap remain intact.</em></p></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">Remove exclude from&nbsp;<code style="-webkit-print-color-adjust: exact; 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="">Package</code>&nbsp;class.</p><p style="-webkit-print-color-adjust: exact; margin: 15px 0px;" class="">This property is no longer required because of the above proposed per-target exclude property.</p></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">The templates provided by the&nbsp;<code style="-webkit-print-color-adjust: exact; 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="">swift package init</code>&nbsp;subcommand will be updated according to the above rules, so that users do not need to manually add their first target to the manifest.</p></li></ul><h2 id="toc_4" style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(204, 204, 204); font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class="">Examples:</h2><ul style="-webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class=""><li style="-webkit-print-color-adjust: exact; margin: 0px;" class="">Dummy manifest containing all Swift code.</li></ul><div style="-webkit-print-color-adjust: exact; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class=""><pre class=" language-swift" style="-webkit-print-color-adjust: exact; 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; text-shadow: white 0px 1px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; word-spacing: normal; word-break: normal; word-wrap: normal; tab-size: 4; -webkit-hyphens: none;"><code class=" language-swift" style="-webkit-print-color-adjust: exact; 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; background-image: none; text-shadow: white 0px 1px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; word-spacing: normal; word-break: normal; word-wrap: normal; line-height: 1.5; tab-size: 4; -webkit-hyphens: none;"><span class="token keyword" style="-webkit-print-color-adjust: exact; color: rgb(0, 119, 170);">let</span> package <span class="token operator" style="-webkit-print-color-adjust: exact; color: rgb(166, 127, 89); background-color: rgba(255, 255, 255, 0.498039); background-position: initial initial; background-repeat: initial initial;">=</span> <span class="token function" style="-webkit-print-color-adjust: exact; color: rgb(221, 74, 104);">Package</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">(</span>
    name<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"SwiftyJSON"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
    targets<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">[</span>
        <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">.</span><span class="token function" style="-webkit-print-color-adjust: exact; color: rgb(221, 74, 104);">target</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">(</span>
            name<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"Utility"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
            path<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"Sources/BasicCode"</span>
        <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">)</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>

        <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">.</span><span class="token function" style="-webkit-print-color-adjust: exact; color: rgb(221, 74, 104);">target</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">(</span>
            name<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"SwiftyJSON"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
            dependencies<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">[</span><span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"Utility"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">]</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
            path<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"SJ"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
            sources<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">[</span><span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"SwiftyJSON.swift"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">]</span>
        <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">)</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>

        <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">.</span><span class="token function" style="-webkit-print-color-adjust: exact; color: rgb(221, 74, 104);">testTarget</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">(</span>
            name<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"AllTests"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
            dependencies<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">[</span><span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"Utility"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"SwiftyJSON"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">]</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
            path<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"Tests"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
            exclude<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">[</span><span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"Fixtures"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">]</span>
        <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">)</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
    <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">]</span>
<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">)</span></code></pre></div><ul style="-webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class=""><li style="-webkit-print-color-adjust: exact; margin: 0px;" class="">LibYAML</li></ul><div style="-webkit-print-color-adjust: exact; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class=""><pre class=" language-swift" style="-webkit-print-color-adjust: exact; 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; text-shadow: white 0px 1px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; word-spacing: normal; word-break: normal; word-wrap: normal; tab-size: 4; -webkit-hyphens: none;"><code class=" language-swift" style="-webkit-print-color-adjust: exact; 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; background-image: none; text-shadow: white 0px 1px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; word-spacing: normal; word-break: normal; word-wrap: normal; line-height: 1.5; tab-size: 4; -webkit-hyphens: none;"><span class="token keyword" style="-webkit-print-color-adjust: exact; color: rgb(0, 119, 170);">let</span> packages <span class="token operator" style="-webkit-print-color-adjust: exact; color: rgb(166, 127, 89); background-color: rgba(255, 255, 255, 0.498039); background-position: initial initial; background-repeat: initial initial;">=</span> <span class="token function" style="-webkit-print-color-adjust: exact; color: rgb(221, 74, 104);">Package</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">(</span>
    name<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"LibYAML"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
    targets<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">[</span>
        <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">.</span><span class="token function" style="-webkit-print-color-adjust: exact; color: rgb(221, 74, 104);">target</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">(</span>
            name<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"libyaml"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
            sources<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">[</span><span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"src"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">]</span>
        <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">)</span>
    <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">]</span>
<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">)</span></code></pre></div><ul style="-webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class=""><li style="-webkit-print-color-adjust: exact; margin: 0px;" class="">Node.js http-parser</li></ul><div style="-webkit-print-color-adjust: exact; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class=""><pre class=" language-swift" style="-webkit-print-color-adjust: exact; 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; text-shadow: white 0px 1px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; word-spacing: normal; word-break: normal; word-wrap: normal; tab-size: 4; -webkit-hyphens: none;"><code class=" language-swift" style="-webkit-print-color-adjust: exact; 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; background-image: none; text-shadow: white 0px 1px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; word-spacing: normal; word-break: normal; word-wrap: normal; line-height: 1.5; tab-size: 4; -webkit-hyphens: none;"><span class="token keyword" style="-webkit-print-color-adjust: exact; color: rgb(0, 119, 170);">let</span> packages <span class="token operator" style="-webkit-print-color-adjust: exact; color: rgb(166, 127, 89); background-color: rgba(255, 255, 255, 0.498039); background-position: initial initial; background-repeat: initial initial;">=</span> <span class="token function" style="-webkit-print-color-adjust: exact; color: rgb(221, 74, 104);">Package</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">(</span>
    name<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"http-parser"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
    targets<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">[</span>
        <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">.</span><span class="token function" style="-webkit-print-color-adjust: exact; color: rgb(221, 74, 104);">target</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">(</span>
            name<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"http-parser"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
            publicHeaders<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"."</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
            sources<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">[</span><span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"http_parser.c"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">]</span>
        <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">)</span>
    <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">]</span>
<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">)</span></code></pre></div><ul style="-webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class=""><li style="-webkit-print-color-adjust: exact; margin: 0px;" class="">swift-build-tool</li></ul><div style="-webkit-print-color-adjust: exact; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class=""><pre class=" language-swift" style="-webkit-print-color-adjust: exact; 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; text-shadow: white 0px 1px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; word-spacing: normal; word-break: normal; word-wrap: normal; tab-size: 4; -webkit-hyphens: none;"><code class=" language-swift" style="-webkit-print-color-adjust: exact; 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; background-image: none; text-shadow: white 0px 1px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; word-spacing: normal; word-break: normal; word-wrap: normal; line-height: 1.5; tab-size: 4; -webkit-hyphens: none;"><span class="token keyword" style="-webkit-print-color-adjust: exact; color: rgb(0, 119, 170);">let</span> packages <span class="token operator" style="-webkit-print-color-adjust: exact; color: rgb(166, 127, 89); background-color: rgba(255, 255, 255, 0.498039); background-position: initial initial; background-repeat: initial initial;">=</span> <span class="token function" style="-webkit-print-color-adjust: exact; color: rgb(221, 74, 104);">Package</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">(</span>
    name<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"llbuild"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
    targets<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">[</span>
        <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">.</span><span class="token function" style="-webkit-print-color-adjust: exact; color: rgb(221, 74, 104);">target</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">(</span>
            name<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"swift-build-tool"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
            path<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"."</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
            sources<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">[</span>
                <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"lib/Basic"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
                <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"lib/llvm/Support"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
                <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"lib/Core"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
                <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"lib/BuildSystem"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
                <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"products/swift-build-tool/swift-build-tool.cpp"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
            <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">]</span>
        <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">)</span>
    <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">]</span>
<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">)</span></code></pre></div><h2 id="toc_5" style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(204, 204, 204); font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class="">Impact on existing code</h2><p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class="">These enhancements will be added to the version 4 manifest API, which will release with Swift 4. There will be no impact on packages using the version 3 manifest API. When packages update their minimum tools version to 4.0, they will need to update the manifest according to the changes in this proposal.</p><p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class="">There are two flat layouts supported in Swift 3:</p><ol style="-webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class=""><li style="-webkit-print-color-adjust: exact; margin: 0px;" class="">Source files directly in the package root.</li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class="">Source files directly inside a&nbsp;<code style="-webkit-print-color-adjust: exact; 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="">Sources/</code>&nbsp;directory.</li></ol><p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class="">If packages want to continue using either of these flat layouts, they will need to explicitly set a target path to the flat directory; otherwise, a directory named after the target is expected. For example, if a package&nbsp;<code style="-webkit-print-color-adjust: exact; 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="">Foo</code>&nbsp;has following layout:</p><div style="-webkit-print-color-adjust: exact; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class=""><pre class=" language-none" style="-webkit-print-color-adjust: exact; 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; text-shadow: white 0px 1px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; word-spacing: normal; word-break: normal; word-wrap: normal; tab-size: 4; -webkit-hyphens: none;"><code class=" language-none" style="-webkit-print-color-adjust: exact; 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; background-image: none; text-shadow: white 0px 1px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; word-spacing: normal; word-break: normal; word-wrap: normal; line-height: 1.5; tab-size: 4; -webkit-hyphens: none;">Package.swift
Sources/main.swift
Sources/foo.swift</code></pre></div><p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class="">The updated manifest will look like this:</p><div style="-webkit-print-color-adjust: exact; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class=""><pre class=" language-swift" style="-webkit-print-color-adjust: exact; 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; text-shadow: white 0px 1px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; word-spacing: normal; word-break: normal; word-wrap: normal; tab-size: 4; -webkit-hyphens: none;"><code class=" language-swift" style="-webkit-print-color-adjust: exact; 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; background-image: none; text-shadow: white 0px 1px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; word-spacing: normal; word-break: normal; word-wrap: normal; line-height: 1.5; tab-size: 4; -webkit-hyphens: none;"><span class="token comment" spellcheck="true" style="-webkit-print-color-adjust: exact; color: slategray;">// swift-tools-version:4.0</span>
<span class="token keyword" style="-webkit-print-color-adjust: exact; color: rgb(0, 119, 170);">import</span> <span class="token builtin" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">PackageDescription</span>

<span class="token keyword" style="-webkit-print-color-adjust: exact; color: rgb(0, 119, 170);">let</span> package <span class="token operator" style="-webkit-print-color-adjust: exact; color: rgb(166, 127, 89); background-color: rgba(255, 255, 255, 0.498039); background-position: initial initial; background-repeat: initial initial;">=</span> <span class="token function" style="-webkit-print-color-adjust: exact; color: rgb(221, 74, 104);">Package</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">(</span>
    name<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"Foo"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
    targets<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">[</span>
        <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">.</span><span class="token function" style="-webkit-print-color-adjust: exact; color: rgb(221, 74, 104);">target</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">(</span>name<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"Foo"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span> path<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">:</span> <span class="token string" style="-webkit-print-color-adjust: exact; color: rgb(102, 153, 0);">"Sources"</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">)</span><span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">,</span>
    <span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">]</span>
<span class="token punctuation" style="-webkit-print-color-adjust: exact; color: rgb(153, 153, 153);">)</span></code></pre></div><h2 id="toc_6" style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(204, 204, 204); font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class="">Alternatives considered</h2><p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class="">We considered making a more minimal change which disabled the flat layouts by default, and provided a top-level property to allow opting back in to them. This would allow us to discourage these layouts – which we would like to do before the package ecosystem grows – without needing to add a fully customizable API. However, we think the fuller API we've proposed here is fairly straightforward and provides the ability to make a number of existing projects into packages, so we think this is worth doing at this time.</p></div></div></body></html>