diff --git a/SideStoreApp/Sources/DangerDependencies/DangerDependencies.swift b/.env similarity index 100% rename from SideStoreApp/Sources/DangerDependencies/DangerDependencies.swift rename to .env diff --git a/Build.xcconfig b/Build.xcconfig index 3c049de8..58798bac 100644 --- a/Build.xcconfig +++ b/Build.xcconfig @@ -6,19 +6,26 @@ CURRENT_PROJECT_VERSION = 3050 // Vars to be overwritten by `CodeSigning.xcconfig` if exists DEVELOPMENT_TEAM = S32Z3HMYVQ -ORG_IDENTIFIER = com.SideStore +ORG_IDENTIFIER = com.$(PROJECT_NAME) // Codesigning settings defined optionally, see `CodeSigning.xcconfig.example` #include? "CodeSigning.xcconfig" ORG_PREFIX = $(ORG_IDENTIFIER) - -PRODUCT_NAME = SideStore -EXTENSION_PREFIX = $(ORG_PREFIX).SideStore -//PRODUCT_NAME[configuration=Debug] = Prov Debug - -PRODUCT_BUNDLE_IDENTIFIER = $(ORG_PREFIX).SideStore -//PRODUCT_BUNDLE_IDENTIFIER[configuration=Debug] = $(ORG_PREFIX).$(PROJECT_NAME:lower)-debug - -APP_GROUP_IDENTIFIER = $(ORG_PREFIX).SideStore +APP_GROUP_IDENTIFIER = $(ORG_PREFIX).$(PROJECT_NAME) ICLOUD_CONTAINER_IDENTIFIER = iCloud.$(ORG_PREFIX).$(PROJECT_NAME) + +PRODUCT_NAME = $(PROJECT_NAME) +PRODUCT_NAME[config=Debug] = $(PROJECT_NAME) Debug + +EXTENSION_PREFIX = $(ORG_PREFIX).$(PROJECT_NAME) + +PRODUCT_BUNDLE_IDENTIFIER = $(ORG_PREFIX).$(PROJECT_NAME:lower) +PRODUCT_BUNDLE_IDENTIFIER[config=Debug] = $(ORG_PREFIX).$(PROJECT_NAME:lower)-debug + +// MARK: - XCode / Swift + +// Clang and the build system support a new mode for building module dependencies called explicit modules +// which improves build performance, reliability, and correctness. +// https://developer.apple.com/documentation/xcode-release-notes/xcode-14_3-release-notes#New-Features-in-Xcode-143-Beta-2 +_EXPERIMENTAL_CLANG_EXPLICIT_MODULES = YES diff --git a/Project.swift b/Project.swift index 052d0d04..592e6f00 100644 --- a/Project.swift +++ b/Project.swift @@ -19,25 +19,16 @@ let project = Project( ), entitlements: "SideStoreApp/Sources/SideStore/Resources/SideStore.entitlements", dependencies: [ - .package(product: "SideStoreAppKit"), + .package(path: "SideStoreApp"), .target(name: "SideWidget"), + .sdk(name: "libAppleAcrhive.tbd", status: .required) ], settings: .settings(configurations: [ .debug(name: "Debug", xcconfig: "SideStoreApp/Configurations/SideStore-Debug.xcconfig"), .release(name: "Release", xcconfig: "SideStoreApp/Configurations/SideStore-Release.xcconfig"), ]) ), - // Target( - // name: "SideStoreTests", - // platform: .iOS, - // product: .unitTests, - // bundleId: "com.SideStore.SideStoreTests", - // infoPlist: "Info.plist", - // sources: ["SideStoreApp/Tests/SideStoreAppTests/**"], - // dependencies: [ - // .target(name: "SideStore") - // ] - // ), + Target( name: "SideWidget", platform: .iOS, @@ -61,6 +52,18 @@ let project = Project( .package(product: "AltStoreCore") ] ), + +// Target( +// name: "SideStoreTests", +// platform: .iOS, +// product: .unitTests, +// bundleId: "com.SideStore.SideStoreTests", +// infoPlist: "Info.plist", +// sources: ["SideStoreApp/Tests/SideStoreAppTests/**"], +// dependencies: [ +// .target(name: "SideStore") +// ] +// ), // Target( // name: "SideStore", // platform: .tvOS, diff --git a/SideStore.xcodeproj/project.pbxproj b/SideStore.xcodeproj/project.pbxproj index 0f02677a..43d12e7d 100644 --- a/SideStore.xcodeproj/project.pbxproj +++ b/SideStore.xcodeproj/project.pbxproj @@ -7,10 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - B34AFBD529B03235000F318E /* SideStoreAppKit in Frameworks */ = {isa = PBXBuildFile; productRef = B34AFBD429B03235000F318E /* SideStoreAppKit */; }; - B34AFBF829B03251000F318E /* LaunchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B34AFBF629B0324C000F318E /* LaunchViewController.swift */; }; - B34AFBF929B03251000F318E /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B34AFBF729B0324C000F318E /* SceneDelegate.swift */; }; - B34AFBFA29B03251000F318E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B34AFBF529B0324C000F318E /* AppDelegate.swift */; }; B34AFBFB29B03279000F318E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B34AFBE829B0324C000F318E /* Main.storyboard */; }; B34AFBFC29B0327E000F318E /* SettingsHeaderFooterView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B34AFBE329B0324C000F318E /* SettingsHeaderFooterView.xib */; }; B34AFBFD29B0327E000F318E /* BrowseCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B34AFBDD29B0324C000F318E /* BrowseCollectionViewCell.xib */; }; @@ -24,14 +20,9 @@ B34AFC0529B0328D000F318E /* apps.json in Resources */ = {isa = PBXBuildFile; fileRef = B34AFBED29B0324C000F318E /* apps.json */; }; B34AFC0629B0328D000F318E /* apps-alpha.json in Resources */ = {isa = PBXBuildFile; fileRef = B34AFBEE29B0324C000F318E /* apps-alpha.json */; }; B34AFC0729B03291000F318E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B34AFBF229B0324C000F318E /* Assets.xcassets */; }; - B34AFC1129B032DF000F318E /* Countdown.swift in Sources */ = {isa = PBXBuildFile; fileRef = B34AFC0929B032DF000F318E /* Countdown.swift */; }; - B34AFC1229B032DF000F318E /* ComplicationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B34AFC0A29B032DF000F318E /* ComplicationView.swift */; }; - B34AFC1329B032DF000F318E /* WidgetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B34AFC0B29B032DF000F318E /* WidgetView.swift */; }; B34AFC1429B032DF000F318E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B34AFC0D29B032DF000F318E /* Assets.xcassets */; }; - B34AFC1629B032DF000F318E /* SideWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = B34AFC1029B032DF000F318E /* SideWidget.swift */; }; - B34BA8E629B0FE8D0055A710 /* AppDelegate+BackgroundFetch.swift in Sources */ = {isa = PBXBuildFile; fileRef = B34BA8E529B0FE8D0055A710 /* AppDelegate+BackgroundFetch.swift */; }; - B34BA8EC29B332FF0055A710 /* SideStoreAppKit in Frameworks */ = {isa = PBXBuildFile; productRef = B34BA8EB29B332FF0055A710 /* SideStoreAppKit */; }; - B3C40F5229B05B4200C93D50 /* SideWidget in Frameworks */ = {isa = PBXBuildFile; productRef = B3C40F5129B05B4200C93D50 /* SideWidget */; }; + B34BA8EE29B3432C0055A710 /* SideStore in Frameworks */ = {isa = PBXBuildFile; productRef = B34BA8ED29B3432C0055A710 /* SideStore */; }; + B34BA92829B5ED510055A710 /* SideWidgetExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = BF989167250AABF3002ACF50 /* SideWidgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; B3C40F5329B06A0000C93D50 /* PatchApp.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B34AFBD929B0324C000F318E /* PatchApp.storyboard */; }; B3C40F5429B06A2B00C93D50 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B34AFBE629B0324C000F318E /* LaunchScreen.storyboard */; }; B3C40F5529B06A3200C93D50 /* Authentication.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B34AFBDA29B0324C000F318E /* Authentication.storyboard */; }; @@ -39,7 +30,28 @@ D533E8B72727841800A9B5DD /* libAppleArchive.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D533E8B62727841800A9B5DD /* libAppleArchive.tbd */; settings = {ATTRIBUTES = (Weak, ); }; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + B34BA92929B5ED510055A710 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFD247622284B9A500981D42 /* Project object */; + proxyType = 1; + remoteGlobalIDString = BF989166250AABF3002ACF50; + remoteInfo = SideWidgetExtension; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXCopyFilesBuildPhase section */ + B34BA92B29B5ED510055A710 /* Embed Foundation Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + B34BA92829B5ED510055A710 /* SideWidgetExtension.appex in Embed Foundation Extensions */, + ); + name = "Embed Foundation Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; BF088D2B2501A087008082D9 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -81,13 +93,9 @@ B34AFBF529B0324C000F318E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; B34AFBF629B0324C000F318E /* LaunchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LaunchViewController.swift; sourceTree = ""; }; B34AFBF729B0324C000F318E /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; - B34AFC0929B032DF000F318E /* Countdown.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Countdown.swift; sourceTree = ""; }; - B34AFC0A29B032DF000F318E /* ComplicationView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ComplicationView.swift; sourceTree = ""; }; - B34AFC0B29B032DF000F318E /* WidgetView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WidgetView.swift; sourceTree = ""; }; B34AFC0D29B032DF000F318E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; B34AFC0E29B032DF000F318E /* SideWidgetExtension.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = SideWidgetExtension.entitlements; sourceTree = ""; }; B34AFC0F29B032DF000F318E /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - B34AFC1029B032DF000F318E /* SideWidget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SideWidget.swift; sourceTree = ""; }; B34AFC1929B04EBB000F318E /* Dangerfile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dangerfile.swift; sourceTree = ""; }; B34AFC1A29B04EBB000F318E /* Project.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Project.swift; sourceTree = ""; }; B34BA8E529B0FE8D0055A710 /* AppDelegate+BackgroundFetch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AppDelegate+BackgroundFetch.swift"; sourceTree = ""; }; @@ -116,8 +124,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - B34BA8EC29B332FF0055A710 /* SideStoreAppKit in Frameworks */, - B3C40F5229B05B4200C93D50 /* SideWidget in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -125,8 +131,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - B34AFBD529B03235000F318E /* SideStoreAppKit in Frameworks */, D533E8B72727841800A9B5DD /* libAppleArchive.tbd in Frameworks */, + B34BA8EE29B3432C0055A710 /* SideStore in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -218,11 +224,7 @@ B34AFC0829B032DF000F318E /* SideWidget */ = { isa = PBXGroup; children = ( - B34AFC0929B032DF000F318E /* Countdown.swift */, - B34AFC0A29B032DF000F318E /* ComplicationView.swift */, - B34AFC0B29B032DF000F318E /* WidgetView.swift */, B34AFC0C29B032DF000F318E /* Resources */, - B34AFC1029B032DF000F318E /* SideWidget.swift */, ); name = SideWidget; path = SideStoreApp/Sources/SideWidget; @@ -319,8 +321,6 @@ ); name = SideWidgetExtension; packageProductDependencies = ( - B3C40F5129B05B4200C93D50 /* SideWidget */, - B34BA8EB29B332FF0055A710 /* SideStoreAppKit */, ); productName = AltWidgetExtension; productReference = BF989167250AABF3002ACF50 /* SideWidgetExtension.appex */; @@ -334,14 +334,16 @@ BFD247672284B9A500981D42 /* Frameworks */, BFD247682284B9A500981D42 /* Resources */, BF088D2B2501A087008082D9 /* Embed Frameworks */, + B34BA92B29B5ED510055A710 /* Embed Foundation Extensions */, ); buildRules = ( ); dependencies = ( + B34BA92A29B5ED510055A710 /* PBXTargetDependency */, ); name = SideStore; packageProductDependencies = ( - B34AFBD429B03235000F318E /* SideStoreAppKit */, + B34BA8ED29B3432C0055A710 /* SideStore */, ); productName = AltStore; productReference = BFD2476A2284B9A500981D42 /* SideStore.app */; @@ -437,10 +439,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - B34AFC1629B032DF000F318E /* SideWidget.swift in Sources */, - B34AFC1329B032DF000F318E /* WidgetView.swift in Sources */, - B34AFC1229B032DF000F318E /* ComplicationView.swift in Sources */, - B34AFC1129B032DF000F318E /* Countdown.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -448,15 +446,19 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - B34AFBFA29B03251000F318E /* AppDelegate.swift in Sources */, - B34AFBF829B03251000F318E /* LaunchViewController.swift in Sources */, - B34AFBF929B03251000F318E /* SceneDelegate.swift in Sources */, - B34BA8E629B0FE8D0055A710 /* AppDelegate+BackgroundFetch.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + B34BA92A29B5ED510055A710 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = BF989166250AABF3002ACF50 /* SideWidgetExtension */; + targetProxy = B34BA92929B5ED510055A710 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ B34AFBE629B0324C000F318E /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; @@ -493,7 +495,6 @@ DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)"; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = SideStoreApp/Sources/SideWidget/Resources/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -523,7 +524,6 @@ DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)"; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = SideStoreApp/Sources/SideWidget/Resources/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -541,6 +541,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = B3C39607284F4C8400DA9E2F /* Build.xcconfig */; buildSettings = { + ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES; ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; @@ -590,7 +591,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.2; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; MACOSX_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -599,11 +600,13 @@ "$(OTHER_CFLAGS)", "-Wno-module-import-in-extern-c", ); - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos"; + SUPPORTS_MACCATALYST = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG BETA"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SYSTEM_HEADER_SEARCH_PATHS = "\"$(SRCROOT)/Dependencies/AltSign/Dependencies\""; + TVOS_DEPLOYMENT_TARGET = 14.2; }; name = Debug; }; @@ -611,6 +614,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = B3C39607284F4C8400DA9E2F /* Build.xcconfig */; buildSettings = { + ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES; ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; @@ -654,7 +658,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.2; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; MACOSX_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -662,12 +666,14 @@ "$(OTHER_CFLAGS)", "-Wno-module-import-in-extern-c", ); - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos"; + SUPPORTS_MACCATALYST = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG BETA"; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; SYSTEM_HEADER_SEARCH_PATHS = "\"$(SRCROOT)/Dependencies/AltSign/Dependencies\""; + TVOS_DEPLOYMENT_TARGET = 14.2; VALIDATE_PRODUCT = YES; }; name = Release; @@ -684,7 +690,6 @@ DEVELOPMENT_TEAM = S32Z3HMYVQ; ENABLE_BITCODE = NO; INFOPLIST_FILE = SideStoreApp/Sources/SideStore/Resources/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -693,7 +698,6 @@ PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER)"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -712,7 +716,6 @@ DEVELOPMENT_TEAM = S32Z3HMYVQ; ENABLE_BITCODE = NO; INFOPLIST_FILE = SideStoreApp/Sources/SideStore/Resources/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -721,7 +724,6 @@ PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_BUNDLE_IDENTIFIER)"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -760,17 +762,9 @@ /* End XCConfigurationList section */ /* Begin XCSwiftPackageProductDependency section */ - B34AFBD429B03235000F318E /* SideStoreAppKit */ = { + B34BA8ED29B3432C0055A710 /* SideStore */ = { isa = XCSwiftPackageProductDependency; - productName = SideStoreAppKit; - }; - B34BA8EB29B332FF0055A710 /* SideStoreAppKit */ = { - isa = XCSwiftPackageProductDependency; - productName = SideStoreAppKit; - }; - B3C40F5129B05B4200C93D50 /* SideWidget */ = { - isa = XCSwiftPackageProductDependency; - productName = SideWidget; + productName = SideStore; }; /* End XCSwiftPackageProductDependency section */ }; diff --git a/SideStore.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/SideStore.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 77024429..c20ecf4c 100644 --- a/SideStore.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/SideStore.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,14 +1,5 @@ { "pins" : [ - { - "identity" : "aexml", - "kind" : "remoteSourceControl", - "location" : "https://github.com/tadija/AEXML", - "state" : { - "revision" : "54bb8ea6fb693dd3f92a89e5fcc19e199fdeedd0", - "version" : "4.3.3" - } - }, { "identity" : "altsign", "kind" : "remoteSourceControl", @@ -36,15 +27,6 @@ "revision" : "e754ab1c80920dd51a8e08290c912ac1c2ac8b58" } }, - { - "identity" : "ignore", - "kind" : "remoteSourceControl", - "location" : "https://github.com/IgorMuzyka/ignore", - "state" : { - "revision" : "49780cf3d46053eb40f4c425a46aaaf662f0665c", - "version" : "0.0.2" - } - }, { "identity" : "imobiledevice.swift", "kind" : "remoteSourceControl", @@ -54,15 +36,6 @@ "version" : "1.0.5" } }, - { - "identity" : "infomaticplugin", - "kind" : "remoteSourceControl", - "location" : "https://github.com/elegantchaos/InfomaticPlugin.git", - "state" : { - "branch" : "main", - "revision" : "735c0f1431f65977fcb3f808b74f6eeb728183ef" - } - }, { "identity" : "keychainaccess", "kind" : "remoteSourceControl", @@ -73,12 +46,12 @@ } }, { - "identity" : "logger", + "identity" : "launchatlogin", "kind" : "remoteSourceControl", - "location" : "https://github.com/f-meloni/Logger", + "location" : "https://github.com/sindresorhus/LaunchAtLogin.git", "state" : { - "revision" : "53c3ecca5abe8cf46697e33901ee774236d94cce", - "version" : "0.2.3" + "revision" : "7ad6331f9c38953eb1ce8737758e18f7607e984a", + "version" : "5.0.0" } }, { @@ -108,33 +81,6 @@ "version" : "1.1.2000" } }, - { - "identity" : "packagebuildinfo", - "kind" : "remoteSourceControl", - "location" : "https://github.com/DimaRU/PackageBuildInfo", - "state" : { - "branch" : "master", - "revision" : "7fe63ad12b50bad5d86e6abaef5a944f931ce765" - } - }, - { - "identity" : "packageconfig", - "kind" : "remoteSourceControl", - "location" : "https://github.com/orta/PackageConfig.git", - "state" : { - "revision" : "bf90dc69fa0792894b08a0b74cf34029694ae486", - "version" : "0.13.0" - } - }, - { - "identity" : "pathkit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/kylef/PathKit", - "state" : { - "revision" : "e2f5be30e4c8f531c9c1e8765aa7b71c0a45d7a0", - "version" : "0.9.2" - } - }, { "identity" : "plcrashreporter", "kind" : "remoteSourceControl", @@ -162,15 +108,6 @@ "version" : "1.3.2" } }, - { - "identity" : "secretsmanager", - "kind" : "remoteSourceControl", - "location" : "https://github.com/vdka/SecretsManager.git", - "state" : { - "revision" : "7e7eb0304726a2d9788432a3b90d79817ce2f6e1", - "version" : "1.1.1" - } - }, { "identity" : "semanticversion", "kind" : "remoteSourceControl", @@ -189,60 +126,6 @@ "version" : "0.1.0" } }, - { - "identity" : "spectre", - "kind" : "remoteSourceControl", - "location" : "https://github.com/kylef/Spectre.git", - "state" : { - "revision" : "f79d4ecbf8bc4e1579fbd86c3e1d652fb6876c53", - "version" : "0.9.2" - } - }, - { - "identity" : "swift-argument-parser", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-argument-parser", - "state" : { - "revision" : "fee6933f37fde9a5e12a1e4aeaa93fe60116ff2a", - "version" : "1.2.2" - } - }, - { - "identity" : "swift-docc-plugin", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-docc-plugin", - "state" : { - "revision" : "10bc670db657d11bdd561e07de30a9041311b2b1", - "version" : "1.1.0" - } - }, - { - "identity" : "swift-docc-symbolkit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-docc-symbolkit", - "state" : { - "revision" : "b45d1f2ed151d057b54504d653e0da5552844e34", - "version" : "1.0.0" - } - }, - { - "identity" : "swift-secret-keys", - "kind" : "remoteSourceControl", - "location" : "https://github.com/simorgh3196/swift-secret-keys", - "state" : { - "revision" : "d156d039bea258466a2bbc0046936867db1a0915", - "version" : "0.1.0" - } - }, - { - "identity" : "swiftlintplugin", - "kind" : "remoteSourceControl", - "location" : "https://github.com/lukepistrol/SwiftLintPlugin", - "state" : { - "revision" : "f69b412a765396d44dc9f4788a5b79919c1ca9e3", - "version" : "0.2.2" - } - }, { "identity" : "swiftpmplugins", "kind" : "remoteSourceControl", @@ -252,15 +135,6 @@ "version" : "1.0.0" } }, - { - "identity" : "swiftshell", - "kind" : "remoteSourceControl", - "location" : "https://github.com/kareman/SwiftShell", - "state" : { - "revision" : "beebe43c986d89ea5359ac3adcb42dac94e5e08a", - "version" : "4.1.2" - } - }, { "identity" : "versionator", "kind" : "remoteSourceControl", @@ -270,15 +144,6 @@ "version" : "1.0.3" } }, - { - "identity" : "xcodeproj", - "kind" : "remoteSourceControl", - "location" : "https://github.com/tuist/xcodeproj.git", - "state" : { - "revision" : "065f348754b6155b8037dc43876a8f2ee354b95d", - "version" : "6.7.0" - } - }, { "identity" : "xctestextensions", "kind" : "remoteSourceControl", @@ -287,15 +152,6 @@ "revision" : "39694671be8bea1ab0bbd87114705b2a92567a8e", "version" : "1.5.0" } - }, - { - "identity" : "yams", - "kind" : "remoteSourceControl", - "location" : "https://github.com/jpsim/Yams", - "state" : { - "revision" : "f47ba4838c30dbd59998a4e4c87ab620ff959e8a", - "version" : "5.0.5" - } } ], "version" : 2 diff --git a/SideStore.xcodeproj/xcshareddata/xcschemes/SideStore.xcscheme b/SideStore.xcodeproj/xcshareddata/xcschemes/SideStore.xcscheme new file mode 100644 index 00000000..a6de546f --- /dev/null +++ b/SideStore.xcodeproj/xcshareddata/xcschemes/SideStore.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SideStore.xcodeproj/xcshareddata/xcschemes/SideWidgetExtension.xcscheme b/SideStore.xcodeproj/xcshareddata/xcschemes/SideWidgetExtension.xcscheme new file mode 100644 index 00000000..e899a4ac --- /dev/null +++ b/SideStore.xcodeproj/xcshareddata/xcschemes/SideWidgetExtension.xcscheme @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SideStoreApp/.env b/SideStoreApp/.env new file mode 100644 index 00000000..e69de29b diff --git a/SideStoreApp/Package.swift b/SideStoreApp/Package.swift index 202e4c9a..8aa8f04b 100644 --- a/SideStoreApp/Package.swift +++ b/SideStoreApp/Package.swift @@ -5,553 +5,629 @@ import Foundation import os.log import PackageDescription -let env: [String: Bool] = [ - "USE_CARGO": false, - "USE_CXX_INTEROP": false, - "USE_CXX_MODULES": false, - "INHIBIT_UPSTREAM_WARNINGS": true, - "STATIC_LIBRARY": false, -] +// Process enviroment variables. +typealias EnviromentBool = (var: String, default: Bool) -let USE_CARGO = envBool("USE_CARGO") -let USE_CXX_INTEROP = envBool("USE_CXX_INTEROP") -let USE_CXX_MODULES = envBool("USE_CXX_MODULES") -let INHIBIT_UPSTREAM_WARNINGS = envBool("INHIBIT_UPSTREAM_WARNINGS") -let STATIC_LIBRARY = envBool("STATIC_LIBRARY") +// Possible keys for `env` and their default value +let USE_CARGO = envBool(("USE_CARGO", false)) +let USE_CXX_INTEROP = envBool(("USE_CXX_INTEROP", false)) +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"] : - [] let unsafe_flags_cxx: [String] = INHIBIT_UPSTREAM_WARNINGS ? - ["-w", "-Wno-module-import-in-extern-c"] : - ["-Wno-module-import-in-extern-c"] +["-w", "-Wno-module-import-in-extern-c"] : +["-Wno-module-import-in-extern-c"] -let dependencies: [Package.Dependency] = [ +extension Package.Dependency { + /// The combination of all the dependencies for the Package. + enum SideStore { + static let dependencies: [Package.Dependency] = + Packages_SideStoreTeam + + Packages_3rdParty + + Plugins_BuildTools + + Plugins_CICD + } - // Side Store - .package(url: "https://github.com/SideStore/AltSign", from: "1.0.3"), - .package(url: "https://github.com/SideStore/iMobileDevice.swift", from: "1.0.5"), - .package(url: "https://github.com/SideStore/SideKit", from: "0.1.0"), + /// Side Store Team Packages + static let Packages_SideStoreTeam: [Package.Dependency] = [ + .github("SideStore/AltSign", from: "1.0.3"), + .github("SideStore/iMobileDevice.swift", from: "1.0.5"), + .github("SideStore/SideKit", from: "0.1.0"), + /// @JoeMatt updated fork for Riley's Roxas + .github("JoeMatt/Roxas", from: "1.2.2"), + ] - // JoeMatt - .package(url: "https://github.com/JoeMatt/Roxas", from: "1.2.2"), + /// 3rd party Packages + static let Packages_3rdParty: [Package.Dependency] = [ + .github("SwiftPackageIndex/SemanticVersion", from: "0.3.5"), + .github("johnxnguyen/Down", branch: "master"), + .github("kean/Nuke", from: "7.0.0"), + .github("kishikawakatsumi/KeychainAccess", from: "4.2.0"), + .github("microsoft/appcenter-sdk-apple", from: "4.2.0"), + .github("sindresorhus/LaunchAtLogin", from: "5.0.0"), + ] - // 3rd Party - .package(url: "https://github.com/johnxnguyen/Down", branch: "master"), - .package(url: "https://github.com/kean/Nuke", from: "7.0.0"), - .package(url: "https://github.com/kishikawakatsumi/KeychainAccess", from: "4.2.0"), - .package(url: "https://github.com/microsoft/appcenter-sdk-apple", from: "4.2.0"), - .package(url: "https://github.com/SwiftPackageIndex/SemanticVersion", from: "0.3.5"), + static let Plugins_BuildTools: [Package.Dependency] = [ + // Plugins + /// IntentBuilder for spm support of intents and Logger injection + .github("JoeMatt/SwiftPMPlugins", from: "1.0.0"), - // Plugins - // IntentBuilder for spm support of intents and Logger injection - .package(url: "https://github.com/JoeMatt/SwiftPMPlugins.git", .upToNextMinor(from: "1.0.0")), - // Generate swift files with git head info - .package(url: "https://github.com/elegantchaos/Versionator.git", from: "1.0.3"), - // plists from .json, including Info.plist - .package(url: "https://github.com/elegantchaos/InfomaticPlugin.git", branch: "main"), - // Swiftlint - .package(url: "https://github.com/lukepistrol/SwiftLintPlugin", from: "0.2.2"), - // git secrets from env (for adding sensative api keys via CI/CD, - // `swift package plugin --allow-writing-to-package-directory secret-keys generate` - // or `mint run secret-keys generate` - .package(url: "https://github.com/simorgh3196/swift-secret-keys", from: "0.0.1"), - // Swift docc generator - // `swift package generate-documentation` to call - // or inline creation - // `swift package --allow-writing-to-directory ./docs \ - // generate-documentation --target MyFramework --output-path ./docs` - // to preview: - // `swift package --disable-sandbox preview-documentation --target MyFramework - // Hosting https://apple.github.io/swift-docc-plugin/documentation/swiftdoccplugin/ - .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.1.0"), + /// Generate swift files with git head info + .github("elegantchaos/Versionator", from: "1.0.3"), - // Generate compile time checked URLs - // This will compile - // let validUrl = URL(safeString: "https://example.tld") - // This won't - // let invalidUrl = URL(safeString: "https://example./tld") -// .package(url: "https://github.com/JoeMatt/SwiftSafeURL", branch: "main"),//from: "0.4.2"), + /// plists from .json, including Info.plist + .github("elegantchaos/InfomaticPlugin", branch: "main").disable + ]-? + static let Plugins_CICD: [Package.Dependency] = [ + /// Swiftlint + .github("lukepistrol/SwiftLintPlugin", from: "0.2.2").disable, + + /// git secrets from env (for adding sensative api keys via CI/CD, + /// ```sh + /// swift package plugin --allow-writing-to-package-directory secret-keys generate + /// ``` + /// or using Mint + /// ```sh + /// mint run secret-keys generate + /// ``` + .github("simorgh3196/swift-secret-keys", from: "0.0.1").disable, + + /// #__ Swift docc generator __ + /// `swift package generate-documentation` + /// ## Inline creation + /// ```sh + /// swift package \ + /// --allow-writing-to-directory ./docs \ + /// generate-documentation \ + /// --target MyFramework \ + /// --output-path ./docs + /// ``` + /// ## 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, + ]-? + + #if USE_RESULT_BUILDER + // TODO: Make a DSL using a @resultBuilder + @DependencyBuilder + static var Additional_Plugins: [Package.Dependency] { // Secrets manager using `.env` - .package(url: "https://github.com/vdka/SecretsManager.git", from: "1.0.0"), + github("vdka/SecretsManager.git", from: "1.0.0") // Generate `PackageBuild` struct with build time info about repo - .package(url: "https://github.com/DimaRU/PackageBuildInfo", branch: "master"), + github("DimaRU/PackageBuildInfo", branch: "master") - /* - // Plugin for simply updating your Package.swift file consistently and understandably. - .package(url: "https://github.com/mackoj/PackageGeneratorPlugin.git", from: "0.3.0"), - // Plugin for quickly updating your Schemes files - .package(url: "https://github.com/mackoj/SchemeGeneratorPlugin.git", from: "0.5.5"), - .package(url: "https://github.com/pointfreeco/swift-composable-architecture.git", from: "0.45.0"), - */ + /// Plugin for simply updating your Package.swift file consistently and understandably. + github("mackoj/PackageGeneratorPlugin", from: "0.3.0") + /// Plugin for quickly updating your Schemes files + github("mackoj/SchemeGeneratorPlugin", from: "0.5.5") + github("pointfreeco/swift-composable-architecture", from: "0.45.0") + } + #else + static let Additional_Plugins: [Package.Dependency] = [ + // Secrets manager using `.env` + github("vdka/SecretsManager.git", from: "1.0.0").disable, - // Old style plugins - // `Danger` https://danger.systems/swift/ for CI/CD - // Additinal plugins https://github.com/danger/awesome-danger -// .package(url: "https://github.com/danger/swift.git", from: "3.0.0"), // dev -// .package(url: "https://github.com/f-meloni/danger-swift-coverage", from: "0.1.0") // dev - .package(url: "https://github.com/IgorMuzyka/ignore", from: "0.0.2"), -] // + dependencies_cargo + // Generate `PackageBuild` struct with build time info about repo + github("DimaRU/PackageBuildInfo", branch: "master").disable, + /// Plugin for simply updating your `Package.swift` file consistently and understandably. + github("mackoj/PackageGeneratorPlugin", from: "0.3.0").disable, + + /// Plugin for quickly updating your `.xcscheme` files + github("mackoj/SchemeGeneratorPlugin", from: "0.5.5").disable, + github("pointfreeco/swift-composable-architecture", from: "0.45.0").disable + ].removeNils() + #endif +} + +let InfomaticPlugin : Target.PluginUsage = .plugin(name: "InfomaticPlugin", package: "InfomaticPlugin") +let PackageBuildInfoPlugin : Target.PluginUsage = .plugin(name: "PackageBuildInfoPlugin",package: "PackageBuildInfo") +let SafeURLPlugin : Target.PluginUsage = .plugin(name: "SafeURLPlugin", package: "SafeURLPlugin") +let SecretsManagerPlugin : Target.PluginUsage = .plugin(name: "SecretsManagerPlugin", package: "SecretsManager") +let VersionatorPlugin : Target.PluginUsage = .plugin(name: "VersionatorPlugin", package: "Versionator") +let IntentBuilderPlugin : Target.PluginUsage = .plugin(name: "IntentBuilderPlugin", package: "SwiftPMPlugins") +let LoggerPlugin : Target.PluginUsage = .plugin(name: "LoggerPlugin", package: "SwiftPMPlugins") + +let commonPlugins: [Target.PluginUsage] = [LoggerPlugin] + +// MARK: - 3rd Party Dependencies +let AppCenterAnalytics: Target.Dependency = .product(name: "AppCenterAnalytics", package: "appcenter-sdk-apple") +let AppCenterCrashes : Target.Dependency = .product(name: "AppCenterCrashes", package: "appcenter-sdk-apple") +let CoreCrypto : Target.Dependency = .product(name: "CoreCrypto", package: "AltSign") +let CCoreCrypto : Target.Dependency = .product(name: "CCoreCrypto", package: "AltSign") +let libimobiledevice: Target.Dependency = .product(name: "libimobiledevice", package: "iMobileDevice.swift") +let Roxas : Target.Dependency = .product(name: "Roxas", package: "Roxas") +let RoxasUI : Target.Dependency = .product(name: "RoxasUI", package: "Roxas") + +// MARK: - Linking +let frameworksCommon: [LinkerSetting] = [ "Avfoundation", + "CoreData", + "Combine", + "Network", + "UniformTypeIdentifiers" ].map{LinkerSetting.linkedFramework($0)} + +let frameworksIOS: [LinkerSetting] = [ + "ARKit", + "AudioToolbox", + "AuthenticationServices", + "CoreHaptics", + "Intents", + "IntentsUI", + "MessageUI", + "MobileCoreServices", + "QuickLook", + "SafariServices", + "UserNotifications", + "WidgetKit" +] + .map{LinkerSetting.linkedFramework($0, + .when(platforms: [.iOS, .macCatalyst]))} + +// MARK: -- PACKAGE -- let package = Package( - name: "SideStore", - defaultLocalization: "en", - platforms: [ - .iOS(.v14), - .tvOS(.v14), - .macCatalyst(.v14), - .macOS(.v12), - ], + name: "SideStore", + defaultLocalization: "en", + platforms: [ + .iOS(.v14), + .tvOS(.v14), + .macCatalyst(.v14), + .macOS(.v12), + ], + products: Product.products, + dependencies: Package.Dependency.SideStore.dependencies, + targets: Target.SideStore.targets, + swiftLanguageVersions: [.v5], + cLanguageStandard: .gnu11, + cxxLanguageStandard: .gnucxx14 +) - products: [ - // SideWidget Executable - .executable( - name: "SideStore", - targets: ["SideStore"] - ), +// ---------------- +// MARK: - Products +// ---------------- +extension Product { + static let products: [Product] = [ + // Modules + SideStoreAppKit.0, + SideStoreAppKit.static, + SideStoreAppKit.dynamic, + SideStoreCore.0, + SideStoreCore.static, + SideStoreCore.dynamic, + + SideWidgetKit.0, + SideWidgetKit.static, + SideWidgetKit.dynamic, + + // `.app` Executables + SideStore_app, + ] + + // CLI Executables + static let cliProducts: [Product] = [ + SideDaemon + ] + + // SideStoreAppKit + static let SideStoreAppKit = librarySet("SideStoreAppKit") + + // SideStoreCore + static let SideStoreCore = librarySet("SideStoreCore") + + // SideWidgetKit + static let SideWidgetKit = librarySet("SideWidgetKit") + + // SideStore Executable + static let SideStore_app: Product = .executable( name: "SideStore", targets: ["SideStore"]) + + // SideDaemon Executable + static let SideDaemon : Product = .executable(name: "SideDaemon", targets: ["SideDaemon"]) + + #if USE_CARGO_BUILD_PLUGIN + // Cargo Plugin (WIP) + static let CargoPlugin: Product = .plugin(name: "CargoPlugin", targets: ["CargoPlugin"]) + #endif +} + + +// ---------------- +// MARK: - Targets +// ---------------- + +extension Target { + enum SideStore { //: Encodable, CaseIterable { + static let linkerSettings: [LinkerSetting] = frameworksCommon + frameworksIOS + [ + .linkedFramework("UIKit", .when(platforms: [.iOS, .macCatalyst, .tvOS])), + .linkedLibrary("AppleArchive") + ] + } +} +typealias TargetPair = (target: PackageDescription.Target, testTarget: PackageDescription.Target?) + +// MARK: - SideStoreAppKit +extension Target.SideStore { + + /// All the targets fo be added to `Package(targets:)` + static let targets: [Target] = publicTargets + Internal.targets + pluginTargets + + /// __Public Targets__ + static let publicTargets: [Target] = [ // SideStoreAppKit - .library( - name: "SideStoreAppKit", - targets: ["SideStoreAppKit"]), + SideStoreAppKit, - .library( - name: "SideStoreAppKit-Static", - type: .static, - targets: ["SideStoreAppKit"]), - - .library( - name: "SideStoreAppKit-Dynamic", - type: .dynamic, - targets: ["SideStoreAppKit"]), + // iOS Widget + SideWidgetKit, // SideStoreCore - .library( - name: "SideStoreCore", - targets: ["SideStoreCore"]), + SideStoreCore.target, + SideStoreCore.testTarget, - .library( - name: "SideStoreCore-Static", - type: .static, - targets: ["SideStoreCore"]), + // SideBackup Executable + SideBackup, - .library( - name: "SideStoreCore-Dynamic", - type: .dynamic, - targets: ["SideStoreCore"]), + // SideDaemon + SideDaemon.target, + SideDaemon.testTarget, - // WidgetKit - .library( - name: "SideWidget", - targets: ["SideWidget"]), + // SidePatcher + SidePatcher.target, + SidePatcher.testTarget, - .library( - name: "SideWidget-Static", - type: .static, - targets: ["SideWidget"]), + // App Bundle + Apps.SideStore_app, + ].compactMap{$0} - .library( - name: "SideWidget-Dynamic", - type: .dynamic, - targets: ["SideWidget"]), + /// __PluginTargets__ + static let pluginTargets: [Target] = { + #if USE_CARGO_BUILD_PLUGIN + Cargo.Plugins + #else + [] + #endif + }() - // Plugins - .plugin(name: "CargoPlugin", targets: ["CargoPlugin"]), - ], - - dependencies: dependencies, - targets: [ - // MARK: - SideStore - - .executableTarget( - name: "SideStore", - dependencies: [ - "SideStoreAppKit", - "SidePatcher", - "EmotionalDamage", - "MiniMuxerSwift", - "SideStoreCore", - "Shared", - "Nuke", - "Down", - "AltSign", - "SideKit", + // MARK: - SideStoreAppKit + static let SideStoreAppKit: Target = + .target( + name: "SideStoreAppKit", + dependencies: [ + "AltSign", + "Down", + "EmotionalDamage", "KeychainAccess", - "SemanticVersion", - .product(name: "libimobiledevice", package: "iMobileDevice.swift"), - .product(name: "Roxas", package: "Roxas"), - .product(name: "RoxasUI", package: "Roxas"), - .product(name: "AppCenterAnalytics", package: "appcenter-sdk-apple"), - .product(name: "AppCenterCrashes", package: "appcenter-sdk-apple"), - ], + libimobiledevice, + "MiniMuxer", + "Nuke", + Roxas, + RoxasUI, + "SideKit", + "SidePatcher", + "SideStoreCore", + ], + resources: [], + linkerSettings: linkerSettings, + plugins: [LoggerPlugin, IntentBuilderPlugin] + ) + + // MARK: - SideWidgetKit + static let SideWidgetKit: Target = + .target( + name: "SideWidgetKit", + dependencies: [ + "SideKit", + "SideStoreAppKit", + "SideStoreCore" + ], + plugins: commonPlugins + ) + + // MARK: - SideStoreCore + static let SideStoreCore: TargetPair = ( + .target( + name: "SideStoreCore", + dependencies: [ + "AltSign", + "KeychainAccess", + Roxas, + "SemanticVersion"], + plugins: commonPlugins), + .testTarget( + name: "SideStoreCoreTests", + dependencies: ["SideStoreCore", "KeychainAccess", "AltSign", "SemanticVersion", "SideKit"])) + + // MARK: - SideDaemon + static let SideDaemon: TargetPair = ( + .executableTarget( + name: "SideDaemon", + dependencies: [ + "AltSign", + "SideKit", + CoreCrypto, + CCoreCrypto, + .product(name: "LaunchAtLogin", package: "LaunchAtLogin"), + ], + plugins: commonPlugins + ), + .testTarget(name: "SideDaemonTests", dependencies: ["SideDaemon"])) + + // MARK: - SideBackup + static let SideBackup: Target = + .executableTarget(name: "SideBackup", plugins: commonPlugins) + + // MARK: - SidePatcher + static let SidePatcher: TargetPair = ( + .target(name: "SidePatcher", dependencies: [ RoxasUI ], plugins: commonPlugins), + .testTarget(name: "SidePatcherTests", dependencies: ["SidePatcher"])) +} + +// MARK: -- .app Targets + +/// This seems to be a new feature for XCode 14.3 beta. +/// `PackageDescription.ProductSetting` has no developer documentation +/// though there's probably info on swift-lang.org +extension Target.SideStore { + // MARK: - SideStore.app + enum Apps: Encodable, CaseIterable { + case _apps(Target) + + static var allCases: [Apps] = [_apps(SideStore_app)] + + static let SideStore_app: Target = .executableTarget( + name: "SideStore", + dependencies: [ "SideStoreAppKit" ], exclude: [ - "Resources/Info.plist", "Resources/AltBackup.ipa", "Resources/Info.info", "Resources/Info.plist", + "Resources/SideStore.entitlements", "Resources/tempEnt.plist", ], resources: [ - .process("Resources/XIB"), - .process("Resources/Storyboards"), - .process("Resources/Base.lproj"), - .process("Resources/Assets"), - .process("Resources/Sounds"), - .process("Resources/Settings.bundle"), .copy("Resources/JSON/apps-alpha.json"), - .copy("Resources/JSON/apps.json") + .copy("Resources/JSON/apps.json"), + .process("Resources/Assets"), + .process("Resources/Base.lproj"), + .process("Resources/Settings.bundle"), + .process("Resources/Sounds"), + .process("Resources/Storyboards"), + .process("Resources/XIB") ], - linkerSettings: [ - .linkedFramework("UIKit", .when(platforms: [.iOS, .macCatalyst, .tvOS])), - .linkedFramework("Avfoundation"), - .linkedFramework("Combine"), - .linkedFramework("Network"), - .linkedFramework("CoreData"), - .linkedFramework("UniformTypeIdentifiers"), - .linkedFramework("QuickLook", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("AuthenticationServices", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("SafariServices", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("Intents", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("IntentsUI", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("MessageUI", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("ARKit", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("CoreHaptics", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("AudioToolbox", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("WidgetKit", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("UserNotifications", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("MobileCoreServiceGits", .when(platforms: [.iOS, .macCatalyst])), - .linkedLibrary("AppleArchive") - ], - plugins: [ - .plugin(name: "IntentBuilderPlugin", package: "SwiftPMPlugins"), - .plugin(name: "LoggerPlugin", package: "SwiftPMPlugins"), - .plugin(name: "InfomaticPlugin", package: "InfomaticPlugin"), - .plugin(name: "PackageBuildInfoPlugin", package: "PackageBuildInfo"), - .plugin(name: "SecretsManagerPlugin", package: "SecretsManager"), -// .plugin(name: "SafeURLPlugin", package: "SafeURLPlugin"), -// .plugin(name: "VersionatorPlugin", package: "Versionator"), - ] - ), + linkerSettings: linkerSettings, + plugins: commonPlugins + ) - .target( - name: "SideStoreAppKit", - dependencies: [ - "SidePatcher", - "EmotionalDamage", - "MiniMuxerSwift", - "SideStoreCore", - "Shared", - "Nuke", - "Down", - "AltSign", - "SideKit", - "KeychainAccess", - .product(name: "libimobiledevice", package: "iMobileDevice.swift"), - .product(name: "CCoreCrypto", package: "AltSign"), - .product(name: "Roxas", package: "Roxas"), - .product(name: "RoxasUI", package: "Roxas"), - .product(name: "AppCenterAnalytics", package: "appcenter-sdk-apple"), - .product(name: "AppCenterCrashes", package: "appcenter-sdk-apple"), - ], - resources: [ - ], - linkerSettings: [ - .linkedFramework("UIKit", .when(platforms: [.iOS, .macCatalyst, .tvOS])), - .linkedFramework("Avfoundation"), - .linkedFramework("Combine"), - .linkedFramework("Network"), - .linkedFramework("CoreData"), - .linkedFramework("UniformTypeIdentifiers"), - .linkedFramework("QuickLook", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("AuthenticationServices", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("SafariServices", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("Intents", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("IntentsUI", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("MessageUI", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("ARKit", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("CoreHaptics", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("AudioToolbox", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("WidgetKit", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("UserNotifications", .when(platforms: [.iOS, .macCatalyst])), - .linkedFramework("MobileCoreServices", .when(platforms: [.iOS, .macCatalyst])), - .linkedLibrary("AppleArchive") - ], - plugins: [ - .plugin(name: "IntentBuilderPlugin", package: "SwiftPMPlugins"), - .plugin(name: "LoggerPlugin", package: "SwiftPMPlugins"), -// .plugin(name: "SafeURLPlugin", package: "SafeURLPlugin"), - ] - ), +#if false + static let productSettings: [PackageDescription.ProductSetting] = [ + .bundleIdentifier(""), + .bundleVersion(""), + .displayVersion(""), + .teamIdentifier(""), + .iOSAppInfo( + .init( + appIcon: .asset("AppIcon"), + accentColor: .asset("SettingsHighlighted"), + supportedDeviceFamilies: [.phone, .mac], + supportedInterfaceOrientations: [ + .portrait, + .landscapeLeft(.when(deviceFamilies: [.mac, .pad])), + .landscapeRight(.when(deviceFamilies: [.mac, .pad])) + ], + capabilities: [ + .appTransportSecurity(configuration: + .init( - // MARK: - SideWidget + )), + .fileAccess(.userSelectedFiles, mode: .readOnly), + .fileAccess(.downloadsFolder, mode: .readOnly), + .incomingNetworkConnections(.when(deviceFamilies: [.mac, .pad, .phone])), + .localNetwork(purposeString: "", bonjourServiceTypes: ["_altserver._tcp"]), + .outgoingNetworkConnections(), + //.bluetoothAlways(purposeString: ""), + //.calendars(purposeString: ""), + //.camera(purposeString: ""), + //.contacts(purposeString: ""), + //.faceID(purposeString: ""), + //.locationAlwaysAndWhenInUse(purposeString: ""), + ], + appCategory: .developerTools, + additionalInfoPlistContentFilePath: "Resources/Info.info") + ) + ] +#endif + } - .target( - name: "SideWidget", - dependencies: [ - "SideStoreAppKit", - "Shared", - "SideStoreCore", - "AltSign", - "SideKit", - "SemanticVersion", - "KeychainAccess", - .product(name: "RoxasUI", package: "Roxas"), - .product(name: "CCoreCrypto", package: "AltSign"), - ], - exclude: [ - "Resources/Info.plist", - "Resources/SideWidgetExtension.entitlements", - ], - plugins: [ - .plugin(name: "IntentBuilderPlugin", package: "SwiftPMPlugins"), - .plugin(name: "LoggerPlugin", package: "SwiftPMPlugins") - ] - ), +} - // MARK: - EmotionalDamage +// MARK: -- Internal Targets +extension Target.SideStore { + enum Internal: Encodable, CaseIterable { + static var allCases: [PackageDescription.Target.SideStore.Internal] = targets.map{._internal($0)} - .target( - name: "EmotionalDamage", - dependencies: ["em_proxy"] - ), + case _internal(Target) - // For local, run `make zip` -// .binaryTarget( -// name: "em_proxy", -// path: "Dependencies/em_proxy/em_proxy.xcframework.zip" -// ), + // MARK: Internal Targets + static let targets: [Target] = [ + em_proxy_target, - .binaryTarget( - name: "em_proxy", - url: "https://github.com/SideStore/em_proxy/releases/download/build/em_proxy.xcframework.zip", - checksum: "8c745d9fdf121ab33b1007394c283d1a1a74a30efa0a52b22c29b766ea7d6a8e" - ), + emotionalDamageTarget.target, + emotionalDamageTarget.testTarget, - .testTarget( - name: "EmotionalDamageTests", - dependencies: ["EmotionalDamage"] - ), + minimuxer_target, - // MARK: - SidePatcher + miniMuxerSwiftTarget.target, + miniMuxerSwiftTarget.testTarget + ].compactMap{$0} - .target( - name: "SidePatcher", - dependencies: [ - .product(name: "Roxas", package: "Roxas"), - .product(name: "RoxasUI", package: "Roxas"), - ] - ), + // MARK: em_proxy + private static let em_proxy_target: Target = .binaryTarget( + name: "em_proxy", + url: "https://github.com/SideStore/em_proxy/releases/download/build/em_proxy.xcframework.zip", + checksum: "79f90075b8ff2f47540a5bccf5fb7740905cda63463f833e2505256237df3c1b") - .testTarget( - name: "SidePatcherTests", - dependencies: ["SidePatcher"] - ), + // MARK: - EmotionalDamage (Swift) + private static let emotionalDamageTarget: TargetPair = ( + .target(name: "EmotionalDamage", dependencies: ["em_proxy"]), + .testTarget(name: "EmotionalDamageTests", dependencies: ["EmotionalDamage"])) - // MARK: - MiniMuxer + // MARK: minimuxer + private static let minimuxer_target: Target = + .binaryTarget(name: "minimuxer", + url: "https://github.com/SideStore/minimuxer/releases/download/build/minimuxer.xcframework.zip", + checksum: "aa47182547b60f4f7560bdc0f25ea797c69419765003d16d5039c13b87930ed1") - .target( - name: "MiniMuxerSwift", - dependencies: [ - "minimuxer", - .product(name: "libimobiledevice", package: "iMobileDevice.swift") - ], - plugins: [ - ] - ), - - // For local, run `make zip` -// .binaryTarget( -// name: "minimuxer", -// path: "Dependencies/minimuxer/minimuxer.xcframework.zip" -// ), - - .binaryTarget( - name: "minimuxer", - url: "https://github.com/SideStore/minimuxer/releases/download/build/minimuxer.xcframework.zip", - checksum: "7a5423ad301dacc664ee5141942781f69753346bae148699ea21b1debdc0d3b5" - ), - - .testTarget( - name: "MiniMuxerTests", - dependencies: [ - "MiniMuxerSwift", - .product(name: "libimobiledevice", package: "iMobileDevice.swift") - ] - ), - - // MARK: - Shared - - .target( - name: "Shared", - dependencies: [ - "SideKit", - "AltSign", - .product(name: "CCoreCrypto", package: "AltSign"), - ], - plugins: [ - .plugin(name: "LoggerPlugin", package: "SwiftPMPlugins"), - ] - ), - - .testTarget( - name: "SharedTests", - dependencies: [ - "Shared", - "SideKit", - "AltSign", - ] - ), - - // MARK: - SideBackup - - .executableTarget( - name: "SideBackup", - dependencies: [], - plugins: [ - .plugin(name: "LoggerPlugin", package: "SwiftPMPlugins"), - ] - ), - - - // MARK: - SideStoreCore - - .target( - name: "SideStoreCore", - dependencies: [ - "Shared", - "KeychainAccess", - "AltSign", - "SemanticVersion", - .product(name: "Roxas", package: "Roxas"), - ], - plugins: [ - .plugin(name: "IntentBuilderPlugin", package: "SwiftPMPlugins"), - .plugin(name: "LoggerPlugin", package: "SwiftPMPlugins"), - ] - ), - - .testTarget( - name: "SideStoreCoreTests", - dependencies: [ - "SideStoreCore", - "KeychainAccess", - "AltSign", - "SemanticVersion", - "SideKit" - ] - ), - - // MARK: - Plugins - .plugin(name: "CargoPlugin", capability: .buildTool()), -// .plugin(name: "CargoPlugin-Generate", capability: .command(intent: PluginCommandIntent)), - - .target(name: "PackageConfigs", dependencies: [ - .product(name: "IgnoreConfig", package: "ignore"), - ]) - // MARK: Danger.swift -// .target( -// name: "DangerDependencies", -// dependencies: [ -// .product(name: "Danger", package: "swift"), -// .product(name: "DangerSwiftCoverage", package: "danger-swift-coverage"), -// ]), // dev - - ], - swiftLanguageVersions: [.v5], - cLanguageStandard: .gnu11, - cxxLanguageStandard: .gnucxx14 -) + // MARK: MiniMuxer.Swift + private static let miniMuxerSwiftTarget: TargetPair = ( + .target(name: "MiniMuxer", dependencies: ["minimuxer", libimobiledevice]), + .testTarget(name: "MiniMuxerTests", + dependencies: ["MiniMuxer", libimobiledevice])) + } +} // MARK: - Helpers -func envBool(_ key: String) -> Bool { - guard let value = ProcessInfo.processInfo.environment[key] else { return env[key, default: true] } - let trueValues = ["1", "on", "true", "yes"] - return trueValues.contains(value.lowercased()) +/// Utility function to test if a value of enviroment variable is a representation of `true`, as case-insensative word, letter or digit +/// - Parameter key: A key value from an enviroment variable +/// - Returns: `true` if `1`, "on", "true", or "yes" when `.lowercased()`, or `false` if "off", "false", 0, "no". `.lowercased()` +func envBool(_ key: EnviromentBool) -> Bool { + guard let value = ProcessInfo.processInfo.environment[key.`var`]?.lowercased() else { return key.default } + // We check for the opposite style string to be true + // or return the default. That way a junk string will + // always return the default. + if key.default == true { + // Check if a known 'false' type or return 'true' + let falseValues = ["0", "off", "f", "false", "n", "no"] + return !falseValues.contains(value) + } else { + let trueValues = ["1", "on", "t", "true", "y", "yes"] + return trueValues.contains(value) + } } -#if canImport(IgnoreConfig) -// https://github.com/IgorMuzyka/ignore -// Ignore warnings in Packages -import IgnoreConfig +/// Utility function to generate 3 of the same target with different types` {_, .static, .dynamic}` +/// - Parameter name: Name of your exported library. Must have target of same name. +/// - Returns: `[Product.Library, Product.Library.Static, Product.Library.Dynamic]` +func librarySet(_ name: String) -> (Product, `static`: Product, `dynamic`: Product) {( + .library(name: name, targets: [name]), + .library(name: "\(name)-Static", type: .static, targets: [name]), + .library(name: "\(name)-Dynamic", type: .dynamic, targets: [name]))} -// add the list of targets you wish to preserve the warnings for as excluded -IgnoreConfig(excludedTargets: ["YourMainTarget", "SomeOtherTargetOfYours"]).write() +#if USE_CARGO_BUILD_PLUGIN +enum Cargo: Encodable { + enum Dependencies: Encodable {case _dependencies([Package.Dependency])} + enum Target: Encodable {case _target(Target, test: Target?)} + enum Plugin: Encodable {case _plugin(Target)} + + static let Dependencies: Cargo.Dependencies = [ + .github("apple/swift-argument-parser.git", from: "1.0.3"), + .github("apple/swift-package-manager.git", branch: "release/5.7"), + .github("apple/swift-tools-support-core.git", branch: "release/5.7"), + ] + + static let Executable: (Cargo.Target, test: Cargo.Target?) = ._target( + .executableTarget( + name: "Cargo", + dependencies: [ + .product(name: "ArgumentParser", package: "swift-argument-parser"), + .product(name: "SwiftPM-auto", package: "swift-package-manager"), + .product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core") + ]), + .testTarget( + name: "CargoTests", + dependencies: ["Cargo"], + exclude: [ + "swiftlint", + "xcframework" + ] + )) + + static let Plugins: [Cargo.Plugin] = [ + .plugin( + name: "CargoPlugin", + capability: .buildTool(), + dependencies: [ + "Cargo" + ] + ), + .plugin( + name: "CargoPlugin-Generate", + capability: .command( + intent: .custom( + verb: "generate-code-from-rust", + description: "Creates .c code from your `rust` code" + ), + permissions: [ + .writeToPackageDirectory(reason: "This command generates source code") + ] + ), + dependencies: ["Cargo"] + )].map{._plugin($0)} +} #endif -// MARK: - SideDaemon -// .executable( -// name: "SideDaemon", -// targets: ["SideDaemon"]), -// .executableTarget( -// name: "SideDaemon", -// dependencies: [ -// "Shared", -// .product(name: "SideKit", package: "SideKit"), -// .product(name: "AltSign", package: "AltSign"), -// .product(name: "CoreCrypto", package: "AltSign"), -// .product(name: "CCoreCrypto", package: "AltSign"), -// .product(name: "LaunchAtLogin", package: "LaunchAtLogin"), -// ] -// ), -// -// .testTarget( -// name: "SideDaemonTests", -// dependencies: ["SideDaemon"] -// ), +extension PackageDescription.Package.Dependency { + var disable: PackageDescription.Package.Dependency? { nil } + static func github(_ repo: String, + from: Version) -> PackageDescription.Package.Dependency { + .package(url: "https://github.com/\(repo).git", from: from)} -// let dependencies_cargo: [Package.Dependency] = { -// USE_CARGO ? [ -// // CargoPlugin -// .package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.0.3"), -// .package(url: "https://github.com/apple/swift-package-manager.git", branch: "release/5.7"), -// .package(url: "https://github.com/apple/swift-tools-support-core.git", branch: "release/5.7"), -// ] : [] -// }() + static func github(_ repo: String, + exact: Version) -> PackageDescription.Package.Dependency { + .package(url: "https://github.com/\(repo).git", exact: exact)} -// let cargo_targets: [Target] = [ -// .executableTarget( -// name: "Cargo", -// dependencies: [ -// .product(name: "ArgumentParser", package: "swift-argument-parser"), -// .product(name: "SwiftPM-auto", package: "swift-package-manager"), -// .product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core") -// ] -// ), -// -// .testTarget( -// name: "CargoTests", -// dependencies: ["Cargo"], -// exclude: [ -// "swiftlint", -// "xcframework" -// ] -// ), -// -// .plugin( -// name: "CargoPlugin", -// capability: .buildTool(), -// dependencies: [ -// "Cargo" -// ] -// ), -// -// .plugin( -// name: "CargoPlugin-Generate", -// capability: .command( -// intent: .custom( -// verb: "generate-code-from-rust", -// description: "Creates .c code from your `rust` code" -// ), -// permissions: [ -// .writeToPackageDirectory(reason: "This command generates source code") -// ] -// ), -// dependencies: ["Cargo"] -// ) -// ] + static func github(_ repo: String, + branch: String) -> PackageDescription.Package.Dependency { + .package(url: "https://github.com/\(repo).git", branch: branch)} + + static func github(_ repo: String, + revision: String) -> PackageDescription.Package.Dependency { + .package(url: "https://github.com/\(repo).git", revision: revision)} +} + +postfix operator -? +extension Array where Element == Package.Dependency? { + func removeNils() -> [Package.Dependency] { self.compactMap{$0} } + + static postfix func -? (array: Self) -> [Package.Dependency] { array.removeNils() } +} + +extension Array where Element == Target? { + func removeNils() -> [Target] { self.compactMap{$0} } + + static postfix func -? (array: Self) -> [Target] { array.removeNils() } +} + +@resultBuilder +struct DependencyBuilder { + typealias Component = [Package.Dependency] + typealias Expression = Package.Dependency + static func buildExpression(_ element: Expression) -> Component { + return [element] + } + static func buildOptional(_ component: Component?) -> Component { + guard let component = component else { return [] } + return component + } + static func buildEither(first component: Component) -> Component { + return component + } + static func buildEither(second component: Component) -> Component { + return component + } + static func buildArray(_ components: [Component]) -> Component { + return Array(components.joined()) + } + static func buildBlock(_ components: Component...) -> Component { + return Array(components.joined()) + } +} diff --git a/SideStoreApp/Sources/MiniMuxerSwift/MiniMuxer.swift b/SideStoreApp/Sources/MiniMuxer/MiniMuxer.swift similarity index 100% rename from SideStoreApp/Sources/MiniMuxerSwift/MiniMuxer.swift rename to SideStoreApp/Sources/MiniMuxer/MiniMuxer.swift diff --git a/SideStoreApp/Sources/PackageConfigs/PackageConfigs.swift b/SideStoreApp/Sources/PackageConfigs/PackageConfigs.swift deleted file mode 100644 index b722885d..00000000 --- a/SideStoreApp/Sources/PackageConfigs/PackageConfigs.swift +++ /dev/null @@ -1,11 +0,0 @@ -// -// PackageConfigs.swift -// PackageConfigs -// -// Created by Joseph Mattiello on 03/02/23. -// Copyright © 2023 Joseph Mattiello. All rights reserved. -// - - -// Dummy -public final class PackageConfigs { } diff --git a/SideStoreApp/Sources/SideStore/Resources/Base.lproj/Main.storyboard b/SideStoreApp/Sources/SideStore/Resources/Base.lproj/Main.storyboard index 2fa4d3c1..50626930 100644 --- a/SideStoreApp/Sources/SideStore/Resources/Base.lproj/Main.storyboard +++ b/SideStoreApp/Sources/SideStore/Resources/Base.lproj/Main.storyboard @@ -131,7 +131,7 @@ - + @@ -660,7 +660,7 @@ World - + @@ -816,7 +816,7 @@ World - + @@ -835,7 +835,7 @@ World - + @@ -856,7 +856,7 @@ World - + @@ -962,7 +962,7 @@ World - + @@ -981,7 +981,7 @@ World - + diff --git a/SideStoreApp/Sources/SideStore/Resources/XIB/BrowseCollectionViewCell.xib b/SideStoreApp/Sources/SideStore/Resources/XIB/BrowseCollectionViewCell.xib index e4e0cf83..214e5288 100644 --- a/SideStoreApp/Sources/SideStore/Resources/XIB/BrowseCollectionViewCell.xib +++ b/SideStoreApp/Sources/SideStore/Resources/XIB/BrowseCollectionViewCell.xib @@ -20,7 +20,7 @@ - + diff --git a/SideStoreApp/Sources/SideStore/Resources/XIB/UpdateCollectionViewCell.xib b/SideStoreApp/Sources/SideStore/Resources/XIB/UpdateCollectionViewCell.xib index bb23acf5..72915a1b 100644 --- a/SideStoreApp/Sources/SideStore/Resources/XIB/UpdateCollectionViewCell.xib +++ b/SideStoreApp/Sources/SideStore/Resources/XIB/UpdateCollectionViewCell.xib @@ -30,7 +30,7 @@ - + diff --git a/SideStoreApp/Sources/SideStoreAppKit/App Detail/AppContentViewControllerCells.swift b/SideStoreApp/Sources/SideStoreAppKit/App Detail/AppContentViewControllerCells.swift index e05c9410..22bc004f 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/App Detail/AppContentViewControllerCells.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/App Detail/AppContentViewControllerCells.swift @@ -8,6 +8,7 @@ import UIKit +@objc final class PermissionCollectionViewCell: UICollectionViewCell { @IBOutlet var button: UIButton! @IBOutlet var textLabel: UILabel! @@ -26,6 +27,7 @@ final class PermissionCollectionViewCell: UICollectionViewCell { } } +@objc final class AppContentTableViewCell: UITableViewCell { override func systemLayoutSizeFitting(_ targetSize: CGSize, withHorizontalFittingPriority horizontalFittingPriority: UILayoutPriority, verticalFittingPriority: UILayoutPriority) -> CGSize { // Ensure cell is laid out so it will report correct size. diff --git a/SideStoreApp/Sources/SideStoreAppKit/App Detail/AppViewController.swift b/SideStoreApp/Sources/SideStoreAppKit/App Detail/AppViewController.swift index 3dff12e5..e405bfa8 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/App Detail/AppViewController.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/App Detail/AppViewController.swift @@ -13,7 +13,9 @@ import RoxasUIKit import Nuke -final class AppViewController: UIViewController { +@objc +@objcMembers +public final class AppViewController: UIViewController { var app: StoreApp! private var contentViewController: AppContentViewController! @@ -46,11 +48,11 @@ final class AppViewController: UIViewController { private var _preferredStatusBarStyle: UIStatusBarStyle = .default - override var preferredStatusBarStyle: UIStatusBarStyle { + public override var preferredStatusBarStyle: UIStatusBarStyle { _preferredStatusBarStyle } - override func viewDidLoad() { + public override func viewDidLoad() { super.viewDidLoad() navigationBarTitleView.sizeToFit() @@ -123,7 +125,7 @@ final class AppViewController: UIViewController { } } - override func viewWillAppear(_ animated: Bool) { + public override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) prepareBlur() @@ -137,7 +139,7 @@ final class AppViewController: UIViewController { }, completion: nil) } - override func viewDidAppear(_ animated: Bool) { + public override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) _shouldResetLayout = true @@ -145,7 +147,7 @@ final class AppViewController: UIViewController { view.layoutIfNeeded() } - override func viewWillDisappear(_ animated: Bool) { + public override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) // Guard against "dismissing" when presenting via 3D Touch pop. @@ -164,7 +166,7 @@ final class AppViewController: UIViewController { }) } - override func viewDidDisappear(_ animated: Bool) { + public override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) if navigationController == nil { @@ -172,7 +174,7 @@ final class AppViewController: UIViewController { } } - override func prepare(for segue: UIStoryboardSegue, sender _: Any?) { + public override func prepare(for segue: UIStoryboardSegue, sender _: Any?) { guard segue.identifier == "embedAppContentViewController" else { return } contentViewController = segue.destination as? AppContentViewController @@ -185,7 +187,7 @@ final class AppViewController: UIViewController { } } - override func viewDidLayoutSubviews() { + public override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() if _shouldResetLayout { @@ -311,7 +313,7 @@ final class AppViewController: UIViewController { bannerView.backgroundEffectView.backgroundColor = .clear } - override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { + public override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { super.traitCollectionDidChange(previousTraitCollection) _shouldResetLayout = true } @@ -496,7 +498,7 @@ private extension AppViewController { } extension AppViewController: UIScrollViewDelegate { - func scrollViewDidScroll(_: UIScrollView) { + public func scrollViewDidScroll(_: UIScrollView) { view.setNeedsLayout() view.layoutIfNeeded() } diff --git a/SideStoreApp/Sources/SideStoreAppKit/Components/BannerCollectionViewCell.swift b/SideStoreApp/Sources/SideStoreAppKit/Components/BannerCollectionViewCell.swift index 172a909d..fe8939c4 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/Components/BannerCollectionViewCell.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/Components/BannerCollectionViewCell.swift @@ -8,6 +8,7 @@ import UIKit +@objc final class BannerCollectionViewCell: UICollectionViewCell { private(set) var errorBadge: UIView? @IBOutlet private(set) var bannerView: AppBannerView! diff --git a/SideStoreApp/Sources/SideStoreAppKit/Components/TextCollectionReusableView.swift b/SideStoreApp/Sources/SideStoreAppKit/Components/TextCollectionReusableView.swift index f3bde447..1029eafd 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/Components/TextCollectionReusableView.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/Components/TextCollectionReusableView.swift @@ -8,7 +8,8 @@ import UIKit -class TextCollectionReusableView: UICollectionReusableView { +@objc +public class TextCollectionReusableView: UICollectionReusableView { @IBOutlet var textLabel: UILabel! @IBOutlet var topLayoutConstraint: NSLayoutConstraint! diff --git a/SideStoreApp/Sources/SideStoreAppKit/My Apps/MyAppsComponents.swift b/SideStoreApp/Sources/SideStoreAppKit/My Apps/MyAppsComponents.swift index 0fff4f65..57b5d634 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/My Apps/MyAppsComponents.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/My Apps/MyAppsComponents.swift @@ -9,6 +9,7 @@ import RoxasUIKit import UIKit +@objc final class InstalledAppCollectionViewCell: UICollectionViewCell { private(set) var deactivateBadge: UIView? @@ -52,11 +53,13 @@ final class InstalledAppCollectionViewCell: UICollectionViewCell { } } +@objc final class InstalledAppsCollectionFooterView: UICollectionReusableView { @IBOutlet var textLabel: UILabel! @IBOutlet var button: UIButton! } +@objc final class NoUpdatesCollectionViewCell: UICollectionViewCell { @IBOutlet var blurView: UIVisualEffectView! @@ -67,6 +70,7 @@ final class NoUpdatesCollectionViewCell: UICollectionViewCell { } } +@objc final class UpdatesCollectionHeaderView: UICollectionReusableView { let button = PillButton(type: .system) diff --git a/SideStoreApp/Sources/SideStoreAppKit/News/NewsCollectionViewCell.swift b/SideStoreApp/Sources/SideStoreAppKit/News/NewsCollectionViewCell.swift index b0227fbf..2bcc06da 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/News/NewsCollectionViewCell.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/News/NewsCollectionViewCell.swift @@ -8,6 +8,7 @@ import UIKit +@objc final class NewsCollectionViewCell: UICollectionViewCell { @IBOutlet var titleLabel: UILabel! @IBOutlet var captionLabel: UILabel! diff --git a/SideStoreApp/Sources/SideStoreAppKit/Settings/PatreonComponents.swift b/SideStoreApp/Sources/SideStoreAppKit/Settings/PatreonComponents.swift index 8dbf5094..c2d8267a 100644 --- a/SideStoreApp/Sources/SideStoreAppKit/Settings/PatreonComponents.swift +++ b/SideStoreApp/Sources/SideStoreAppKit/Settings/PatreonComponents.swift @@ -8,6 +8,7 @@ import UIKit +@objc final class PatronCollectionViewCell: UICollectionViewCell { @IBOutlet var textLabel: UILabel! } diff --git a/SideStoreApp/Sources/Shared/AltConstants.swift b/SideStoreApp/Sources/SideStoreCore/AltConstants.swift similarity index 100% rename from SideStoreApp/Sources/Shared/AltConstants.swift rename to SideStoreApp/Sources/SideStoreCore/AltConstants.swift diff --git a/SideStoreApp/Sources/Shared/CFNotificationName+AltStore.swift b/SideStoreApp/Sources/SideStoreCore/CFNotificationName+AltStore.swift similarity index 100% rename from SideStoreApp/Sources/Shared/CFNotificationName+AltStore.swift rename to SideStoreApp/Sources/SideStoreCore/CFNotificationName+AltStore.swift diff --git a/SideStoreApp/Sources/Shared/Connections/Connection.swift b/SideStoreApp/Sources/SideStoreCore/Connections/Connection.swift similarity index 100% rename from SideStoreApp/Sources/Shared/Connections/Connection.swift rename to SideStoreApp/Sources/SideStoreCore/Connections/Connection.swift diff --git a/SideStoreApp/Sources/Shared/Connections/ConnectionManager.swift b/SideStoreApp/Sources/SideStoreCore/Connections/ConnectionManager.swift similarity index 100% rename from SideStoreApp/Sources/Shared/Connections/ConnectionManager.swift rename to SideStoreApp/Sources/SideStoreCore/Connections/ConnectionManager.swift diff --git a/SideStoreApp/Sources/Shared/Connections/NetworkConnection.swift b/SideStoreApp/Sources/SideStoreCore/Connections/NetworkConnection.swift similarity index 100% rename from SideStoreApp/Sources/Shared/Connections/NetworkConnection.swift rename to SideStoreApp/Sources/SideStoreCore/Connections/NetworkConnection.swift diff --git a/SideStoreApp/Sources/Shared/Connections/ServerProtocol.swift b/SideStoreApp/Sources/SideStoreCore/Connections/ServerProtocol.swift similarity index 100% rename from SideStoreApp/Sources/Shared/Connections/ServerProtocol.swift rename to SideStoreApp/Sources/SideStoreCore/Connections/ServerProtocol.swift diff --git a/SideStoreApp/Sources/Shared/Connections/XPCConnection.swift b/SideStoreApp/Sources/SideStoreCore/Connections/XPCConnection.swift similarity index 100% rename from SideStoreApp/Sources/Shared/Connections/XPCConnection.swift rename to SideStoreApp/Sources/SideStoreCore/Connections/XPCConnection.swift diff --git a/SideStoreApp/Sources/Shared/Extensions/Bundle+AltStore.swift b/SideStoreApp/Sources/SideStoreCore/Extensions/Bundle+AltStore.swift similarity index 100% rename from SideStoreApp/Sources/Shared/Extensions/Bundle+AltStore.swift rename to SideStoreApp/Sources/SideStoreCore/Extensions/Bundle+AltStore.swift diff --git a/SideStoreApp/Sources/Shared/Extensions/NSError+AltStore.swift b/SideStoreApp/Sources/SideStoreCore/Extensions/NSError+AltStore.swift similarity index 100% rename from SideStoreApp/Sources/Shared/Extensions/NSError+AltStore.swift rename to SideStoreApp/Sources/SideStoreCore/Extensions/NSError+AltStore.swift diff --git a/SideStoreApp/Sources/Shared/Extensions/NSXPCConnection+MachServices.swift b/SideStoreApp/Sources/SideStoreCore/Extensions/NSXPCConnection+MachServices.swift similarity index 100% rename from SideStoreApp/Sources/Shared/Extensions/NSXPCConnection+MachServices.swift rename to SideStoreApp/Sources/SideStoreCore/Extensions/NSXPCConnection+MachServices.swift diff --git a/SideStoreApp/Sources/Shared/Extensions/Result+Conveniences.swift b/SideStoreApp/Sources/SideStoreCore/Extensions/Result+Conveniences.swift similarity index 100% rename from SideStoreApp/Sources/Shared/Extensions/Result+Conveniences.swift rename to SideStoreApp/Sources/SideStoreCore/Extensions/Result+Conveniences.swift diff --git a/SideStoreApp/Sources/Shared/XPC/AltXPCProtocol.swift b/SideStoreApp/Sources/SideStoreCore/XPC/AltXPCProtocol.swift similarity index 100% rename from SideStoreApp/Sources/Shared/XPC/AltXPCProtocol.swift rename to SideStoreApp/Sources/SideStoreCore/XPC/AltXPCProtocol.swift diff --git a/SideStoreApp/Sources/SideWidget/ComplicationView.swift b/SideStoreApp/Sources/SideWidgetKit/ComplicationView.swift similarity index 100% rename from SideStoreApp/Sources/SideWidget/ComplicationView.swift rename to SideStoreApp/Sources/SideWidgetKit/ComplicationView.swift diff --git a/SideStoreApp/Sources/SideWidget/Countdown.swift b/SideStoreApp/Sources/SideWidgetKit/Countdown.swift similarity index 100% rename from SideStoreApp/Sources/SideWidget/Countdown.swift rename to SideStoreApp/Sources/SideWidgetKit/Countdown.swift diff --git a/SideStoreApp/Sources/SideWidget/SideWidget.swift b/SideStoreApp/Sources/SideWidgetKit/SideWidget.swift similarity index 100% rename from SideStoreApp/Sources/SideWidget/SideWidget.swift rename to SideStoreApp/Sources/SideWidgetKit/SideWidget.swift diff --git a/SideStoreApp/Sources/SideWidget/WidgetView.swift b/SideStoreApp/Sources/SideWidgetKit/WidgetView.swift similarity index 100% rename from SideStoreApp/Sources/SideWidget/WidgetView.swift rename to SideStoreApp/Sources/SideWidgetKit/WidgetView.swift diff --git a/SideStoreApp/Tests/SharedTests/SharedTests.swift b/SideStoreApp/Tests/SideStoreSharedTests/SideStoreSharedTests.swift similarity index 89% rename from SideStoreApp/Tests/SharedTests/SharedTests.swift rename to SideStoreApp/Tests/SideStoreSharedTests/SideStoreSharedTests.swift index 923f7ba4..0a39544e 100644 --- a/SideStoreApp/Tests/SharedTests/SharedTests.swift +++ b/SideStoreApp/Tests/SideStoreSharedTests/SideStoreSharedTests.swift @@ -1,5 +1,5 @@ // -// SharedTests.swift +// SideStoreSharedTests.swift // SideStore // // Created by Joseph Mattiello on 2/28/23. @@ -7,9 +7,9 @@ // import XCTest -@testable import Shared +@testable import SideStoreShared -class SharedTests: XCTestCase { +class SideStoreSharedTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. diff --git a/Tuist/Config.swift b/Tuist/Config.swift new file mode 100644 index 00000000..455964b1 --- /dev/null +++ b/Tuist/Config.swift @@ -0,0 +1,11 @@ +import ProjectDescription + +let config = Config( + compatibleXcodeVersions: [upToNextMajor("14.0")], + swiftVersion: "5.4.0", + generationOptions: .options([ + xcodeProjectName: "SideStore-\(.projectName)", + organizationName: "SideStore.io", + developmentRegion: "en" + ]) +) \ No newline at end of file diff --git a/Tuist/Setup.swift b/Tuist/Setup.swift new file mode 100644 index 00000000..2850c190 --- /dev/null +++ b/Tuist/Setup.swift @@ -0,0 +1,21 @@ +import ProjectDescription + +let setup = Setup( + require: [ + .precondition( + .swiftVersion("5.3.2"), + .xcodeVersion("12.4", "12D4e")) + ], + run: [ + .homebrew(packages: [ + "rustup-init", + "rust", + "cargo-c", + "swiftformat", + "swiftlint", + "swiftgen", + "swift-doc" + ]), + .mint() + ] +)