Skip to content

Commit

Permalink
Merge pull request #20 from bannzai/fix/install/swiftpm
Browse files Browse the repository at this point in the history
Fix install via Swift Package Manager
  • Loading branch information
bannzai authored Dec 1, 2019
2 parents c848cee + a879498 commit 7494a5f
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 48 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ Kuri.xcodeproj/xcuserdata/
Kuri.xcodeproj/
.gitsubmodule
/.build
bin/kuri
41 changes: 41 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
EXECUTE?=kuri
PROJECT?=Kuri
PACKAGE?=Kuri
DEMO_DIRECTORY?=KuriDemo
BUILD_DIRECTORY?=.build
RELEASE_BINARY_DIRECTORY?=$(BUILD_DIRECTORY)/release/$(PROJECT)

install: release
rm -rf ./bin/$(EXECUTE)
mkdir -p ./bin
cp -f $(RELEASE_BINARY_DIRECTORY) bin/$(EXECUTE)

release:
swift build -c release

build:
swift build

localmint:
$(eval HASH=$(shell git rev-parse HEAD))
echo "COMMIT HASH is $(HASH)"
git tag $(HASH)
mint install file://$(shell pwd -P)@$(HASH)

xcodeproj:
swift package generate-xcodeproj

clean:
swift package clean
rm -rf $(BUILD_DIRECTORY) $(PROJECT).xcodeproj

test: build xcodeproj
xcodebuild clean build test -project $(PROJECT).xcodeproj \
-scheme $(PACKAGE) \
-destination platform="macOS" \
-enableCodeCoverage YES \
-derivedDataPath .build/derivedData \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
ONLY_ACTIVE_ARCH=NO

26 changes: 4 additions & 22 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,31 +1,13 @@
{
"object": {
"pins": [
{
"package": "Commander",
"repositoryURL": "https://github.com/kylef/Commander.git",
"state": {
"branch": null,
"revision": "e5b50ad7b2e91eeb828393e89b03577b16be7db9",
"version": "0.8.0"
}
},
{
"package": "Spectre",
"repositoryURL": "https://github.com/kylef/Spectre.git",
"state": {
"branch": null,
"revision": "e34d5687e1e9d865e3527dd58bc2f7464ef6d936",
"version": "0.8.0"
}
},
{
"package": "SwiftShell",
"repositoryURL": "https://github.com/kareman/SwiftShell.git",
"state": {
"branch": null,
"revision": "ecf0544d740c8d729275ac3d52543511153909d6",
"version": "4.0.0"
"revision": "fb7fc2c9ad8811caf324431a508fb79e3fb74f99",
"version": "5.0.1"
}
},
{
Expand All @@ -42,8 +24,8 @@
"repositoryURL": "https://github.com/behrang/YamlSwift.git",
"state": {
"branch": null,
"revision": "901c4943f3206afb3b965bad2d1338e3c4fdbeba",
"version": "3.4.0"
"revision": "287f5cab7da0d92eb947b5fd8151b203ae04a9a3",
"version": "3.4.4"
}
}
]
Expand Down
10 changes: 5 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ let package = Package(
name: "Kuri",
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.executable(name: "kuri", targets: ["Kuri"]),
.library(
name: "Kuri",
targets: ["Kuri"]),
name: "KuriCore",
targets: ["KuriCore"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/bannzai/XcodeProject.git", from: Version(0, 1, 5)),
.package(url: "https://github.com/behrang/YamlSwift.git", from: Version(3, 4, 0)),
.package(url: "https://github.com/kareman/SwiftShell.git", from: Version(4, 0, 0)),
.package(url: "https://github.com/kylef/Commander.git", from: Version(0, 8, 0))
.package(url: "https://github.com/behrang/YamlSwift.git", from: Version(3, 4, 4)),
.package(url: "https://github.com/kareman/SwiftShell.git", from: Version(5, 0, 1)),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ Instructions with options [here](./Documents/generate.md).
and you can check [KuriDemo](./KuriDemo/)'s templates.

## Installation
### Homebrew(recommended)
`$ brew tap bannzai/homebrew-Kuri`
`$ brew install kuri`
### Mint (Recommended)
[Mint](https://github.com/yonaskolb/Mint) is a package manager for created by swift package manager executable libraries.
`$ mint install bannzai/kuri

### Manual
1. Download **Kuri** from [latest release version](https://github.com/bannzai/Kuri/releases)
Expand Down
4 changes: 2 additions & 2 deletions Sources/KuriCore/Command/Generator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ extension Generator {

}

fileprivate extension Generator {
fileprivate func generate(with prefix: String, for components: [GenerateComponent], and templateHeadPath: String) throws {
private extension Generator {
func generate(with prefix: String, for components: [GenerateComponent], and templateHeadPath: String) throws {
print("Begin generate")
defer {
print("End generate")
Expand Down
Empty file.
16 changes: 0 additions & 16 deletions Tests/KuriCoreTests/KuriTests.swift

This file was deleted.

0 comments on commit 7494a5f

Please sign in to comment.