[swift-users] Build specific Target instead of all
Stefan Bürk
stefan.buerk at impactmedia.de
Sun Jan 31 14:10:42 CST 2016
The main goal was to provide a bunch of simple binary entrypoints for splitting up simple tasks, sharing Packages and a shared package module.
Due we do not needall util binaryies on each server, a selectice build was decided. Because of the planned nature of the simple entry points utils, greate XXX git repositories for each entry point looks a litle bit overdone.
So on SERVER 1 we need only compile and install: UtilOne and UtilThree
On SERVER 2 we need only UtilThree
Assuming having not only three or four utils, maybe something beetween 30 and 50 utils ... splittet up to keep cmd line argument simple.
But maybe i'm missing the point ... or is it possible to something like this.
Packages/
Sources/
UtilOne/Package.swift
UtilOne/Sources/main.swift
UtilTwo/Package.swift
UtilTwo/Sources/main.swift
So we have to chage to Sources/UtilOne and run $ swift build and if needed for UtilTwo do the same.
But would this not end up in installing the references Packages dependenies ( like a mysql/cmysql packe) need in each util in following structure:
Sources/UtilOne/Packages/**
Sources/UtilOne/Package.swift
Sources/UtilOne/Sources/main.swift
Sources/UtilTwo/Packages/**
Sources/UtilTwo/Package.swift
Sources/UtilTwo/Sources/main.swift
But what if we create for each entry point own package repositoreies and having a meta one with a simple Package.swift referencing all UtilPackages.
But still, how to accomplis only building a specific package on a server instead of all ?
Need to dig in some more playing, but currently it seems that there is no way to keep the simple stuff simple and no way to simply or minimize the need of indepenent git repositories ...
-----Ursprüngliche Nachricht-----
Von: David Turnbull <dturnbull at gmail.com>
Gesendet: Son 31 Januar 2016 20:32
An: Stefan Bürk <stefan.buerk at impactmedia.de>
CC: List, Swift - Community Users (swift-users at swift.org) <swift-users at swift.org>
Betreff: Re: [swift-users] Build specific Target instead of all
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 <mailto: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> <mailto:stefan.buerk at impactmedia.de <mailto:stefan.buerk at impactmedia.de> >
http://www.impactmedia.de <http://www.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 <mailto: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/ebc86812/attachment.html>
More information about the swift-users
mailing list