Skip to content

Commit a7d44d1

Browse files
committed
Merge branch 'deploy/0.5.6' into productive
2 parents 3b8a910 + 2a7c162 commit a7d44d1

File tree

9 files changed

+82
-38
lines changed

9 files changed

+82
-38
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,22 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
1717
### Security
1818
- None.
1919

20+
## [0.5.6] - 2019-04-09
21+
### Added
22+
- Adds support for automatically finding schemes named like 'MBProgressHUD Framework tvOS'.
23+
### Changed
24+
- Some improvements that make the output information on the console more precise.
25+
### Deprecated
26+
- None.
27+
### Removed
28+
- None.
29+
### Fixed
30+
- Fixes the broken cleanup command of temporary frameworks after completing install.
31+
- Fixes an issue with multiple targets linking a single framework with schemes named after their platforms.
32+
- Fixes an issue with different platform specifiers used in scheme names.
33+
### Security
34+
- None.
35+
2036
## [0.5.5] - 2019-04-05
2137
### Added
2238
- None.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ from the file at path `Sources/Accio/main.swift` with something like:
6060
cli.debugGo(with: "accio update -d /Users/You/path/to/Accio/Demo -v")
6161
```
6262

63-
Note that the `-d` option specified the path from within to run Accio and `-v` makes sure the logging level is set to `verbose`.
63+
Note that the `-d` option specifies the path from within to run Accio and `-v` makes sure the logging level is set to `verbose`.
6464

6565
### Commit Messages
6666

Formula/accio.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
class Accio < Formula
2-
desc "Dependency manager driven by SwiftPM for iOS & Co."
2+
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.5.4", :revision => "6e97a3160d87c391a3bd4d778f903f920354440a"
4+
url "https://github.com/JamitLabs/Accio.git", :tag => "0.5.5", :revision => "3b8a910fc4e627c81ffa2e4eafeff450136bb0e4"
55
head "https://github.com/JamitLabs/Accio.git"
66

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

99
def install
1010
system "make", "install", "prefix=#{prefix}"
1111
end
12+
13+
test do
14+
system bin/"accio", "version"
15+
end
1216
end

README.md

Lines changed: 16 additions & 20 deletions
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.5.5-blue.svg"
17-
alt="Version: 0.5.5">
16+
<img src="https://img.shields.io/badge/Version-0.5.6-blue.svg"
17+
alt="Version: 0.5.6">
1818
</a>
1919
<img src="https://img.shields.io/badge/Swift-5.0-FFAC45.svg"
2020
alt="Swift: 5.0">
@@ -62,7 +62,7 @@ brew upgrade accio
6262

6363
## Why should I use this?
6464

65-
**TL;DR**: It's an improvement over Carthage, both regarding supported features & community openness. Also, it's targeted towards official SwiftPM's support for Apple platforms.
65+
**TL;DR**: It offers many improvements over Carthage, and it's targeted towards official SwiftPM's support for Apple platforms.
6666

6767
<details>
6868
<summary>
@@ -71,23 +71,19 @@ Detailed Explanation
7171

7272
For developers on Apple platforms there are already well established dependency managers, namely [CocoaPods](https://github.com/CocoaPods/CocoaPods) & [Carthage](https://github.com/Carthage/Carthage). If you like how CocoaPods deals with things, you probably won't ever need to use Accio. It doesn't do anything that CocoaPods doesn't.
7373

74-
But if you are like the many developers who prefer to use Carthage because it's written in Swift (not Ruby) and it doesn't create an Xcode workspace but is rather unintrusive, you might find that Accio solves some of the problems you might have come across with Carthage. Namely:
74+
But if you are like the many developers who prefer to use Carthage because it's written in Swift (not Ruby) and it doesn't create an Xcode workspace but is rather unintrusive, you might find that Accio solves some of the problems you might have come across with Carthage.
7575

76-
1. Carthage doesn't support cached builds *across projects*
77-
2. Carthage always builds *all* shared schemes of a dependency
78-
3. You need to *manually* link/unlink dependencies at two different places (project hierarchy & copy build phase)
76+
Accios **main advantages** over Carthage as of now are:
77+
1. Allows to specify *which schemes should be built* and skips all others.
78+
([#1227](https://github.com/Carthage/Carthage/issues/1227), [#1990](https://github.com/Carthage/Carthage/pull/1990), [#1616](https://github.com/Carthage/Carthage/pull/1616))
79+
2. *Automates the linkage & cleanup* of your specified frameworks within your Xcode project.
80+
([#1131](https://github.com/Carthage/Carthage/issues/1131), [#2605](https://github.com/Carthage/Carthage/issues/2605), [#145](https://github.com/Carthage/Carthage/issues/145), [#2477](https://github.com/Carthage/Carthage/issues/2477), replaces [Carting](https://github.com/artemnovichkov/Carting))
81+
3. Automatically uses a device-local cache to *prevent rebuilding* the same commit of a framework *for a different project*.
82+
([#2400](https://github.com/Carthage/Carthage/issues/2400), [#2716](https://github.com/Carthage/Carthage/pull/2716))
83+
4. Has an option to use a *shared cache* path (instead of the device-local cache) within a team so only a single person ever needs to build a specific commit of a dependency and all others in the team can reuse that cached build cutting off build times of the team considerably.
84+
(Replaces [Rome](https://github.com/blender/Rome))
7985

80-
While for some users these missing features might not make a huge difference at all, there's also many who really suffer from them. So adding these to Carthage might sound like the most obvious step to take from here and wouldn't need yet another tool. And there actually have been attempts to tackle each of the above issues within Carthage. But Carthage doesn't have a particularly welcoming community so they all failed. Apart from the fact that the project is written in [ReactiveSwift](https://github.com/ReactiveCocoa/ReactiveSwift), which is not bad in itself but still prevents many developers from being able to contribute new features, the main maintainer(s) don't take much responsibility in the concerns of the community. Here's what I mean:
81-
82-
For example problem #2 is tracked in [this](https://github.com/Carthage/Carthage/issues/1227) issue since March 2016 and has many upvotes. But the maintainers seem not to care about it at all. There was even [this PR](https://github.com/Carthage/Carthage/pull/1990) attempting to fix the issue that was very well received by the community and has (currently) 38 👍s and 14 ❤s. But after ignoring it for a year, the [main maintainers reaction](https://github.com/Carthage/Carthage/pull/1990#issuecomment-407409116) basically was "this is insufficient" and "I don't think we should solve this problem", earning 6 👎s for this comment alone. There was even an earlier approach to fix this issue in [this PR](https://github.com/Carthage/Carthage/pull/1616), but again, the main maintainer [basically said](https://github.com/Carthage/Carthage/pull/1616#issuecomment-271125684) "this is a minor case" and "Apple should fix this in Xcode".
83-
84-
The manual linking problem (#3) was reported several times (for example [here](https://github.com/Carthage/Carthage/issues/1131), [here](https://github.com/Carthage/Carthage/issues/2605) and [here](https://github.com/Carthage/Carthage/issues/145)). While it might have been ["an intentional design decision"](https://github.com/Carthage/Carthage/issues/145#issuecomment-64676821) at the beginning, it is nowadays agreed on to be a bad decision (even by the [main maintainer](https://github.com/Carthage/Carthage/issues/1131#issuecomment-185209513)). But there's no solution to the problem implemented as of now. The most recent attempt to *kind of* fix this was in [this PR](https://github.com/Carthage/Carthage/issues/2477) which was opened in June 2018 and didn't make any real progress since.
85-
86-
Problem #1 is tracked [here](https://github.com/Carthage/Carthage/issues/2400) since April 2018 and was actually tackled recently by [this PR](https://github.com/Carthage/Carthage/pull/2716). But only god knows if and when it will be merged.
87-
88-
The unwelcomingness (is there such a word?) of the Carthage community is so much so that developers tended to rather write another tool than to add the feature to Carthage itself. [Rome](https://github.com/blender/Rome) which attempts to fix the caching problem and [Carting](https://github.com/artemnovichkov/Carting) trying to fix the linking problem are two such examples. But more tools means higher chances that something could break over time and also complicates the configuration for both each developer and also the CI setup.
89-
90-
That's why Accio was designed as the all-in-one tool for any improvements you might need for managing dependencies using Carthage. It's explicitly open for new features from the community as long as they improve aspects of dependency management for the Apple developer community. Also, the implementation of Accio is pretty straight-forward, without the need to learn any reactive programming.
86+
Accio was designed as the all-in-one tool for any improvements you might need for managing dependencies using Carthage. It's explicitly open for new features from the community as long as they improve aspects of dependency management for the Apple developer community.
9187

9288
Additionally, the core of Accio was designed to use [SwiftPM](https://github.com/apple/swift-package-manager) as much as possible because we think it will at some point replace the need for an extra dependency manager completely. Until that time, making an open source project "Accio compliant" basically means adding a manifest file that exactly matches that of `SwiftPM`. This way Accio is trying to fill the gap between now and the time when Xcode properly supports `SwiftPM` for Apple platform projects (which we guess to be at WWDC 2020) and most Accio compatible projects might already be compatible out of the box when the time comes.
9389

@@ -226,7 +222,7 @@ import PackageDescription
226222

227223
let package = Package(
228224
name: "LibraryName",
229-
// platforms: [.iOS("8.0"), .macOS("10.10"), tvOS("9.0"), .watchOS("2.0")],
225+
// platforms: [.iOS("8.0"), .macOS("10.10"), .tvOS("9.0"), .watchOS("2.0")],
230226
products: [
231227
.library(name: "LibraryName", targets: ["LibraryName"])
232228
],
@@ -249,7 +245,7 @@ import PackageDescription
249245

250246
let package = Package(
251247
name: "LibraryName",
252-
// platforms: [.iOS("8.0"), .macOS("10.10"), tvOS("9.0"), .watchOS("2.0")],
248+
// platforms: [.iOS("8.0"), .macOS("10.10"), .tvOS("9.0"), .watchOS("2.0")],
253249
products: [
254250
.library(name: "LibraryName", targets: ["LibraryName"])
255251
],

Sources/Accio/main.swift

Lines changed: 1 addition & 1 deletion
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.5.5", description: "A dependency manager driven by SwiftPM that works for iOS/tvOS/watchOS/macOS projects.")
6+
let cli = CLI(name: "accio", version: "0.5.6", 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/Commands/Protocols/DependencyInstaller.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extension DependencyInstaller {
2828
let checkoutsDirUrl = workingDirectoryUrl.appendingPathComponent("\(Constants.buildPath)/checkouts")
2929

3030
if FileManager.default.fileExists(atPath: checkoutsDirUrl.path) {
31-
print("Reverting any changes in previous checkouts ...", level: .info)
31+
print("Reverting any changes in the checkouts directory ...", level: .info)
3232

3333
for fileName in try FileManager.default.contentsOfDirectory(atPath: checkoutsDirUrl.path) {
3434
let frameworkCheckoutPath: String = checkoutsDirUrl.appendingPathComponent(fileName).path
@@ -75,6 +75,6 @@ extension DependencyInstaller {
7575
}
7676

7777
try XcodeProjectIntegrationService.shared.handleRemovedTargets(keepingTargets: manifest.appTargets)
78-
try bash("rm -rf '\(Constants.temporaryFrameworksUrl)'")
78+
try bash("rm -rf '\(Constants.temporaryFrameworksUrl.path)'")
7979
}
8080
}

Sources/AccioKit/Models/Platform.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,20 @@ enum Platform: String, CaseIterable {
5050
return "Mac"
5151
}
5252
}
53+
54+
var specifiers: [String] {
55+
switch self {
56+
case .iOS:
57+
return [rawValue, "iPhone", "iPad"]
58+
59+
case .macOS:
60+
return [rawValue, "OSX", "OS X", "Mac", "Mac OSX", "Mac OS X"]
61+
62+
case .tvOS:
63+
return [rawValue, "Apple TV", "AppleTV"]
64+
65+
case .watchOS:
66+
return [rawValue, "Apple Watch", "AppleWatch"]
67+
}
68+
}
5369
}

Sources/AccioKit/Services/CarthageBuilderService.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ final class CarthageBuilderService {
1313
}
1414

1515
func build(framework: Framework, platform: Platform, alreadyBuiltFrameworkProducts: [FrameworkProduct]) throws -> FrameworkProduct {
16-
print("Building scheme \(framework.libraryName) with Carthage ...", level: .info)
16+
print("Building library \(framework.libraryName) with Carthage ...", level: .info)
17+
18+
try bash("git -C '\(framework.projectDirectory)' reset HEAD --hard --quiet")
19+
try bash("git -C '\(framework.projectDirectory)' clean -fd --quiet")
1720

1821
// link already built subdependencies from previous calls of this method
1922
for requiredFramework in framework.requiredFrameworks.flattenedDeepFirstOrder() {

Sources/AccioKit/Services/XcodeProjectSchemeHandlerService.swift

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,34 @@ final class XcodeProjectSchemeHandlerService {
77
let sharedSchemePaths: [String] = try framework.sharedSchemePaths()
88
let librarySchemePaths: [String] = framework.librarySchemePaths(in: sharedSchemePaths, framework: framework)
99

10-
let expectedSchemeNames: [String] = [
11-
framework.libraryName,
12-
"\(framework.libraryName) \(platform.rawValue)",
13-
"\(framework.libraryName) (\(platform.rawValue))",
14-
"\(framework.libraryName)-\(platform.rawValue)",
15-
"\(framework.libraryName)_\(platform.rawValue)",
16-
"\(framework.libraryName)-Package"
17-
]
18-
let matchingSchemePaths: [String] = librarySchemePaths.filter { expectedSchemeNames.contains($0.fileNameWithoutExtension) }
10+
let expectedSchemeNames: [String] = platform.specifiers.flatMap { platformSpecifier in
11+
return [
12+
framework.libraryName,
13+
"\(framework.libraryName) Framework",
14+
"\(framework.libraryName) Library",
15+
"\(framework.libraryName) \(platformSpecifier)",
16+
"\(framework.libraryName) (\(platformSpecifier))",
17+
"\(framework.libraryName)-\(platformSpecifier)",
18+
"\(framework.libraryName)_\(platformSpecifier)",
19+
"\(framework.libraryName) Framework \(platformSpecifier)",
20+
"\(framework.libraryName) Library \(platformSpecifier)",
21+
"\(framework.libraryName) Framework (\(platformSpecifier))",
22+
"\(framework.libraryName) Library (\(platformSpecifier))",
23+
"\(framework.libraryName)-Package"
24+
].map { $0.lowercased() }
25+
}
26+
let matchingSchemePaths: [String] = librarySchemePaths.filter { expectedSchemeNames.contains($0.fileNameWithoutExtension.lowercased()) }
27+
let matchingSchemeNames: [String] = matchingSchemePaths.map { $0.fileNameWithoutExtension }
1928

2029
if !matchingSchemePaths.isEmpty {
2130
let schemePathsToRemove: [String] = sharedSchemePaths.filter { !matchingSchemePaths.contains($0) }
22-
print("Found shared scheme with exact name '\(framework.libraryName)' – removing others: \(schemePathsToRemove.map { $0.fileNameWithoutExtension })", level: .verbose)
31+
print("Found shared scheme(s) \(matchingSchemeNames) matching specified library – removing others: \(schemePathsToRemove.map { $0.fileNameWithoutExtension })", level: .verbose)
2332

2433
for schemePathToRemove in schemePathsToRemove {
2534
try FileManager.default.removeItem(atPath: schemePathToRemove)
2635
}
2736
} else {
28-
print("No shared schemes found matching framework '\(framework.libraryName)' – can't remove unnecessary shared schemes, keeping all", level: .warning)
37+
print("No shared scheme(s) found matching library name '\(framework.libraryName)' – can't remove potentially unnecessary shared schemes, keeping all", level: .warning)
2938
}
3039
}
3140
}

0 commit comments

Comments
 (0)