Skip to content

Instantly share code, notes, and snippets.

@ikesyo
ikesyo / xcode11-xcodebuild-list.md
Last active Jun 4, 2019
`xcodebuild -list` using Xcode 11 with a Swift Package
View xcode11-xcodebuild-list.md
$ xcodebuild -list
Resolve Package Graph

Resolved source packages:
  MyLibrary: /Users/ikesyo/Desktop/MyLibrary

Information about workspace "MyLibrary":
    Schemes:
        MyLibrary
@ikesyo
ikesyo / Kansaikt-#4.md
Last active Aug 9, 2020
Type aliasesによる互換性確保 #Kansaikt
View Kansaikt-#4.md
View swiftenv-install.sh
#!/usr/bin/env bash
# Automatically installs swiftenv and run's swiftenv install.
# This script was designed for usage in CI systems.
git clone -b support-installing-previews --depth 1 https://github.com/ikesyo/swiftenv.git ~/.swiftenv
export SWIFTENV_ROOT="$HOME/.swiftenv"
export PATH="$SWIFTENV_ROOT/bin:$SWIFTENV_ROOT/shims:$PATH"
if [ -f ".swift-version" ] || [ -n "$SWIFT_VERSION" ]; then
swiftenv install -s
@ikesyo
ikesyo / JSONStringTransformer.swift
Last active Mar 14, 2016
Convert a JSON string into a valid JSON object
View JSONStringTransformer.swift
// https://twitter.com/watura/status/708164552882425856
import Himotoki
struct Foo: Decodable {
let JSON: [String: AnyJSON]
static func decode(e: Extractor) throws -> Foo {
let dictFromJSONStringTransformer = Transformer<String, [String: AnyJSON]> { string in
guard let data = string.dataUsingEncoding(NSUTF8StringEncoding) else {
View carthage_ SubmoduleNotFound_patch.diff
diff --git a/Source/CarthageKit/Errors.swift b/Source/CarthageKit/Errors.swift
index f15cc3b..07ac87f 100644
--- a/Source/CarthageKit/Errors.swift
+++ b/Source/CarthageKit/Errors.swift
@@ -28,6 +28,9 @@ public enum CarthageError: ErrorType, Equatable {
/// a dependency.
case RequiredVersionNotFound(ProjectIdentifier, VersionSpecifier)
+ /// A git submodule didn't exist which is listed in `.gitmodules` entries.
+ case SubmoduleNotFound(String)
View carthage_resolver_patch.diff
diff --git a/Source/CarthageKit/Resolver.swift b/Source/CarthageKit/Resolver.swift
index 884880b..4f20925 100644
--- a/Source/CarthageKit/Resolver.swift
+++ b/Source/CarthageKit/Resolver.swift
@@ -117,13 +117,13 @@ public struct Resolver {
private func resolveDependenciesFromNodePermutations(permutationsProducer: SignalProducer<[DependencyNode], CarthageError>) -> SignalProducer<DependencyGraph, CarthageError> {
return permutationsProducer
- .flatMap(.Concat) { rootNodes -> SignalProducer<Event<DependencyGraph, CarthageError>, CarthageError> in
+ .flatMap(.Concat) { rootNodes -> SignalProducer<DependencyGraph, CarthageError> in
View carthage_patch.diff
diff --git a/Source/CarthageKit/Cartfile.swift b/Source/CarthageKit/Cartfile.swift
index b1b1b46..172b3c2 100644
--- a/Source/CarthageKit/Cartfile.swift
+++ b/Source/CarthageKit/Cartfile.swift
@@ -274,11 +274,14 @@ public struct Dependency<V: VersionType>: Equatable {
/// The project corresponding to this dependency.
public let project: ProjectIdentifier
+ public let dependencyOf: ProjectIdentifier?
+
View toScopedDisposable.swift
public func toScopedDisposable(disposable: Disposable) -> ScopedDisposable {
return ScopedDisposable(disposable)
}
@ikesyo
ikesyo / gist:8877f7c6d0cfb9ffab35
Last active Dec 16, 2015
Mapping with filtering nil
View gist:8877f7c6d0cfb9ffab35
let values = [ "1", "foo", "3" ]
// Swift 1.2
extension Array {
func filterMap(@noescape transform: T -> U?) -> [U] {
var results = [U]()
for x in self {
if let mapped = transform(x) {
results.append(mapped)