Sha256: d622f9d8e306df1c336900e156e927992be3244847c171f78bd589f66ce31e1a

Contents?: true

Size: 894 Bytes

Versions: 113

Compression:

Stored size: 894 Bytes

Contents

import PackageDescription
import Foundation

let path = FileManager.default.currentDirectoryPath + "/config.json"
var allProblems = [String]()

if
    let jsonData = try? Data(contentsOf: URL(fileURLWithPath: path), options: Data.ReadingOptions.mappedIfSafe) ,
    let json = try? JSONSerialization.jsonObject(with: jsonData, options: [])  ,
    let jsonDict = json as? [String: Any],
    let exercisesDict = jsonDict["exercises"] as? [[String: Any]],
    let exercises = exercisesDict.map({ $0["slug"] }) as? [String],
    let deprecated = jsonDict["deprecated"] as? [String] {

    allProblems += exercises
    allProblems += deprecated
} else {
    print("Could not parse config.json at \(path)")
}

let dependencies = allProblems.map { Package.Dependency.Package(url: "./exercises/\($0)/", majorVersion: 1) }

let package = Package(
    name: "xswift",
    dependencies: dependencies
    )

Version data entries

113 entries across 113 versions & 1 rubygems

Version Path
trackler-2.2.1.175 tracks/swift/Package.swift
trackler-2.2.1.174 tracks/swift/Package.swift
trackler-2.2.1.173 tracks/swift/Package.swift
trackler-2.2.1.172 tracks/swift/Package.swift
trackler-2.2.1.171 tracks/swift/Package.swift
trackler-2.2.1.170 tracks/swift/Package.swift
trackler-2.2.1.169 tracks/swift/Package.swift
trackler-2.2.1.167 tracks/swift/Package.swift
trackler-2.2.1.166 tracks/swift/Package.swift
trackler-2.2.1.165 tracks/swift/Package.swift
trackler-2.2.1.164 tracks/swift/Package.swift
trackler-2.2.1.163 tracks/swift/Package.swift
trackler-2.2.1.162 tracks/swift/Package.swift
trackler-2.2.1.161 tracks/swift/Package.swift
trackler-2.2.1.160 tracks/swift/Package.swift
trackler-2.2.1.159 tracks/swift/Package.swift
trackler-2.2.1.158 tracks/swift/Package.swift
trackler-2.2.1.157 tracks/swift/Package.swift
trackler-2.2.1.156 tracks/swift/Package.swift
trackler-2.2.1.155 tracks/swift/Package.swift