Skip to content

Commit 39cc8c6

Browse files
committed
Merge branch 'deploy/0.6.5' into productive
2 parents ae4f670 + 1b6d4ca commit 39cc8c6

File tree

5 files changed

+39
-11
lines changed

5 files changed

+39
-11
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
1717
### Security
1818
- None.
1919

20+
## [0.6.5] - 2019-09-11
21+
### Fixed
22+
- Improve compatibility with rare "non-standard" Package.swift configurations
23+
Issue: [#79](https://github.com/JamitLabs/Accio/issues/79) | PR: [#80](https://github.com/JamitLabs/Accio/pull/80) | Author: [Frederick Pietschmann](https://github.com/fredpi)
24+
2025
## [0.6.4] - 2019-09-01
2126
### Fixed
2227
- Adjusted the bundle version fallback to support both macOS and iOS frameworks

Formula/accio.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class Accio < Formula
22
desc "Dependency manager driven by SwiftPM for iOS/macOS/tvOS/watchOS"
33
homepage "https://github.com/JamitLabs/Accio"
4-
url "https://github.com/JamitLabs/Accio.git", :tag => "0.6.3", :revision => "f480812e044486cb3ed890e67e3fd32700e7deea"
4+
url "https://github.com/JamitLabs/Accio.git", :tag => "0.6.4", :revision => "ae4f670312457f2bc8d8fc6b902bbdcd1b97db5a"
55
head "https://github.com/JamitLabs/Accio.git"
66

77
depends_on :xcode => ["10.2", :build]

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
alt="Codebeat Badge">
1414
</a>
1515
<a href="https://github.com/JamitLabs/Accio/releases">
16-
<img src="https://img.shields.io/badge/Version-0.6.4-blue.svg"
17-
alt="Version: 0.6.4">
16+
<img src="https://img.shields.io/badge/Version-0.6.5-blue.svg"
17+
alt="Version: 0.6.5">
1818
</a>
1919
<img src="https://img.shields.io/badge/Swift-5.0-FFAC45.svg"
2020
alt="Swift: 5.0">
@@ -133,7 +133,7 @@ To configure Accio in a new project, simply run the `init` command and provide b
133133
accio init -p "XcodeProjectName" -t "AppTargetName"
134134
```
135135

136-
This step will create a template `Package.swift` file and set some `.gitignore` entries to keep your repository clean. Please note that if your source code files aren't placed within directories named after the targets, you will need to explicitly set the `path` parameters within the targets in the `Package.swift` file to the correct paths. Also note that the specified `path` must be a directory recursively containing at least one Swift file – but mixing with other languages like (Objective-)C(++) is not supported, so they shouldn't be within the specified directory. The files in there will not be built, they just need to exist in order for SwifPM to work properly, so you could point this anywhere Swift-only code.
136+
This step will create a template `Package.swift` file and set some `.gitignore` entries to keep your repository clean. Please note that if your source code files aren't placed within directories named after the targets, you will need to explicitly set the `path` parameters within the targets in the `Package.swift` file to the correct paths. Also note that the specified `path` must be a directory recursively containing at least one Swift file – but mixing with other languages like (Objective-)C(++) is not supported, so they shouldn't be within the specified directory. The files in there will not be built, they just need to exist in order for SwiftPM to work properly, so you could point this anywhere Swift-only code.
137137

138138
Run `accio init help` to get a list of all available options.
139139

Sources/Accio/main.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Foundation
33
import SwiftCLI
44

55
// MARK: - CLI
6-
let cli = CLI(name: "accio", version: "0.6.4", description: "A dependency manager driven by SwiftPM that works for iOS/tvOS/watchOS/macOS projects.")
6+
let cli = CLI(name: "accio", version: "0.6.5", description: "A dependency manager driven by SwiftPM that works for iOS/tvOS/watchOS/macOS projects.")
77

88
cli.commands = [InitCommand(), InstallCommand(), UpdateCommand(), CleanCommand(), ClearCacheCommand(), SetSharedCacheCommand()]
99
cli.globalOptions.append(contentsOf: GlobalOptions.all)

Sources/AccioKit/Models/Manifest.swift

+29-6
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ enum ManifestError: Error {
77
class Manifest: Decodable {
88
// MARK: - Sub Types
99
struct Target: Decodable {
10-
struct Dependency: Decodable {
11-
let byName: [String]
10+
struct Dependency {
11+
let names: [String]
1212
}
1313

1414
let name: String
@@ -50,7 +50,7 @@ extension Manifest {
5050
}
5151
}
5252

53-
return AppTarget(projectName: name, targetName: $0.name, dependentLibraryNames: $0.dependencies.flatMap { $0.byName }, targetType: targetType!)
53+
return AppTarget(projectName: name, targetName: $0.name, dependentLibraryNames: $0.dependencies.flatMap { $0.names }, targetType: targetType!)
5454
}
5555
}
5656

@@ -63,15 +63,38 @@ extension Manifest {
6363
}
6464

6565
let productsTargets: [Target] = targets.filter { product.targets.contains($0.name) }
66-
let dependencyTargetNames: [String] = Array(Set(productsTargets.flatMap { $0.dependencies.flatMap { $0.byName } })).sorted()
66+
let dependencyNames: [String] = Array(Set(productsTargets.flatMap { $0.dependencies.flatMap { $0.names } })).sorted()
6767

6868
let projectTargetNames: [String] = targets.map { $0.name }
6969
let projectProductNames: [String] = products.map { $0.name }
7070

71-
let dependencyInternalLibraryNames: [String] = dependencyTargetNames.filter { projectProductNames.contains($0) }
72-
let dependencyExternalLibraryNames: [String] = dependencyTargetNames.filter { !projectTargetNames.contains($0) }
71+
let dependencyInternalLibraryNames: [String] = dependencyNames.filter { projectProductNames.contains($0) }
72+
let dependencyExternalLibraryNames: [String] = dependencyNames.filter { !projectTargetNames.contains($0) }
7373

7474
let libraryNames: [String] = dependencyInternalLibraryNames + dependencyExternalLibraryNames
7575
return try libraryNames.map { try dependencyGraph.framework(libraryName: $0) }
7676
}
7777
}
78+
79+
extension Manifest.Target.Dependency: Decodable {
80+
enum ManifestTargetDependencyParsingError: Error { case error }
81+
enum CodingKeys: String, CodingKey {
82+
case byName
83+
case target
84+
case product
85+
}
86+
87+
init(from decoder: Decoder) throws {
88+
let container = try decoder.container(keyedBy: CodingKeys.self)
89+
90+
if let byName = try container.decodeIfPresent([String?].self, forKey: .byName) {
91+
names = byName.compactMap { $0 }
92+
} else if let target = try container.decodeIfPresent([String?].self, forKey: .target) {
93+
names = target.compactMap { $0 }
94+
} else if let product = try container.decodeIfPresent([String?].self, forKey: .product) {
95+
names = product.compactMap { $0 }
96+
} else {
97+
throw ManifestTargetDependencyParsingError.error
98+
}
99+
}
100+
}

0 commit comments

Comments
 (0)