Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
joehinkle11 authored May 7, 2021
1 parent 34656f5 commit edbd0e3
Showing 1 changed file with 16 additions and 38 deletions.
54 changes: 16 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# SwiftGit3, for AppMakeriOS
[![Build Status](https://travis-ci.org/SwiftGit2/SwiftGit2.svg)](https://travis-ci.org/SwiftGit2/SwiftGit2)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](#carthage)
[![GitHub release](https://img.shields.io/github/release/SwiftGit2/SwiftGit2.svg)](https://github.com/SwiftGit2/SwiftGit2/releases)
![Swift 5.3.x](https://img.shields.io/badge/Swift-5.3.x-orange.svg)
# SwiftGit3, as used in App Maker Professional

Swift bindings to [libgit2](https://github.com/libgit2/libgit2).

Expand Down Expand Up @@ -30,6 +26,20 @@ case let .failure(error):
}
```

## Adding SwiftGit2 to your Project

```swift
// swift-tools-version:4.0
import PackageDescription

let package = Package(
name: "YOUR_PROJECT_NAME",
dependencies: [
.package(url: "https://github.com/App-Maker-Software/SwiftGit3.git", from: "1.0.0"),
]
)
```

## Design
SwiftGit2 uses value objects wherever possible. That means using Swift’s `struct`s and `enum`s without holding references to libgit2 objects. This has a number of advantages:

Expand All @@ -41,38 +51,6 @@ This vastly simplifies the design of long-lived applications, which are the most

All methods for reading from or writing to a repository are on SwiftGit’s only `class`: `Repository`. This highlights the failability and mutation of these methods, while freeing up all other instances to be immutable `struct`s and `enum`s.

## Required Tools
To build SwiftGit2, you'll need the following tools installed locally:

* cmake
* libssh2
* libtool
* autoconf
* automake
* pkg-config

```
brew install cmake libssh2 libtool autoconf automake pkg-config
```

## Adding SwiftGit2 to your Project
The easiest way to add SwiftGit2 to your project is to use [Carthage](https://github.com/Carthage/Carthage). Simply add `github "SwiftGit2/SwiftGit2"` to your `Cartfile` and run `carthage update`.

If you’d like, you can do things the ~~hard~~ old-fashioned way:

1. Add SwiftGit2 as a submodule of your project’s repository.
2. Run `git submodule update --init --recursive` to fetch all of SwiftGit2’s depedencies.
3. Add `SwiftGit2.xcodeproj` to your project’s Xcode project or workspace.
4. On the “Build Phases” tab of your application target, add `SwiftGit2.framework` to the “Link Binary With Libraries” phase. SwiftGit2 must also be added to a “Copy Frameworks” build phase.
5. **If you added SwiftGit2 to a project (not a workspace)**, you will also need to add the appropriate SwiftGit2 target to the “Target Dependencies” of your application.

## Building SwiftGit2 Manually
If you want to build a copy of SwiftGit2 without Carthage, possibly for development:

1. Clone SwiftGit2
2. Run `git submodule update --init --recursive` to clone the submodules
3. Build in Xcode

## Contributions
We :heart: to receive pull requests! GitHub makes it easy:

Expand All @@ -83,4 +61,4 @@ We :heart: to receive pull requests! GitHub makes it easy:
All contributions should match GitHub’s [Swift Style Guide](https://github.com/github/swift-style-guide).

## License
SwiftGit2 is available under the MIT license.
SwiftGit3 is available under the MIT license.

0 comments on commit edbd0e3

Please sign in to comment.