[swift-users] Build specific Target instead of all

David Turnbull dturnbull at gmail.com
Sun Jan 31 13:32:40 CST 2016


Each target ends up being a module and won't recompile unless it's changed
so I'm not actually sure what your goal is. But making three more packages
instead of targets will have the effect you ask for.

-david  https://github.com/AE9RB/SwiftGL

On Sun, Jan 31, 2016 at 11:22 AM, Stefan Bürk <swift-users at swift.org> wrote:

> Hi everyone,
>
> I'm searching for a way to build only a specific Target(chain) instead of
> all targets in one build run.
>
> Folderstructure
>
> Sources/
>               UtilOne/main.swift
>               UtilTwo/main.swift
>               UtilThree/main.swift
>
> Content of Packages.swift
>
> import PackageDescription
>
> let package = Package(
>     name: "ProjectName",
>     targets: [
>         Target(
>             name: "UtilOne",
>             dependencies: []
>         ),
>         Target(
>             name: "UtilTwo",
>             dependencies: []
>         ),
>         Target(
>             name: "UtilThree",
>             dependencies: [
>                 .Target(name: "UtilOne")
>             ]
>         )
>     ],
>
>     dependencies: []
> )
>
> For building the project:
>
> $ swift build
>
> This will build all three targets in one run.
>
> What i need is to build a specific target, for example "UtilOne", which
> only builds the binary for UtilOne.
>
> Or how to build two targets instead of all threes ?
>
> Building target "UtilThree" should build UtilOne, because of the
> dependencies definition, but not UtilTwo.
>
> I couldnot found any documentation or way to get behind this, is there a
> way to get this work ?
>
> Freundliche Grüße
>
> Stefan Bürk
>
>
> impact.media GmbH
> Hirschstr. 8
> 70173 Stuttgart
>
> Fon +49-711-252698-00
> Fax +49-711-252698-90
>
> stefan.buerk at impactmedia.de <mailto:stefan.buerk at impactmedia.de>
> http://www.impactmedia.de <http://www.impactmedia.de/>
>
> Sitz Stuttgart, Amtsgericht Stuttgart, HRB 745476
> Geschäftsführer: Bernard Cagalj
>
> Die Mitteilung dieser E-Mail ist vertraulich und nur für den oben
> genannten Empfänger bestimmt. Wenn Sie nicht der vorgesehene
> Empfänger dieser E-Mail oder mit der Aushändigung an ihn betraut
> sind, weisen wir darauf hin, dass jede Form der Kenntnisnahme,
> Veröffentlichung, Vervielfältigung sowie Weitergabe des Inhalts
> untersagt ist. Wir bitten Sie uns in diesem Fall zu unterrichten.
> Vielen Dank!
>
> The information contained in this E-Mail is privileged and
> confidental intended only for the use of the individual or entity
> named above. If the reader of this message is not the intended
> recipient or competent to deliver it to the intended recipient,
> you are hereby notified that any dissemination, distribution or
> copying of this E-Mail is strictly prohibited. If you have
> received this E-Mail in error, please notify us immediately.
> Thank you!
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160131/f4d0db3d/attachment.html>


More information about the swift-users mailing list