Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jankuca/swm
Swift Modules, a swift module (or package) manager #fuck_xcode #terminal_rocks
https://github.com/jankuca/swm
Last synced: 26 days ago
JSON representation
Swift Modules, a swift module (or package) manager #fuck_xcode #terminal_rocks
- Host: GitHub
- URL: https://github.com/jankuca/swm
- Owner: jankuca
- Created: 2014-12-06T11:17:39.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-13T16:35:49.000Z (almost 10 years ago)
- Last Synced: 2024-11-07T08:46:29.904Z (about 1 month ago)
- Language: Swift
- Homepage:
- Size: 266 KB
- Stars: 61
- Watchers: 7
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-ios-star - SWM (Swift Modules) - A package/dependency manager for Swift projects similar to npm (node.js package manager) or bower (browser package manager from Twitter). Does not require the use of Xcode. (Dependency / Package Manager / Getting Started)
- awesome-ios - SWM (Swift Modules) - A package/dependency manager for Swift projects similar to npm (node.js package manager) or bower (browser package manager from Twitter). Does not require the use of Xcode. (Dependency / Package Manager / Getting Started)
README
**Swift Modules**
The Swift Modules manager similar to the JavaScript world's *npm* and *bower*
# Installation
```
$ curl "https://raw.github.com/jankuca/swm/master/install.sh" | bash
```# Usage
## Dependencies
Module dependencies are declared in a `swiftmodule.json` file in the JSON format:
```
{
"name": "ModuleName",
"directories": {
"source": "src"
},
"dependencies": {
"Dependency": "jankuca/dependecy",
"MyOtherDependency": "git://github.com/jankuca/other-dependency"
}
}
``````
$ swm install
```The dependencies are then importable via the `import` Swift statement using the names specified in the `dependencies` map of the `swiftmodule.json` file.
### Using packages without a swiftmodule.json file
If a package does not include the `swiftmodule.json` file, the including package can specify the source file directory of the dependency in its `swiftmodule.json`.
```
{
"name": "ModuleName",
"dependencies": {
"Dependency": "jankuca/dependency @source:src"
}
}
```## Building
SWM can also build the actual app (the root module). If a `source` directory is specified in the `swiftmodule.json` file, all `.swift` files inside that subtree are compiled into a binary.
```
$ swm build
```Note that `swm install` also runs this internally.
## Code Signing
Once the app is built, it needs to be code-signed for distribution using a certificate obtained from Apple. SWM makes this dead simple by listing the available certificates and provisioning profiles.
There are two signing modes:
1. `store` – should be used for signing for the App Store or other distribution
2. `device` – should be used for signing for development and testing purposes; this adds a provisioning profile to the app package.```
$ swm sign store
Certificate:
1) CF826998D43332…499C595FCE980F20 "iPhone Developer: … (…)"
1
Signature for device
Certificate: CF826998D43332…499C595FCE980F20
Provisioning Profile: (none)
ok
```The command prompts for the certificate number (`1` in the case above).
```
$ swm sign device
Certificate:
1) CF826998D43332…499C595FCE980F20 "iPhone Developer: … (…)"
1
Provisioning Profile:
1) 7716db78-0b66-…-9fbf-3a9b653ec84a
1
Signature for device
Certificate: CF826998D43332…499C595FCE980F20
Provisioning Profile: 7716db78-0b66-…-9fbf-3a9b653ec84a
ok
```