[swift-users] How to define interdependent modules in a package?

Tarun Joshi tj.joshi7 at gmail.com
Tue Dec 22 05:02:57 CST 2015


Hi,
I was following the github documentation to create multiple modules (
https://github.com/apple/swift-package-manager/blob/master/Documentation/SourceLayouts.md
)
in a package.

My package directory looks like this:
SwiftTest/Package.swift
SwiftTest/Sources/Bar/bar.swift
SwiftTest/Sources/Foo/foo.swift

bar.swift :
  public func bar() {
    print("bar")
  }

foo.swift :
  import Bar
  public func foo() {
    bar()
  }

Compiling this produces an error saying : foo.swift: error: no such module
'Bar'
When I remove dependency of 'Bar' module from foo.swift (by removing import
statement and call to 'bar'), it compiles fine.
Am I missing something here? Can't I use imports directly?

-- 
Regards,
`Tarun`
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20151222/38058fc8/attachment.html>


More information about the swift-users mailing list