diff --git a/TemplateApplication.xcodeproj/project.pbxproj b/TemplateApplication.xcodeproj/project.pbxproj index 20f663a6..6c1c99b7 100644 --- a/TemplateApplication.xcodeproj/project.pbxproj +++ b/TemplateApplication.xcodeproj/project.pbxproj @@ -61,12 +61,9 @@ 2FE5DCB129EE6107004B9AB4 /* AccountOnboarding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DCAC29EE6107004B9AB4 /* AccountOnboarding.swift */; }; 2FF53D8B2A8725DE00042B76 /* SpeziMockWebService in Frameworks */ = {isa = PBXBuildFile; productRef = 2FF53D8A2A8725DE00042B76 /* SpeziMockWebService */; }; 2FF53D8D2A8729D600042B76 /* TemplateApplicationStandard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FF53D8C2A8729D600042B76 /* TemplateApplicationStandard.swift */; }; - 5661551D2AB8384200209B80 /* SwiftPackageList in Frameworks */ = {isa = PBXBuildFile; productRef = 5661551C2AB8384200209B80 /* SwiftPackageList */; }; - 566155292AB8447C00209B80 /* Package+LicenseType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 566155282AB8447C00209B80 /* Package+LicenseType.swift */; }; - 5661552E2AB854C000209B80 /* PackageHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5661552D2AB854C000209B80 /* PackageHelper.swift */; }; - 5680DD392AB8983D004E6D4A /* PackageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5680DD382AB8983D004E6D4A /* PackageCell.swift */; }; 5680DD3E2AB8CD84004E6D4A /* ContributionsTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5680DD3D2AB8CD84004E6D4A /* ContributionsTest.swift */; }; - 56F6F2A02AB441930022FE5A /* ContributionsList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56F6F29F2AB441930022FE5A /* ContributionsList.swift */; }; + 56E708352BB06B7100B08F0A /* SpeziLicense in Frameworks */ = {isa = PBXBuildFile; productRef = 56E708342BB06B7100B08F0A /* SpeziLicense */; }; + 56E7083B2BB06F6F00B08F0A /* SwiftPackageList in Frameworks */ = {isa = PBXBuildFile; productRef = 56E7083A2BB06F6F00B08F0A /* SwiftPackageList */; }; 653A2551283387FE005D4D48 /* TemplateApplication.swift in Sources */ = {isa = PBXBuildFile; fileRef = 653A2550283387FE005D4D48 /* TemplateApplication.swift */; }; 653A255528338800005D4D48 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 653A255428338800005D4D48 /* Assets.xcassets */; }; 653A256228338800005D4D48 /* TemplateApplicationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 653A256128338800005D4D48 /* TemplateApplicationTests.swift */; }; @@ -135,11 +132,7 @@ 2FE5DC5529EDD811004B9AB4 /* SocialSupportQuestionnaire.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = SocialSupportQuestionnaire.json; sourceTree = ""; }; 2FE5DCAC29EE6107004B9AB4 /* AccountOnboarding.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountOnboarding.swift; sourceTree = ""; }; 2FF53D8C2A8729D600042B76 /* TemplateApplicationStandard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TemplateApplicationStandard.swift; sourceTree = ""; }; - 566155282AB8447C00209B80 /* Package+LicenseType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Package+LicenseType.swift"; sourceTree = ""; }; - 5661552D2AB854C000209B80 /* PackageHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PackageHelper.swift; sourceTree = ""; }; - 5680DD382AB8983D004E6D4A /* PackageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PackageCell.swift; sourceTree = ""; }; 5680DD3D2AB8CD84004E6D4A /* ContributionsTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContributionsTest.swift; sourceTree = ""; }; - 56F6F29F2AB441930022FE5A /* ContributionsList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContributionsList.swift; sourceTree = ""; }; 653A254D283387FE005D4D48 /* TemplateApplication.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TemplateApplication.app; sourceTree = BUILT_PRODUCTS_DIR; }; 653A2550283387FE005D4D48 /* TemplateApplication.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TemplateApplication.swift; sourceTree = ""; }; 653A255428338800005D4D48 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -165,10 +158,11 @@ 2FE5DC6729EDD894004B9AB4 /* SpeziContact in Frameworks */, 2FE5DC8429EDD934004B9AB4 /* SpeziQuestionnaire in Frameworks */, 2FB099B32A875DF100B20952 /* FirebaseFirestoreSwift in Frameworks */, - 5661551D2AB8384200209B80 /* SwiftPackageList in Frameworks */, 2FB099B12A875DF100B20952 /* FirebaseFirestore in Frameworks */, A9D83F962B083794000D0C78 /* SpeziFirebaseAccountStorage in Frameworks */, 2FB099B62A875E2B00B20952 /* HealthKitOnFHIR in Frameworks */, + 56E7083B2BB06F6F00B08F0A /* SwiftPackageList in Frameworks */, + 56E708352BB06B7100B08F0A /* SpeziLicense in Frameworks */, 2FE5DC8A29EDD972004B9AB4 /* SpeziLocalStorage in Frameworks */, 2FE5DC8C29EDD972004B9AB4 /* SpeziSecureStorage in Frameworks */, 2FE5DC7529EDD8E6004B9AB4 /* SpeziFirebaseAccount in Frameworks */, @@ -290,17 +284,6 @@ path = Helper; sourceTree = ""; }; - 56F6F29E2AB441640022FE5A /* Contributions */ = { - isa = PBXGroup; - children = ( - 56F6F29F2AB441930022FE5A /* ContributionsList.swift */, - 5680DD382AB8983D004E6D4A /* PackageCell.swift */, - 566155282AB8447C00209B80 /* Package+LicenseType.swift */, - 5661552D2AB854C000209B80 /* PackageHelper.swift */, - ); - path = Contributions; - sourceTree = ""; - }; 653A2544283387FE005D4D48 = { isa = PBXGroup; children = ( @@ -335,7 +318,6 @@ 2FE5DC2829EDD398004B9AB4 /* Onboarding */, 2FE5DC3B29EDD7D0004B9AB4 /* Schedule */, 2FE5DC2729EDD38D004B9AB4 /* Contacts */, - 56F6F29E2AB441640022FE5A /* Contributions */, 2F4FC8D529EE69BE00BFFE26 /* MockUpload */, 2FE5DC3C29EDD7DA004B9AB4 /* SharedContext */, 2FE5DC3D29EDD7E4004B9AB4 /* Helper */, @@ -391,13 +373,14 @@ buildPhases = ( 653A2549283387FE005D4D48 /* Sources */, 653A254A283387FE005D4D48 /* Frameworks */, + 56E708392BB06DC400B08F0A /* Run Script - Generate Swift Package List */, 653A254B283387FE005D4D48 /* Resources */, 2F5B528D29BD237B002020B7 /* ShellScript */, ); buildRules = ( ); dependencies = ( - 566155222AB83CF200209B80 /* PBXTargetDependency */, + 56E7083D2BB06FCA00B08F0A /* PBXTargetDependency */, ); name = TemplateApplication; packageProductDependencies = ( @@ -420,11 +403,12 @@ 2FB099B02A875DF100B20952 /* FirebaseFirestore */, 2FB099B22A875DF100B20952 /* FirebaseFirestoreSwift */, 2FB099B52A875E2B00B20952 /* HealthKitOnFHIR */, - 5661551C2AB8384200209B80 /* SwiftPackageList */, 9739A0C52AD7B5730084BEA5 /* FirebaseStorage */, 97D73D692AD860AD00B47FA0 /* SpeziFirebaseStorage */, A9D83F952B083794000D0C78 /* SpeziFirebaseAccountStorage */, A92E4DEF2BAA001100AC8DE8 /* OrderedCollections */, + 56E708342BB06B7100B08F0A /* SpeziLicense */, + 56E7083A2BB06F6F00B08F0A /* SwiftPackageList */, ); productName = TemplateApplication; productReference = 653A254D283387FE005D4D48 /* TemplateApplication.app */; @@ -520,6 +504,7 @@ 2FB099B42A875E2B00B20952 /* XCRemoteSwiftPackageReference "HealthKitOnFHIR" */, 5661551B2AB8384200209B80 /* XCRemoteSwiftPackageReference "swift-package-list" */, A92E4DEE2BAA001100AC8DE8 /* XCRemoteSwiftPackageReference "swift-collections" */, + 56E708332BB06B7100B08F0A /* XCRemoteSwiftPackageReference "SpeziLicense" */, ); productRefGroup = 653A254E283387FE005D4D48 /* Products */; projectDirPath = ""; @@ -581,6 +566,24 @@ shellPath = /bin/sh; shellScript = "if [ \"${CONFIGURATION}\" = \"Debug\" ]; then\n export PATH=\"$PATH:/opt/homebrew/bin\"\n if which swiftlint > /dev/null; then\n swiftlint\n else\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\n fi\nfi\n"; }; + 56E708392BB06DC400B08F0A /* Run Script - Generate Swift Package List */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Run Script - Generate Swift Package List"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if command -v swift-package-list &> /dev/null; then\n OUTPUT_PATH=$SOURCE_ROOT/$TARGETNAME\n swift-package-list \"$PROJECT_FILE_PATH\" --output-type json --output-path \"$OUTPUT_PATH\" --requires-license\nelse\n echo \"warning: swift-package-list not installed\"\nfi\n"; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -610,16 +613,12 @@ 2F4E23832989D51F0013F3D9 /* TemplateApplicationTestingSetup.swift in Sources */, 2FE5DC5329EDD7FA004B9AB4 /* Bundle+Questionnaire.swift in Sources */, 2FE5DC5129EDD7FA004B9AB4 /* TemplateApplicationTaskContext.swift in Sources */, - 56F6F2A02AB441930022FE5A /* ContributionsList.swift in Sources */, - 566155292AB8447C00209B80 /* Package+LicenseType.swift in Sources */, - 5680DD392AB8983D004E6D4A /* PackageCell.swift in Sources */, 2F5E32BD297E05EA003432F8 /* TemplateApplicationDelegate.swift in Sources */, 2FE5DC5229EDD7FA004B9AB4 /* TemplateApplicationScheduler.swift in Sources */, A9FE7AD02AA39BAB0077B045 /* AccountSheet.swift in Sources */, 653A2551283387FE005D4D48 /* TemplateApplication.swift in Sources */, 2FE5DC3629EDD7CA004B9AB4 /* HealthKitPermissions.swift in Sources */, 2F65B44E2A3B8B0600A36932 /* NotificationPermissions.swift in Sources */, - 5661552E2AB854C000209B80 /* PackageHelper.swift in Sources */, 27FA29902A388E9B009CAC45 /* ModalView.swift in Sources */, 2FE5DC2629EDD38A004B9AB4 /* Contacts.swift in Sources */, ); @@ -648,9 +647,9 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 566155222AB83CF200209B80 /* PBXTargetDependency */ = { + 56E7083D2BB06FCA00B08F0A /* PBXTargetDependency */ = { isa = PBXTargetDependency; - productRef = 566155212AB83CF200209B80 /* SwiftPackageListJSONPlugin */; + productRef = 56E7083C2BB06FCA00B08F0A /* SwiftPackageListPlugin */; }; 653A255F28338800005D4D48 /* PBXTargetDependency */ = { isa = PBXTargetDependency; @@ -1260,7 +1259,15 @@ repositoryURL = "https://github.com/FelixHerrmann/swift-package-list"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 3.0.10; + minimumVersion = 4.1.0; + }; + }; + 56E708332BB06B7100B08F0A /* XCRemoteSwiftPackageReference "SpeziLicense" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/StanfordSpezi/SpeziLicense"; + requirement = { + branch = "dependency-list"; + kind = branch; }; }; 97F466E62A76BBEE005DC9B4 /* XCRemoteSwiftPackageReference "SpeziOnboarding" */ = { @@ -1386,15 +1393,20 @@ package = 2FE750CA2A87240100723EAE /* XCRemoteSwiftPackageReference "SpeziMockWebService" */; productName = SpeziMockWebService; }; - 5661551C2AB8384200209B80 /* SwiftPackageList */ = { + 56E708342BB06B7100B08F0A /* SpeziLicense */ = { + isa = XCSwiftPackageProductDependency; + package = 56E708332BB06B7100B08F0A /* XCRemoteSwiftPackageReference "SpeziLicense" */; + productName = SpeziLicense; + }; + 56E7083A2BB06F6F00B08F0A /* SwiftPackageList */ = { isa = XCSwiftPackageProductDependency; package = 5661551B2AB8384200209B80 /* XCRemoteSwiftPackageReference "swift-package-list" */; productName = SwiftPackageList; }; - 566155212AB83CF200209B80 /* SwiftPackageListJSONPlugin */ = { + 56E7083C2BB06FCA00B08F0A /* SwiftPackageListPlugin */ = { isa = XCSwiftPackageProductDependency; package = 5661551B2AB8384200209B80 /* XCRemoteSwiftPackageReference "swift-package-list" */; - productName = "plugin:SwiftPackageListJSONPlugin"; + productName = "plugin:SwiftPackageListPlugin"; }; 9739A0C52AD7B5730084BEA5 /* FirebaseStorage */ = { isa = XCSwiftPackageProductDependency; diff --git a/TemplateApplication.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/TemplateApplication.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 02929166..fa405053 100644 --- a/TemplateApplication.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/TemplateApplication.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "9ddbf125e828f8f258514b9b7b616777823852827ae6b79035a44b66b986b5e0", + "originHash" : "46cfc5a57fab0026331bdc973629aaa6fe4210d6de9c8ced81f70762b94ccf83", "pins" : [ { "identity" : "abseil-cpp-binary", @@ -22,7 +22,7 @@ { "identity" : "fhirmodels", "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/FHIRModels", + "location" : "https://github.com/apple/FHIRModels.git", "state" : { "revision" : "861afd5816a98d38f86220eab2f812d76cad84a0", "version" : "0.5.0" @@ -78,8 +78,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/gtm-session-fetcher.git", "state" : { - "revision" : "76135c9f4e1ac85459d5fec61b6f76ac47ab3a4c", - "version" : "3.3.1" + "revision" : "9534039303015a84837090d20fa21cae6e5eadb6", + "version" : "3.3.2" } }, { @@ -199,6 +199,15 @@ "version" : "0.5.3" } }, + { + "identity" : "spezilicense", + "kind" : "remoteSourceControl", + "location" : "https://github.com/StanfordSpezi/SpeziLicense", + "state" : { + "branch" : "dependency-list", + "revision" : "b02011781d9769bc051ce875f2c4c9a46b98bf52" + } + }, { "identity" : "spezimockwebservice", "kind" : "remoteSourceControl", @@ -276,8 +285,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/FelixHerrmann/swift-package-list", "state" : { - "revision" : "412180a72b9a1f8262213c16459e3533b0385ea5", - "version" : "3.1.0" + "revision" : "9e7edc38f2a599424b9437c32baf1e6a8b9621b8", + "version" : "4.1.0" } }, { diff --git a/TemplateApplication/Account/AccountSheet.swift b/TemplateApplication/Account/AccountSheet.swift index f5bfaf11..a4dc63ca 100644 --- a/TemplateApplication/Account/AccountSheet.swift +++ b/TemplateApplication/Account/AccountSheet.swift @@ -7,6 +7,7 @@ // import SpeziAccount +import SpeziLicense import SwiftUI diff --git a/TemplateApplication/Contributions/ContributionsList.swift b/TemplateApplication/Contributions/ContributionsList.swift deleted file mode 100644 index 86f967c4..00000000 --- a/TemplateApplication/Contributions/ContributionsList.swift +++ /dev/null @@ -1,53 +0,0 @@ -// -// This source file is part of the Stanford Spezi Template Application open-source project -// -// SPDX-FileCopyrightText: 2023 Stanford University -// -// SPDX-License-Identifier: MIT -// - -import SwiftPackageList -import SwiftUI - - -struct ContributionsList: View { - var packages: [Package] = PackageHelper.getPackageList() - - var body: some View { - List { - Section(footer: Text("PROJECT_LICENSE_DESCRIPTION")) { - Text("CONTRIBUTIONS_LIST_DESCRIPTION") - } - Section( - header: Text("CONTRIBUTIONS_LIST_HEADER"), - footer: Text("CONTRIBUTIONS_LIST_FOOTER") - ) { - ForEach(packages.sorted(by: { $0.name < $1.name }), id: \.name) { package in - PackageCell(package: package) - } - } - } - .navigationTitle("LICENSE_INFO_TITLE") - .navigationBarTitleDisplayMode(.inline) - } -} - - -#if DEBUG -#Preview { - let mockPackages = [ - Package( - name: "MockPackage", - version: "1.0", - branch: nil, - revision: "0", - // We use a force unwrap in the preview as we can not recover from an error here - // and the code will never end up in a production environment. - // swiftlint:disable:next force_unwrapping - repositoryURL: URL(string: "github.com")!, - license: "MIT License" - ) - ] - return ContributionsList(packages: mockPackages) -} -#endif diff --git a/TemplateApplication/Contributions/Package+LicenseType.swift b/TemplateApplication/Contributions/Package+LicenseType.swift deleted file mode 100644 index 7301c0ac..00000000 --- a/TemplateApplication/Contributions/Package+LicenseType.swift +++ /dev/null @@ -1,104 +0,0 @@ -// -// This source file is part of the Stanford Spezi Template Application open-source project -// -// SPDX-FileCopyrightText: 2023 Stanford University -// -// SPDX-License-Identifier: MIT -// - -import Foundation -import SwiftPackageList - - -// This section of code is based on the SwiftPackageList package: -// - Original code: https://github.com/FelixHerrmann/swift-package-list/issues/43 -enum LicenseType { - case mit - case apachev2 - case gplv2 - case gplv3 - case bsd2 - case bsd3 - case bsd4 - case zlib - - /// SPDX-License-Identifier for the UI - var spdxIdentifier: String { - switch self { - case .mit: return "MIT" - case .apachev2: return "Apache-2.0" - case .gplv2: return "GPL-2.0" - case .gplv3: return "GPL-3.0" - case .bsd2: return "BSD-2-Clause" - case .bsd3: return "BSD-3-Clause" - case .bsd4: return "BSD-4-Clause" - case .zlib: return "Zlib" - } - } - - /// Initializer that scans the license document for common licenses and versions - init?(license: String) { - let license = license - .replacingOccurrences(of: "\\s+|\\n", with: " ", options: .regularExpression) - - if license.contains(mitText) { - self = .mit - } else if license.contains(apacheText) && license.contains("Version 2.0") { - self = .apachev2 - } else if license.contains(gnuText) && license.contains("Version 2") { - self = .gplv2 - } else if license.contains(gnuText) && license.contains("Version 3") { - self = .gplv3 - } else if license.contains(bsdFourClauseText) { - self = .bsd4 - } else if license.range(of: bsdThreeClausePattern, options: .regularExpression) != nil { - self = .bsd3 - } else if license.contains(bsdTwoClauseText) { - self = .bsd2 - } else if license.range(of: zlibPattern, options: .regularExpression) != nil { - self = .zlib - } else { - return nil - } - } -} - - -// Constants representing typical text and regular expression patterns often found in license files. -// They are used for matching and identifying different types of licenses within text documents. -private let mitText = "MIT License" -private let apacheText = "Apache License" -private let gnuText = "GNU GENERAL PUBLIC LICENSE" -private let bsdTwoClauseText = - """ - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met - """ -private let bsdThreeClausePattern = - """ - Neither the name of (.+) nor the names of (.+) may be used to endorse or promote products derived from this software \ - without specific prior written permission - """ -private let bsdFourClauseText = - """ - All advertising materials mentioning features or use of this software must display the following acknowledgement: \ - this product includes software developed by - """ -private let zlibPattern = - """ - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. \ - If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.(.*) \ - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.(.*) \ - This notice may not be removed or altered from any source distribution. - """ - - -extension Package { - /// Generates the `LicenseType` from a license document of `String` - func getLicenseType(license: String?) -> LicenseType? { - if let license = license { - let licenseType = LicenseType(license: license) - return licenseType - } - return nil - } -} diff --git a/TemplateApplication/Contributions/PackageCell.swift b/TemplateApplication/Contributions/PackageCell.swift deleted file mode 100644 index d64780aa..00000000 --- a/TemplateApplication/Contributions/PackageCell.swift +++ /dev/null @@ -1,73 +0,0 @@ -// -// This source file is part of the Stanford Spezi Template Application open-source project -// -// SPDX-FileCopyrightText: 2023 Stanford University -// -// SPDX-License-Identifier: MIT -// - -import SwiftPackageList -import SwiftUI - - -struct PackageCell: View { - let package: Package - - var body: some View { - HStack { - VStack(alignment: .leading, spacing: 4) { - Text(package.name).font(.headline) - HStack { - Text(getPackageDetails(package: package)) - .font(.caption) - if let licenseType = package.getLicenseType(license: package.license) { - Text(licenseType.spdxIdentifier) - .font(.caption) - .fontWeight(.semibold) - .padding(2) - .background(Color(.systemGray5)) - .cornerRadius(4) - } - } - } - Spacer() - Button(action: { - UIApplication.shared.open(package.repositoryURL) - }) { - Image(systemName: "safari.fill") - .imageScale(.large) - }.buttonStyle(PlainButtonStyle()) - .foregroundColor(.blue) - .accessibilityLabel(Text("Repository Link")) - } - } - - func getPackageDetails(package: Package) -> String { - if let branch = package.branch { - return "Branch: \(branch)" - } else if let version = package.version { - return "Version: \(version)" - } else { - return "Revision: \(package.revision)" - } - } -} - - -#if DEBUG -#Preview(traits: .sizeThatFitsLayout) { - let mockPackage = Package( - name: "MockPackage", - version: "1.0", - branch: nil, - revision: "0", - // We use a force unwrap in the preview as we can not recover from an error here - // and the code will never end up in a production environment. - // swiftlint:disable:next force_unwrapping - repositoryURL: URL(string: "github.com")!, - license: "MIT License" - ) - - return PackageCell(package: mockPackage) -} -#endif diff --git a/TemplateApplication/Contributions/PackageHelper.swift b/TemplateApplication/Contributions/PackageHelper.swift deleted file mode 100644 index 11e6e7d9..00000000 --- a/TemplateApplication/Contributions/PackageHelper.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// This source file is part of the Stanford Spezi Template Application open-source project -// -// SPDX-FileCopyrightText: 2023 Stanford University -// -// SPDX-License-Identifier: MIT -// - -import Foundation -import SwiftPackageList - - -enum PackageHelper { - /// Helper function that calls the corresponding API of `SwiftPackageList`to fetch the list of packages - static func getPackageList() -> [Package] { - do { - let packages = try packageList() - return packages - } catch PackageListError.noPackageList { - print("There is no package-list file") - } catch { - print(error) - } - return [] - } -} diff --git a/TemplateApplication/Resources/Localizable.xcstrings b/TemplateApplication/Resources/Localizable.xcstrings index 47475629..fc9a7f0c 100644 --- a/TemplateApplication/Resources/Localizable.xcstrings +++ b/TemplateApplication/Resources/Localizable.xcstrings @@ -105,6 +105,7 @@ } }, "CONTRIBUTIONS_LIST_DESCRIPTION" : { + "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -115,6 +116,7 @@ } }, "CONTRIBUTIONS_LIST_FOOTER" : { + "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -125,6 +127,7 @@ } }, "CONTRIBUTIONS_LIST_HEADER" : { + "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -359,6 +362,7 @@ } }, "PROJECT_LICENSE_DESCRIPTION" : { + "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -369,6 +373,7 @@ } }, "Repository Link" : { + "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : {