[swift-server-dev] Prototype of the discussed HTTP API Spec

Alex Blewitt alblue at apple.com
Wed May 31 05:48:46 CDT 2017


> On 30 May 2017, at 16:20, Carl Brown via swift-server-dev <swift-server-dev at swift.org> wrote:
> 
>> On May 30, 2017, at 5:53 AM, Helge Heß via swift-server-dev <swift-server-dev at swift.org <mailto:swift-server-dev at swift.org>> wrote:
>> 2)
>> The other thing that would be nice is a demo tool in the Sources directory, again similar to what Johannes showed (his tiny echod sample).
> 
> I have several of those (Echo, HelloWorld, etc) that I use for end-to-end testing, but since they're not part of the API, they're under `Tests/` not `Sources/`.  See https://github.com/carlbrown/HTTPSketch/tree/master/Tests/HTTPSketchTests/Helpers <https://github.com/carlbrown/HTTPSketch/tree/master/Tests/HTTPSketchTests/Helpers> 
> 
> I'm happy to move them to `Sources/`if that would be easier.

I would recommend against that. The problem is that if you have such helpers/demos in the Sources, then they not only get built for your project but also in every project that depends on that project as well. So you can be building your production app, and you'll still get Echo, HelloWorld built -- and if you are building with an Xcode generated project, that will lead to other (unnecessary) targets being built for your project.

If you have demos, I would suggest moving them into a different repository and then have that depend on the implementation repository through Swift PM. You can then guarantee that the same examples compile and behave correctly across different versions of your libraries.

Alex

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-server-dev/attachments/20170531/1dc5fe63/attachment.html>


More information about the swift-server-dev mailing list