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.154 tracks/swift/Package.swift
trackler-2.2.1.153 tracks/swift/Package.swift
trackler-2.2.1.152 tracks/swift/Package.swift
trackler-2.2.1.151 tracks/swift/Package.swift
trackler-2.2.1.150 tracks/swift/Package.swift
trackler-2.2.1.149 tracks/swift/Package.swift
trackler-2.2.1.148 tracks/swift/Package.swift
trackler-2.2.1.147 tracks/swift/Package.swift
trackler-2.2.1.146 tracks/swift/Package.swift
trackler-2.2.1.145 tracks/swift/Package.swift
trackler-2.2.1.144 tracks/swift/Package.swift
trackler-2.2.1.143 tracks/swift/Package.swift
trackler-2.2.1.142 tracks/swift/Package.swift
trackler-2.2.1.141 tracks/swift/Package.swift
trackler-2.2.1.140 tracks/swift/Package.swift
trackler-2.2.1.139 tracks/swift/Package.swift
trackler-2.2.1.138 tracks/swift/Package.swift
trackler-2.2.1.137 tracks/swift/Package.swift
trackler-2.2.1.136 tracks/swift/Package.swift
trackler-2.2.1.135 tracks/swift/Package.swift