[swift-users] Build specific Target instead of all

Stefan Bürk stefan.buerk at impactmedia.de
Sun Jan 31 13:22:33 CST 2016


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! 


More information about the swift-users mailing list