Skip to content

Commit

Permalink
Merge pull request #25 from scribd/0.9.9
Browse files Browse the repository at this point in the history
Homebrew
  • Loading branch information
trupin authored Jun 4, 2018
2 parents 201ce11 + 3957316 commit 9c0040e
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 17 deletions.
18 changes: 6 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,40 +1,34 @@
VERSION := $(shell /usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" WeaverDI.xcodeproj/WeaverCodeGen_Info.plist)
PREFIX = /usr/local
PREFIX=/usr/local
SWIFT_BUILD_FLAGS=--configuration release

.PHONY: clean build install package generate_sources codecov

build:
$(call build)
@swift build --disable-sandbox $(SWIFT_BUILD_FLAGS)

generate_sources:
bash -c "(command -v sourcery && sourcery) || echo 'warning: Sourcery is not installed'"

clean:
rm -rf .build

install:
$(call build)
install: build
$(call install_files,$(PREFIX))

uninstall:
rm "$(PREFIX)/bin/weaver"
rm -rf "$(PREFIX)/share/weaver"

package:
$(call build)
package: build
$(call install_files,./build/package/weaver)
cd ./build/package/ && zip -r ../../weaver-$(VERSION).zip ./weaver

codecov:
$(call build)
codecov: build
xcodebuild test -scheme Tests -enableCodeCoverage YES
bash -c "bash <(curl -s https://codecov.io/bash) -J Weaver -t eaa7c4af-5ca2-4e08-8f07-38a44671e5e0"
rm *.coverage.txt

define build
@swift build --disable-sandbox --configuration release
endef

define install_files
install -d $(1)/bin
install -d $(1)/share/weaver/Resources
Expand Down
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
"repositoryURL": "https://github.com/jpsim/SourceKitten.git",
"state": {
"branch": null,
"revision": "b6b10419ee439167ba6f7bd928ad30754ff5eb5d",
"version": "0.20.0"
"revision": "7c09176766d4bbc5da377ad857953fb49510a6aa",
"version": "0.21.0"
}
},
{
Expand Down
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:4.1
// swift-tools-version:4.0
import PackageDescription

let package = Package(
Expand All @@ -7,9 +7,9 @@ let package = Package(
.library(name: "WeaverDI", targets: ["WeaverDI"])
],
dependencies: [
.package(url: "https://github.com/jpsim/SourceKitten.git", from: "0.19.1"),
.package(url: "https://github.com/jpsim/SourceKitten.git", from: "0.21.0"),
.package(url: "https://github.com/kylef/Commander.git", from: "0.6.0"),
.package(url: "https://github.com/kylef/Stencil.git", from: "0.10.1")
.package(url: "https://github.com/kylef/Stencil.git", from: "0.11.0")
],
targets: [
.target(name: "WeaverDI"),
Expand Down
17 changes: 17 additions & 0 deletions Sources/WeaverCodeGen/shim-swift-4.1.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// shim-swift-4.2.swift
// WeaverCodeGen
//
// Created by Théophane Rupin on 6/3/18.
//

import Foundation

#if swift(>=4.1)
#else
extension Collection {
public func compactMap<ElementOfResult>(_ transform: (Element) throws -> ElementOfResult?) rethrows -> [ElementOfResult] {
return try flatMap(transform)
}
}
#endif
4 changes: 4 additions & 0 deletions WeaverDI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
/* End PBXAggregateTarget section */

/* Begin PBXBuildFile section */
19F3CD6820C43F32007C3076 /* shim-swift-4.1.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19F3CD6720C43F32007C3076 /* shim-swift-4.1.swift */; };
OBJ_199 /* Package.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_6 /* Package.swift */; };
OBJ_205 /* Package.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_57 /* Package.swift */; };
OBJ_211 /* Package.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_78 /* Package.swift */; };
Expand Down Expand Up @@ -457,6 +458,7 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
19F3CD6720C43F32007C3076 /* shim-swift-4.1.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "shim-swift-4.1.swift"; sourceTree = "<group>"; };
"Commander::Commander::Product" /* Commander.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Commander.framework; sourceTree = BUILT_PRODUCTS_DIR; };
OBJ_10 /* Dependencies.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dependencies.swift; sourceTree = "<group>"; };
OBJ_100 /* Reporter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Reporter.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -885,6 +887,7 @@
OBJ_17 /* WeaverCodeGen */ = {
isa = PBXGroup;
children = (
19F3CD6720C43F32007C3076 /* shim-swift-4.1.swift */,
OBJ_18 /* AccessLevel.swift */,
OBJ_19 /* AutoEquatable.generated.swift */,
OBJ_20 /* AutoHashable.generated.swift */,
Expand Down Expand Up @@ -1657,6 +1660,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 0;
files = (
19F3CD6820C43F32007C3076 /* shim-swift-4.1.swift in Sources */,
OBJ_329 /* AccessLevel.swift in Sources */,
OBJ_330 /* AutoEquatable.generated.swift in Sources */,
OBJ_331 /* AutoHashable.generated.swift in Sources */,
Expand Down

0 comments on commit 9c0040e

Please sign in to comment.