-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add project.yml for xcodegened project with SPM #1713
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
Common/RuuviBundleUtils/Tests/RuuviBundleUtilsTests/RuuviBundleUtilsTests.swift
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,26 @@ | ||
// swift-tools-version:5.3 | ||
// swift-tools-version:5.9 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "RuuviPresenters", | ||
defaultLocalization: "en", | ||
platforms: [.macOS(.v10_15), .iOS(.v13)], | ||
products: [ | ||
// Products define the executables and libraries a package produces, and make them visible to other packages. | ||
.library( | ||
name: "RuuviPresenters", | ||
targets: ["RuuviPresenters"]) | ||
], | ||
dependencies: [ | ||
// Dependencies declare other packages that this package depends on. | ||
// .package(url: /* package url */, from: "1.0.0"), | ||
targets: ["RuuviPresenters"] | ||
) | ||
], | ||
targets: [ | ||
// Targets are the basic building blocks of a package. A target can define a module or a test suite. | ||
// Targets can depend on other targets in this package, and on products in packages this package depends on. | ||
.target( | ||
name: "RuuviPresenters", | ||
dependencies: []), | ||
resources: [.process("Resources")] | ||
), | ||
.testTarget( | ||
name: "RuuviPresentersTests", | ||
dependencies: ["RuuviPresenters"]) | ||
dependencies: ["RuuviPresenters"] | ||
) | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...uviPresenters/Sources/RuuviPresenters/Activity/RuuviLogo/ActivityPresenterRuuviLogo.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
Common/RuuviPresenters/Sources/RuuviPresenters/Error/Alert/ErrorPresenterAlert.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import UIKit | ||
import RuuviBundleUtils | ||
|
||
public final class ErrorPresenterAlert: ErrorPresenter { | ||
public init() {} | ||
|
1 change: 0 additions & 1 deletion
1
...n/RuuviPresenters/Sources/RuuviPresenters/Permission/Alert/PermissionPresenterAlert.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
Common/RuuviPresenters/Sources/RuuviPresenters/Resources/ActivityRuuviLogo.storyboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
12 changes: 4 additions & 8 deletions
12
Common/RuuviPresenters/Tests/RuuviPresentersTests/RuuviPresentersTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
import XCTest | ||
@testable import RuuviPresenters | ||
@testable import RuuviPresenters | ||
|
||
final class RuuviPresentersTests: XCTestCase { | ||
func testExample() { | ||
// This is an example of a functional test case. | ||
// Use XCTAssert and related functions to verify your tests produce the correct | ||
// results. | ||
XCTAssertEqual(RuuviPresenters().text, "Hello, World!") | ||
} | ||
final class RuuviPresentersTests: XCTestCase { | ||
func testExample() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,45 @@ | ||
// swift-tools-version:5.3 | ||
// swift-tools-version:5.9 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "RuuviDiscover", | ||
defaultLocalization: "en", | ||
platforms: [.macOS(.v10_15), .iOS(.v13)], | ||
products: [ | ||
// Products define the executables and libraries a package produces, and make them visible to other packages. | ||
.library( | ||
name: "RuuviDiscover", | ||
targets: ["RuuviDiscover"]) | ||
], | ||
dependencies: [ | ||
// Dependencies declare other packages that this package depends on. | ||
// .package(url: /* package url */, from: "1.0.0"), | ||
.package(path: "../../Packages/RuuviOntology"), | ||
.package(path: "../../Packages/RuuviContext"), | ||
.package(path: "../../Packages/RuuviReactor"), | ||
.package(path: "../../Packages/RuuviLocal"), | ||
.package(path: "../../Packages/RuuviService"), | ||
.package(path: "../../Packages/RuuviVirtual"), | ||
.package(path: "../../Common/RuuviPresenters"), | ||
.package(path: "../../Common/RuuviLocalization"), | ||
.package(url: "https://github.com/ruuvi/BTKit", .upToNextMinor(from: "0.4.3")), | ||
], | ||
targets: [ | ||
// Targets are the basic building blocks of a package. A target can define a module or a test suite. | ||
// Targets can depend on other targets in this package, and on products in packages this package depends on. | ||
.target( | ||
name: "RuuviDiscover", | ||
dependencies: []), | ||
dependencies: [ | ||
"RuuviOntology", | ||
"RuuviContext", | ||
"RuuviReactor", | ||
"RuuviLocal", | ||
"RuuviService", | ||
"RuuviVirtual", | ||
"RuuviPresenters", | ||
"BTKit", | ||
"RuuviLocalization" | ||
] | ||
), | ||
.testTarget( | ||
name: "RuuviDiscoverTests", | ||
dependencies: ["RuuviDiscover"]) | ||
name: "RuuviDiscoverTests" | ||
) | ||
] | ||
) |
83 changes: 83 additions & 0 deletions
83
Modules/RuuviDiscover/Sources/RuuviDiscover/Util/RuuviBundleUtils.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import Foundation | ||
import UIKit | ||
|
||
extension Bundle { | ||
public static func pod(_ clazz: AnyClass) -> Bundle { | ||
if let module = NSStringFromClass(clazz).components(separatedBy: ".").first, | ||
let bundleURL = Bundle(for: clazz).resourceURL?.appendingPathComponent("\(module).bundle"), | ||
let bundle = Bundle(url: bundleURL) { | ||
return bundle | ||
} else { | ||
assertionFailure() | ||
return Bundle.main | ||
} | ||
} | ||
} | ||
|
||
extension UIImage { | ||
public static func named(_ name: String, for clazz: AnyClass) -> UIImage? { | ||
#if SWIFT_PACKAGE | ||
return UIImage(named: name, in: Bundle.module, compatibleWith: nil) | ||
#else | ||
return UIImage(named: name, in: Bundle.pod(clazz), compatibleWith: nil) | ||
#endif | ||
} | ||
} | ||
|
||
extension String { | ||
public func localized(for clazz: AnyClass) -> String { | ||
let bundle: Bundle | ||
#if SWIFT_PACKAGE | ||
bundle = Bundle.module | ||
#else | ||
bundle = Bundle.pod(clazz) | ||
#endif | ||
if let module = NSStringFromClass(clazz).components(separatedBy: ".").first { | ||
if let path = bundle.path(forResource: currentLanguage(), ofType: "lproj"), | ||
let bundle = Bundle(path: path) { | ||
return bundle.localizedString(forKey: self, value: nil, table: module) | ||
} else if let path = bundle.path(forResource: "Base", ofType: "lproj"), | ||
let bundle = Bundle(path: path) { | ||
return bundle.localizedString(forKey: self, value: nil, table: module) | ||
} else { | ||
assertionFailure() | ||
return self | ||
} | ||
} else { | ||
assertionFailure() | ||
return self | ||
} | ||
} | ||
|
||
private func currentLanguage() -> String { | ||
if let preferred = Bundle.main.preferredLocalizations.first { | ||
return preferred | ||
} else { | ||
return "Base" | ||
} | ||
} | ||
} | ||
|
||
extension UIStoryboard { | ||
public static func named(_ name: String, for clazz: AnyClass) -> UIStoryboard { | ||
let bundle: Bundle | ||
#if SWIFT_PACKAGE | ||
bundle = Bundle.module | ||
#else | ||
bundle = Bundle.pod(clazz) | ||
#endif | ||
return UIStoryboard(name: name, bundle: bundle) | ||
} | ||
} | ||
|
||
extension UINib { | ||
public static func nibName(_ nibName: String, for clazz: AnyClass) -> UINib { | ||
let bundle: Bundle | ||
#if SWIFT_PACKAGE | ||
bundle = Bundle.module | ||
#else | ||
bundle = Bundle.pod(clazz) | ||
#endif | ||
return UINib(nibName: nibName, bundle: bundle) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
Modules/RuuviDiscover/Tests/RuuviDiscoverTests/RuuviDiscoverTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import XCTest | ||
@testable import RuuviDiscover | ||
|
||
final class RuuviDiscoverTests: XCTestCase { | ||
func testExample() { | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably set minimum target to iOS 14 since the main target is already bumped to iOS 14 min.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that main target is iOS 14+, but we don't need it in these packages :) Imho let's keep the iOS 13 for now, will bump it if there is a need