diff --git a/CHANGELOG.md b/CHANGELOG.md
index 060ad02..b3f1cf3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,32 +17,19 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
### Security
- None.
+## [0.6.4] - 2019-09-01
+### Fixed
+- Adjusted the bundle version fallback to support both macOS and iOS frameworks
+ Issue: [#76](https://github.com/JamitLabs/Accio/issues/76) | PR: [#77](https://github.com/JamitLabs/Accio/pull/77) | Author: [Torsten Curdt](https://github.com/tcurdti)
+
## [0.6.3] - 2019-07-12
-### Added
-- None.
-### Changed
-- None.
-### Deprecated
-- None.
-### Removed
-- None.
### Fixed
- Fix mixed caching of frameworks with different Swift versions.
Issue: [#61](https://github.com/JamitLabs/Accio/issues/61) | PR: [#62](https://github.com/JamitLabs/Accio/pull/62) | Author: [Frederick Pietschmann](https://github.com/fredpi)
- Fix missing CFBundleVersion in Info.plist of build Frameworks by adding it implicity with the default value "1"
Issue: [#69](https://github.com/JamitLabs/Accio/issues/69) | PR: [#70](https://github.com/JamitLabs/Accio/pull/70) | Author: [Murat Yilmaz](https://github.com/mrylmz)
-### Security
-- None.
## [0.6.2] - 2019-06-20
-### Added
-- None.
-### Changed
-- None.
-### Deprecated
-- None.
-### Removed
-- None.
### Fixed
- Redownload dependencies as a fallback when previously checked out repositories are broken.
Issue: [#27](https://github.com/JamitLabs/Accio/issues/27) | PR: [#40](https://github.com/JamitLabs/Accio/pull/40) | Author: [Frederick Pietschmann](https://github.com/fredpi)
@@ -52,26 +39,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
PR: [#59](https://github.com/JamitLabs/Accio/pull/59) | Author: [Frederick Pietschmann](https://github.com/fredpi)
- Remove duplicated processing of frameworks referenced by multiple other frameworks.
Issue: [#51](https://github.com/JamitLabs/Accio/issues/51) | PR: [#53](https://github.com/JamitLabs/Accio/pull/53) | Author: [Frederick Pietschmann](https://github.com/fredpi)
-### Security
-- None.
## [0.6.1] - 2019-04-26
### Added
- Adds several popular GitHub projects for official integration support testing to the Demo project.
PR: [#10](https://github.com/JamitLabs/Accio/pull/10) | Author: [Cihat Gündüz](https://github.com/Dschee)
-### Changed
-- None.
-### Deprecated
-- None.
-### Removed
-- None.
### Fixed
- Fixes an issue where two or more targets for the same platform would cause project linking issues.
Issue: [#29](https://github.com/JamitLabs/Accio/issues/29) | PR: [#34](https://github.com/JamitLabs/Accio/pull/34) | Author: [Murat Yilmaz](https://github.com/mrylmz)
- Fixes an issue where temporary changes to SwiftPM-only frameworks would be reset before building.
Issue: [#35](https://github.com/JamitLabs/Accio/issues/35) | PR: [#36](https://github.com/JamitLabs/Accio/pull/36) | Author: [Cihat Gündüz](https://github.com/Dschee)
-### Security
-- None.
## [0.6.0] - 2019-04-19
### Added
@@ -81,116 +58,51 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
### Changed
- Improves reading of supported deployment targets.
- Improves init command by treating empty manifest files like non-existing ones. Fixes [#24](https://github.com/JamitLabs/Accio/issues/24).
-### Deprecated
-- None.
-### Removed
-- None.
### Fixed
- Fixes an issue where Accio commands where failing when Git resets failed.
- Fixes an issue where Accio didn't reset changed files untracked by Git.
-### Security
-- None.
## [0.5.6] - 2019-04-09
### Added
- Adds support for automatically finding schemes named like 'MBProgressHUD Framework tvOS'.
### Changed
- Some improvements that make the output information on the console more precise.
-### Deprecated
-- None.
-### Removed
-- None.
### Fixed
- Fixes the broken cleanup command of temporary frameworks after completing install.
- Fixes an issue with multiple targets linking a single framework with schemes named after their platforms.
- Fixes an issue with different platform specifiers used in scheme names.
-### Security
-- None.
## [0.5.5] - 2019-04-05
-### Added
-- None.
### Changed
- The framework copy build phase now optimizes "dirty" build timing by specifying the output files. [#13](https://github.com/JamitLabs/Accio/issues/13)
-### Deprecated
-- None.
-### Removed
-- None.
### Fixed
- Fixes an issue where broken previous install attempt leftovers cause errors on subsequent installs. [#12](https://github.com/JamitLabs/Accio/issues/12)
-### Security
-- None.
## [0.5.4] - 2019-04-03
-### Added
-- None.
-### Changed
-- None.
-### Deprecated
-- None.
-### Removed
-- None.
### Fixed
- Fix symbolic linking of .framework and .dSYM files.
-### Security
-- None.
## [0.5.3] - 2019-04-01
-### Added
-- None.
-### Changed
-- None.
-### Deprecated
-- None.
-### Removed
-- None.
### Fixed
- Fixes an issue where recursive copies of non symbolic links could cause build errors.
-### Security
-- None.
## [0.5.2] - 2019-04-01
-### Added
-- None.
-### Changed
-- None.
-### Deprecated
-- None.
-### Removed
-- None.
### Fixed
- Keep symlinks in cached ZIP files for macOS support.
-### Security
-- None.
## [0.5.1] - 2019-03-31
-### Added
-- None.
### Changed
- Check if shared cache path is available, else add new build products to local cache.
-### Deprecated
-- None.
-### Removed
-- None.
### Fixed
- Fixed an issue with copying unzipped cache build products back to project.
-### Security
-- None.
-
## [0.5.0] - 2019-03-30
### Added
- Demo project for integration testing with popular Swift frameworks.
### Changed
- Compress cached build products in a .zip file. Old style cached build products can be deleted.
-### Deprecated
-- None.
-### Removed
-- None.
### Fixed
- Multiple issues with paths, names, symbolic links & more.
-### Security
-- None.
## [0.4.0] - 2019-03-29
### Added
@@ -204,30 +116,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
- Unlink frameworks that are no longer included.
- Don't save build products to local cache if shared cache is available.
- Cleanup Accio run script phase when target gets removed.
-### Deprecated
-- None.
-### Removed
-- None.
### Fixed
- Fix typo in local cache logging.
- Fix missing use of `Constants.xcodeDependenciesGroup` & `Constants.dependenciesPath`.
-### Security
-- None.
## [0.3.0] - 2019-03-26
-### Added
-- None.
### Changed
- Add support for Swift 5 and Xcode 10.2.
- Separate cached frameworks by Swift tools version.
-### Deprecated
-- None.
### Removed
- Drop support for Swift 4.2 and Xcode <=10.1.
-### Fixed
-- None.
-### Security
-- None.
## [0.2.2]
### Fixed
diff --git a/Formula/accio.rb b/Formula/accio.rb
index 85d9a02..fe8b225 100644
--- a/Formula/accio.rb
+++ b/Formula/accio.rb
@@ -1,7 +1,7 @@
class Accio < Formula
desc "Dependency manager driven by SwiftPM for iOS/macOS/tvOS/watchOS"
homepage "https://github.com/JamitLabs/Accio"
- url "https://github.com/JamitLabs/Accio.git", :tag => "0.6.2", :revision => "b9bb6215778fccc6c4428101786b582f9217cd75"
+ url "https://github.com/JamitLabs/Accio.git", :tag => "0.6.3", :revision => "f480812e044486cb3ed890e67e3fd32700e7deea"
head "https://github.com/JamitLabs/Accio.git"
depends_on :xcode => ["10.2", :build]
diff --git a/Package.resolved b/Package.resolved
index 417a010..90b1813 100644
--- a/Package.resolved
+++ b/Package.resolved
@@ -86,9 +86,9 @@
"package": "XcodeProj",
"repositoryURL": "https://github.com/tuist/xcodeproj.git",
"state": {
- "branch": "master",
- "revision": "fca5c6b5cf6a28bae466d0a23080e94f5d8814e6",
- "version": null
+ "branch": null,
+ "revision": "b951777f42e9acbfb8f19da623b43aaa604422f9",
+ "version": "7.0.0"
}
}
]
diff --git a/Package.swift b/Package.swift
index fe4b2dd..24a19c8 100644
--- a/Package.swift
+++ b/Package.swift
@@ -15,7 +15,7 @@ let package = Package(
.package(url: "https://github.com/onevcat/Rainbow.git", .upToNextMajor(from: "3.1.4")),
.package(url: "https://github.com/jakeheis/SwiftCLI.git", .upToNextMajor(from: "5.2.2")),
.package(url: "https://github.com/kareman/SwiftShell.git", .upToNextMajor(from: "4.1.2")),
- .package(url: "https://github.com/tuist/xcodeproj.git", .branch("master")),
+ .package(url: "https://github.com/tuist/xcodeproj.git", .upToNextMajor(from: "7.0.0")),
],
targets: [
.target(
diff --git a/README.md b/README.md
index 8dbd9c1..48f9b48 100644
--- a/README.md
+++ b/README.md
@@ -13,8 +13,8 @@
alt="Codebeat Badge">
-
+
@@ -88,6 +88,7 @@ Alternatively, read the following expandable summary:
Summary of the Motivation & Advantages
+
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.
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.
diff --git a/Sources/Accio/main.swift b/Sources/Accio/main.swift
index 572482b..36e9fed 100644
--- a/Sources/Accio/main.swift
+++ b/Sources/Accio/main.swift
@@ -3,7 +3,7 @@ import Foundation
import SwiftCLI
// MARK: - CLI
-let cli = CLI(name: "accio", version: "0.6.3", description: "A dependency manager driven by SwiftPM that works for iOS/tvOS/watchOS/macOS projects.")
+let cli = CLI(name: "accio", version: "0.6.4", description: "A dependency manager driven by SwiftPM that works for iOS/tvOS/watchOS/macOS projects.")
cli.commands = [InitCommand(), InstallCommand(), UpdateCommand(), CleanCommand(), ClearCacheCommand(), SetSharedCacheCommand()]
cli.globalOptions.append(contentsOf: GlobalOptions.all)
diff --git a/Sources/AccioKit/Models/Platform.swift b/Sources/AccioKit/Models/Platform.swift
index b29aa14..aefe737 100644
--- a/Sources/AccioKit/Models/Platform.swift
+++ b/Sources/AccioKit/Models/Platform.swift
@@ -66,4 +66,21 @@ enum Platform: String, CaseIterable {
return [rawValue, "Apple Watch", "AppleWatch"]
}
}
+
+ var pathToPlist: String {
+ switch self {
+ case .iOS:
+ return ""
+
+ case .macOS:
+ return "Resources"
+
+ case .tvOS:
+ return ""
+
+ case .watchOS:
+ return ""
+ }
+ }
+
}
diff --git a/Sources/AccioKit/Services/XcodeProjectIntegrationService.swift b/Sources/AccioKit/Services/XcodeProjectIntegrationService.swift
index c52cfc3..000a187 100644
--- a/Sources/AccioKit/Services/XcodeProjectIntegrationService.swift
+++ b/Sources/AccioKit/Services/XcodeProjectIntegrationService.swift
@@ -128,7 +128,7 @@ final class XcodeProjectIntegrationService {
let frameworkProduct = FrameworkProduct(frameworkDirPath: frameworkDirPath, symbolsFilePath: symbolsFilePath, commitHash: frameworkProduct.commitHash)
try frameworkProduct.cleanupRecursiveFrameworkIfNeeded()
- try verifyBundleVersion(of: frameworkProduct)
+ try ensureBundleVersionExistence(of: frameworkProduct)
copiedFrameworkProducts.append(frameworkProduct)
}
@@ -243,18 +243,26 @@ final class XcodeProjectIntegrationService {
try projectFile.write(path: Path(xcodeProjectPath), override: true)
}
- private func verifyBundleVersion(of product: FrameworkProduct) throws {
- let plistURL = product.frameworkDirUrl.appendingPathComponent("Info.plist")
- let data = try Data(contentsOf: plistURL)
- var format: PropertyListSerialization.PropertyListFormat = .binary
- var plist = try PropertyListSerialization.propertyList(from: data, options: [.mutableContainersAndLeaves], format: &format) as! [String: Any]
-
- if plist["CFBundleVersion"] == nil {
- print("CFBundleVersion of framework \(product.libraryName) was not specified and will be set to 1", level: .warning)
- plist["CFBundleVersion"] = "1"
-
- let data = try PropertyListSerialization.data(fromPropertyList: plist, format: format, options: 0)
- try data.write(to: plistURL, options: .atomic)
+ private func ensureBundleVersionExistence(of product: FrameworkProduct) throws {
+ let plistURLs = [
+ product.frameworkDirUrl.appendingPathComponent("Resources").appendingPathComponent("Info.plist"),
+ product.frameworkDirUrl.appendingPathComponent("Info.plist"),
+ ]
+ for plistURL in plistURLs {
+ if FileManager.default.fileExists(atPath: plistURL.path) {
+ let data = try Data(contentsOf: plistURL)
+ var format: PropertyListSerialization.PropertyListFormat = .binary
+ var plist = try PropertyListSerialization.propertyList(from: data, options: [.mutableContainersAndLeaves], format: &format) as! [String: Any]
+
+ // add CFBundleVersion if missing
+ if plist["CFBundleVersion"] == nil {
+ print("CFBundleVersion of framework \(product.libraryName) was not specified and will be set to 1", level: .warning)
+ plist["CFBundleVersion"] = "1"
+
+ let data = try PropertyListSerialization.data(fromPropertyList: plist, format: format, options: 0)
+ try data.write(to: plistURL, options: .atomic)
+ }
+ }
}
}
}
diff --git a/Tests/AccioKitTests/Services/XcodeProjectIntegrationServiceTests.swift b/Tests/AccioKitTests/Services/XcodeProjectIntegrationServiceTests.swift
index e15c67f..102ab6e 100644
--- a/Tests/AccioKitTests/Services/XcodeProjectIntegrationServiceTests.swift
+++ b/Tests/AccioKitTests/Services/XcodeProjectIntegrationServiceTests.swift
@@ -54,8 +54,13 @@ class XcodeProjectIntegrationServiceTests: XCTestCase {
clean()
}
- private func createInfoPlist(frameworkName: String, includeBundleVersion: Bool) {
- let plistURL = testResourcesDir.appendingPathComponent(Constants.buildPath).appendingPathComponent("iOS/\(frameworkName).framework/Info.plist")
+ private func createInfoPlist(platform: Platform, frameworkName: String, includeBundleVersion: Bool) {
+ let resourcesURL = testResourcesDir.appendingPathComponent(Constants.buildPath)
+ .appendingPathComponent(platform.rawValue)
+ .appendingPathComponent("\(frameworkName).framework")
+ .appendingPathComponent(platform.pathToPlist)
+ try! FileManager.default.createDirectory(atPath: resourcesURL.path, withIntermediateDirectories: true, attributes: nil)
+ let plistURL = resourcesURL.appendingPathComponent("Info.plist")
let plist = includeBundleVersion ? ["CFBundleVersion": "1"] : [:]
let data = try! PropertyListSerialization.data(fromPropertyList: plist, format: .binary, options: 0)
try! data.write(to: plistURL, options: .atomic)
@@ -66,6 +71,9 @@ class XcodeProjectIntegrationServiceTests: XCTestCase {
}
func testUpdateDependencies() {
+
+ let platform: Platform = .iOS
+
let xcodeProjectIntegrationService = XcodeProjectIntegrationService(workingDirectory: testResourcesDir.path)
for appTarget in [regularTarget, testTarget] {
@@ -88,21 +96,21 @@ class XcodeProjectIntegrationServiceTests: XCTestCase {
XCTAssert(!targetObject.buildPhases.contains { $0.type() == .runScript && ($0 as! PBXShellScriptBuildPhase).name == Constants.copyBuildScript })
testFrameworks.forEach { frameworkName, includeBundleVersion in
- createInfoPlist(frameworkName: frameworkName, includeBundleVersion: includeBundleVersion)
+ createInfoPlist(platform:platform, frameworkName: frameworkName, includeBundleVersion: includeBundleVersion)
}
- try! xcodeProjectIntegrationService.updateDependencies(of: appTarget, for: .iOS, with: frameworkProducts)
+ try! xcodeProjectIntegrationService.updateDependencies(of: appTarget, for: platform, with: frameworkProducts)
// test CFBundleVersion in Info.plist
frameworkProducts.forEach { product in
let frameworkPath = product.frameworkDirPath.replacingOccurrences(of: "/.accio/", with: "/Dependencies/")
- let plistURL = URL(fileURLWithPath: frameworkPath).appendingPathComponent("Info.plist")
+ let plistURL = URL(fileURLWithPath: frameworkPath).appendingPathComponent(platform.pathToPlist).appendingPathComponent("Info.plist")
let data = try! Data(contentsOf: plistURL)
var format: PropertyListSerialization.PropertyListFormat = .binary
var plist = try! PropertyListSerialization.propertyList(from: data, options: [.mutableContainersAndLeaves], format: &format) as! [String: Any]
- print(plistURL)
- print(plist)
+ print("\(product.platformName) \(product.libraryName) \(plist)")
+
XCTAssertNotNil(plist["CFBundleVersion"])
}
@@ -127,7 +135,7 @@ class XcodeProjectIntegrationServiceTests: XCTestCase {
let accioBuildScript = targetObject.buildPhases.first { $0.type() == .runScript && ($0 as! PBXShellScriptBuildPhase).name == Constants.copyBuildScript } as! PBXShellScriptBuildPhase
XCTAssertEqual(accioBuildScript.inputPaths.count, testFrameworks.count)
- XCTAssertEqual(accioBuildScript.inputPaths, testFrameworks.map { "$(SRCROOT)/\(Constants.dependenciesPath)/iOS/\($0.name).framework" })
+ XCTAssertEqual(accioBuildScript.inputPaths, testFrameworks.map { "$(SRCROOT)/\(Constants.dependenciesPath)/\(platform.rawValue)/\($0.name).framework" })
case .test, .appExtension:
let accioBuildScript = targetObject.buildPhases.first { $0.type() == .runScript && ($0 as! PBXShellScriptBuildPhase).name == Constants.copyBuildScript }