spm: wdiget almost builds again

This commit is contained in:
Joe Mattiello
2023-03-10 20:28:52 -05:00
parent 128b180c1f
commit 351d4fd631
28 changed files with 86 additions and 91 deletions

View File

@@ -1,3 +1,3 @@
#include "../../Build.xcconfig"
#include "Shared.xcconfig"
PRODUCT_BUNDLE_IDENTIFIER = $(PRODUCT_BUNDLE_IDENTIFIER).SideBackup
PRODUCT_BUNDLE_IDENTIFIER = $(ORG_PREFIX).$(PRODUCT_NAME)

View File

@@ -1,3 +1 @@
#include "../../Build.xcconfig"
PRODUCT_BUNDLE_IDENTIFIER = $(ORG_PREFIX).$(PRODUCT_NAME)
#include "Shared.xcconfig"

View File

@@ -1,3 +1,3 @@
#include "../../Build.xcconfig"
#include "Shared.xcconfig"
PRODUCT_BUNDLE_IDENTIFIER = $(PRODUCT_BUNDLE_IDENTIFIER).SideWidget

View File

@@ -15,13 +15,9 @@ let USE_CXX_MODULES = envBool(("USE_CXX_MODULES", false))
let INHIBIT_UPSTREAM_WARNINGS = envBool(("INHIBIT_UPSTREAM_WARNINGS", true))
let STATIC_LIBRARY = envBool(("STATIC_LIBRARY", false))
let unsafe_flags : [String] = INHIBIT_UPSTREAM_WARNINGS ?
["-w"] :
[String]()
let unsafe_flags: [String] = INHIBIT_UPSTREAM_WARNINGS ? ["-w"] : [String]()
let unsafe_flags_cxx: [String] = INHIBIT_UPSTREAM_WARNINGS ?
["-w", "-Wno-module-import-in-extern-c"] :
["-Wno-module-import-in-extern-c"]
let unsafe_flags_cxx: [String] = INHIBIT_UPSTREAM_WARNINGS ? ["-w", "-Wno-module-import-in-extern-c"] : ["-Wno-module-import-in-extern-c"]
extension Package.Dependency {
/// The combination of all the dependencies for the Package.
@@ -58,7 +54,7 @@ extension Package.Dependency {
.github("JoeMatt/SwiftPMPlugins", from: "1.0.0"),
/// Generate swift files with git head info
.github("elegantchaos/Versionator", from: "1.0.3"),
.github("elegantchaos/Versionator", from: "1.0.3").disable,
/// plists from .json, including Info.plist
.github("elegantchaos/InfomaticPlugin", branch: "main").disable
@@ -76,7 +72,7 @@ extension Package.Dependency {
/// ```sh
/// mint run secret-keys generate
/// ```
.github("simorgh3196/swift-secret-keys", from: "0.0.1").disable,
.github("simorgh3196/swift-secret-keys", from: "0.0.1").disable,
/// #__ Swift docc generator __
/// `swift package generate-documentation`
@@ -91,7 +87,7 @@ extension Package.Dependency {
/// ## Preview:
/// `swift package --disable-sandbox preview-documentation --target MyFramework`
/// [Hosting](https://apple.github.io/swift-docc-plugin/documentation/swiftdoccplugin/)
.github("apple/swift-docc-plugin", from: "1.1.0").disable,
.github("apple/swift-docc-plugin", from: "1.1.0").disable,
]-?
#if USE_RESULT_BUILDER
@@ -288,11 +284,7 @@ extension Target.SideStore {
/// __PluginTargets__
static let pluginTargets: [Target] = {
#if USE_CARGO_BUILD_PLUGIN
Cargo.Plugins
#else
[]
#endif
}()
// MARK: - SideStoreAppKit
@@ -300,6 +292,8 @@ extension Target.SideStore {
.target(
name: "SideStoreAppKit",
dependencies: [
AppCenterAnalytics,
AppCenterCrashes,
"AltSign",
"Down",
"EmotionalDamage",
@@ -345,6 +339,8 @@ extension Target.SideStore {
dependencies: ["SideStoreCore", "KeychainAccess", "AltSign", "SemanticVersion", "SideKit"]))
// MARK: - SideDaemon
/// This is mostly leftover from `AltDaemon`
/// We don't need or use it, but it felt bad to just delete it at the moment.
static let SideDaemon: TargetPair = (
.executableTarget(
name: "SideDaemon",
@@ -360,12 +356,21 @@ extension Target.SideStore {
.testTarget(name: "SideDaemonTests", dependencies: ["SideDaemon"]))
// MARK: - SideBackup
static let SideBackup: Target =
.executableTarget(name: "SideBackup", plugins: commonPlugins)
static let SideBackup: Target = .executableTarget(
name: "SideBackup",
exclude: [
"Info.plist",
"AltBackup.entitlements"]
.map{ "Resources/\($0)" },
resources: [
.process("Resources/")
],
plugins: commonPlugins)
// MARK: - SidePatcher
/// Note: This is Objective-C so Swift generator's will fail if you try to apply them here - @JoeMatt
static let SidePatcher: TargetPair = (
.target(name: "SidePatcher", dependencies: [ RoxasUI ], plugins: commonPlugins),
.target(name: "SidePatcher", dependencies: [ RoxasUI ], plugins: []),
.testTarget(name: "SidePatcherTests", dependencies: ["SidePatcher"]))
}
@@ -571,6 +576,10 @@ enum Cargo: Encodable {
dependencies: ["Cargo"]
)].map{._plugin($0)}
}
#else
enum Cargo {
static let Plugins: [Target] = []
}
#endif
@@ -594,6 +603,14 @@ extension PackageDescription.Package.Dependency {
.package(url: "https://github.com/\(repo).git", revision: revision)}
}
/// `-?` Operator added as a quick way to `.compactMap{$0}` an
/// array that has optionals. In combination with adding `.disable` which returns `Self?`
/// as an easy way to disable packages from `Package.swift` since there are some limitions
/// 1. #if's can't be used in static array initiliziers, unless using ugly inline functions, and that kills
/// the Swift processor a lot.
/// The other option was to use a `@resultBuilder`, which I started below, to add some
/// synataic suger but probablly overkill honeslty.
/// - Author: @JoeMatt
postfix operator -?
extension Array where Element == Package.Dependency? {
func removeNils() -> [Package.Dependency] { self.compactMap{$0} }
@@ -603,10 +620,10 @@ extension Array where Element == Package.Dependency? {
extension Array where Element == Target? {
func removeNils() -> [Target] { self.compactMap{$0} }
static postfix func -? (array: Self) -> [Target] { array.removeNils() }
}
/// I'm a WIP as a less verbose way of merging array's of various`Target`s and `Dependency` lists
@resultBuilder
struct DependencyBuilder {
typealias Component = [Package.Dependency]

View File

@@ -35,6 +35,16 @@
<string>altbackup</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>SideBackup General</string>
<key>CFBundleURLSchemes</key>
<array>
<string>sidebackup</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>1</string>

View File

@@ -7,7 +7,7 @@
//
import Foundation
import Shared
import SideKit
import os.log

View File

@@ -8,6 +8,7 @@
import Foundation
import Security
import SideStoreCore
class XPCConnectionHandler: NSObject, ConnectionHandler {
var connectionHandler: ((Connection) -> Void)?

View File

@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ALTAnisetteURL</key>
<string>https://ani.sidestore.io</string>
<key>ALTAppGroups</key>
<array>
<string>group.$(APP_GROUP_IDENTIFIER)</string>
@@ -9,12 +11,10 @@
</array>
<key>ALTDeviceID</key>
<string>00008101-000129D63698001E</string>
<key>ALTServerID</key>
<string>1F7D5B55-79CE-4546-A029-D4DDC4AF3B6D</string>
<key>ALTPairingFile</key>
<string>&lt;insert pairing file here&gt;</string>
<key>ALTAnisetteURL</key>
<string>https://ani.sidestore.io</string>
<key>ALTServerID</key>
<string>1F7D5B55-79CE-4546-A029-D4DDC4AF3B6D</string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDocumentTypes</key>
@@ -44,8 +44,6 @@
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleURLTypes</key>
@@ -93,6 +91,13 @@
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSBonjourServices</key>
<array>
<string>_altserver._tcp</string>
@@ -131,13 +136,10 @@
<string>fetch</string>
<string>remote-notification</string>
</array>
<key>UIFileSharingEnabled</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
@@ -204,7 +206,5 @@
</dict>
</dict>
</array>
<key>UIFileSharingEnabled</key>
<true/>
</dict>
</plist>

View File

@@ -7,6 +7,7 @@
//
import AltSign
import SideStoreCore
extension ALTApplication {
static let altstoreBundleID = Bundle.Info.appbundleIdentifier

View File

@@ -7,7 +7,6 @@
//
import Intents
import Shared
import SideStoreCore
import os.log

View File

@@ -7,7 +7,7 @@
//
import RoxasUIKit
import Shared
import SideStoreCore
import SideKit
import AltSign

View File

@@ -13,7 +13,7 @@ import MobileCoreServices
import UIKit
import UserNotifications
import WidgetKit
import Shared
import AltSign
import SideKit

View File

@@ -12,7 +12,7 @@ import RoxasUIKit
import AltSign
import SideKit
import SideStoreCore
import Shared
import os.log
private extension DownloadAppOperation {

View File

@@ -11,7 +11,7 @@ import Foundation
import SideStoreCore
import minimuxer
import MiniMuxerSwift
import Shared
import SideKit
@objc(RemoveAppOperation)

View File

@@ -9,7 +9,7 @@ import Foundation
import Network
import SideStoreCore
import Shared
import SideKit
import MiniMuxerSwift

View File

@@ -11,7 +11,7 @@ import Foundation
import AltSign
import RoxasUIKit
import SideKit
import Shared
enum VerificationError: LocalizedError {
case privateEntitlements(ALTApplication, entitlements: [String: Any])

View File

@@ -9,7 +9,7 @@
import Foundation
import KeychainAccess
import AltSign
//import AltSign
@propertyWrapper
public struct KeychainItem<Value> {

View File

@@ -7,7 +7,7 @@
//
import Foundation
import Shared
public extension FileManager {
var altstoreSharedDirectory: URL? {

View File

@@ -8,8 +8,6 @@
import CoreData
import Foundation
import AltSign
import Roxas
public extension StoreApp {

View File

@@ -23,13 +23,13 @@
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>INIntentsSupported</key>
<array>
<string>RefreshAllIntent</string>
<string>ViewAppIntent</string>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>