[swift-users] How to import library from same Source Layout?

Volodymyr Boichentsov sakristx at gmail.com
Tue Dec 29 06:13:26 CST 2015


I found how. By targets in Package.swift file.

But I have a problem that I have 2 libs and one executable.

../Sources/Executable/main.swift
../Sources/Executable/classA.swift
../Sources/libA/some1.swift
../Sources/libA/some2.swift
../Sources/libB/some3.swift
../Sources/libB/some4.swift

libB should be imported in libA and Executable. But libA can’t see libB.


let package = Package(
    name: "example",
    targets: [ Target( name: "Executable", dependencies: [.Target(name: "libB"), .Target(name: "libA")]),
        Target( name: "libA", dependencies: [.Target(name: "libB")]),
        Target( name: "libB")
    ]
)


Best Regards,
Volodymyr Boichentsov





> On 29 Dec 2015, at 11:20, Volodymyr Boichentsov <sakristx at gmail.com> wrote:
> 
> I have next Source Layout
> 
> ../Sources/Executable/main.swift
> ../Sources/Executable/classA.swift
> ../Sources/liba/some1.swift
> ../Sources/liba/some2.swift
> 
> How to include liba to Executable main.swift? 
> 
> It’s not clear from this file
> https://github.com/apple/swift-package-manager/blob/master/Documentation/SourceLayouts.md <https://github.com/apple/swift-package-manager/blob/master/Documentation/SourceLayouts.md>
> 
> I’ve tried just simple import. Does not work.
> 
> P.S.: I know how to make dependency lib, but I don’t want it for my current situation.
>  
> Best Regards,
> Volodymyr Boichentsov
> 
> 
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20151229/c32cc9ed/attachment.html>


More information about the swift-users mailing list