Skip to content

Commit 150c64e

Browse files
committed
expanding module detail based on Artem and Jake's feedback
1 parent 7a9b022 commit 150c64e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/PackageManagerDocs/Documentation.docc/IntroducingPackages.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@ A target may define a library, a test suite, an executable, an macro, a binary d
2323

2424
### About Modules
2525

26-
A Swift package organizes code into _modules_.
26+
A Swift package organizes code into _modules_, a unit of code distribution.
2727
A module specifies a namespace and enforces access controls on which parts of the code can be used outside of that module.
28+
Each target you define in a Swift package is a module.
29+
30+
When you expose a library from a package, you expose the public API from your targets that make up that library for other packages to use.
2831
When you import a library in Swift, you're importing a module to use from your code, regardless of what language was used to create that module.
32+
A Swift package can also host C, C++, or Objective-C code as modules.
33+
Like Swift, these are also units of code distribution, but unlike Swift you expose the API that by hand-authoring a module-defining file (`module.modulemap`) that references a header or collection of headers with the API to expose.
2934

3035
A program may have all of its code in a single module, or it may import other modules as _dependencies_.
3136
Aside from the handful of system-provided modules, such as Darwin on macOS or Glibc on Linux, most dependencies require code to be downloaded and built in order to be used.

0 commit comments

Comments
 (0)