Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/JohnSundell/Xgen

A Swift package for generating Xcode workspaces & playgrounds
https://github.com/JohnSundell/Xgen

generation playground swift xcode xcodeproj

Last synced: 3 months ago
JSON representation

A Swift package for generating Xcode workspaces & playgrounds

Awesome Lists containing this project

README

        


Xgen

Easily generate Xcode workspaces & playgrounds from a Swift script or command line tool.

## Usage

Generate workspaces:

```swift
import Xgen

let workspace = Workspace(path: "~/MyWorkspace")
workspace.addProject(at: "~/MyProject.xcodeproj")
try workspace.generate()
```

Generate playgrounds:

```swift
import Xgen

let code = "import Foundation\n\n" +
"print(\"Hello world\")"
let playground = Playground(path: "~/MyPlayground", platform: .iOS, code: code)
try playground.generate()
```

## Installation

### For scripts

- Install [Marathon](https://github.com/johnsundell/marathon).
- Add Xgen to Marathon using `$ marathon add [email protected]:JohnSundell/Xgen.git`.
- Alternatively, add `[email protected]:JohnSundell/Xgen.git` to your `Marathonfile`.
- Write your script, then run it using `$ marathon run yourScript.swift`.

### For command line tools

- Add `.Package(url: "[email protected]:johnsundell/xgen.git", majorVersion: 1)` to your `Package.swift` file.
- Update your packages using `$ swift package update`.

## Help, feedback or suggestions?

- [Open an issue](https://github.com/JohnSundell/Xgen/issues/new) if you need help, if you found a bug, or if you want to discuss a feature request.
- [Open a PR](https://github.com/JohnSundell/Xgen/pull/new/master) if you want to make some change to Xgen.
- Contact [@johnsundell on Twitter](https://twitter.com/johnsundell) for discussions, news & announcements about Xgen & other projects.