##Creating a static library:
Suppose you have a project with the following structure:
.
+-- CAwesome
| +-- awesome.h
| func testRecording() { | |
| let recordExpectation = expectationWithDescription("Record") | |
| let recordSettings = [ | |
| // AVFormatIDKey: NSNumber(unsignedInt:kAudioFormatLinearPCM), | |
| AVNumberOfChannelsKey: 1, | |
| AVSampleRateKey : 16000.0 | |
| ] | |
wget https://swift.org/builds/development/ubuntu1510/swift-DEVELOPMENT-SNAPSHOT-2016-02-25-a/swift-DEVELOPMENT-SNAPSHOT-2016-02-25-a-ubuntu15.10.tar.gz
export SWIFT_PATH=/home/rfdickerson/linux-swift-testing/swift-DEVELOPMENT-SNAPSHOT-2016-02-25-a-ubuntu15.10
| Run with -swift build --configuration release -Xcc -fblocks -Xcc -I$BUILD_DIR/.apt/usr/include -Xlinker -L$BUILD_DIR/.apt/usr/lib -Xlinker -rpath,$BUILD_DIR/.apt/usr/lib | indent | |
| -----> Building Package | |
| Cloning https://github.com/IBM-Swift/Kitura.git | |
| Resolved version: 0.6.0 | |
| Cloning https://github.com/IBM-Swift/Kitura-net.git | |
| Resolved version: 0.6.0 | |
| Cloning https://github.com/IBM-Swift/Kitura-sys.git | |
| Resolved version: 0.6.0 | |
| Cloning https://github.com/IBM-Swift/LoggerAPI.git |
| indirect enum STree { | |
| case Leaf | |
| case Node (STree, AnyObject, STree) | |
| } | |
| let s = STree.Node(.Node(.Leaf, 3, .Leaf), 5, .Leaf) | |
| func search(tree: STree, toFind: AnyObject) { | |
| switch tree { | |
| case .Leaf: return |
| typealias Byte = UInt8 | |
| let size: Int = 100000 | |
| var simpleData = [Byte](repeating: 3, count: size) | |
| var dataCompressed = [Byte](repeating: 6, count: size) | |
| simpleData[3] = 2 | |
| simpleData[4] = 1 |
| import Foundation | |
| func sayHello2() { | |
| //sleep(5) | |
| print("Hello!") | |
| } | |
| #if false | |
| public func pthread_create( |
| make[2]: Entering directory '/home/rfdickerson/swift-toolchains/swift-corelibs-libdispatch/src' | |
| /home/rfdickerson/swift-toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-06-20-a-ubuntu15.10/usr/bin/swiftc -frontend -c /home/rfdickerson/swift-toolchains/swift-corelibs-libdispatch/src/swift/Block.swift /home/rfdickerson/swift-toolchains/swift-corelibs-libdispatch/src/swift/Data.swift /home/rfdickerson/swift-toolchains/swift-corelibs-libdispatch/src/swift/Dispatch.swift /home/rfdickerson/swift-toolchains/swift-corelibs-libdispatch/src/swift/IO.swift /home/rfdickerson/swift-toolchains/swift-corelibs-libdispatch/src/swift/Private.swift /home/rfdickerson/swift-toolchains/swift-corelibs-libdispatch/src/swift/Queue.swift /home/rfdickerson/swift-toolchains/swift-corelibs-libdispatch/src/swift/Source.swift /home/rfdickerson/swift-toolchains/swift-corelibs-libdispatch/src/swift/Time.swift /home/rfdickerson/swift-toolchains/swift-corelibs-libdispatch/src/swift/Wrapper.swift -primary-file /home/rfdickerson/swift-toolchains/swift |
| import Foundation | |
| infix operator |> { associativity left precedence 140 } | |
| func |> <S,T> (value: S, f: (S) -> T) -> T{ | |
| return f(value) | |
| } | |
| enum SuccessOrFail<T> { | |
| case success(T) | |
| case failure(Error) |
| //: Playground - noun: a place where people can play | |
| import UIKit | |
| struct JSON { } | |
| struct ZewoMySQL { | |
| func execute(sqlStatement: String) {} | |
| } |