From 9ce1256d5088a693b24928b1dbb7fa1eaba7cd9e Mon Sep 17 00:00:00 2001 From: Albert Ho Date: Fri, 20 Dec 2024 15:20:46 -0800 Subject: [PATCH] make ios available via spm --- .github/workflows/ios-demos.yml | 16 +- .github/workflows/ios-tests.yml | 7 +- .gitignore | 3 + Package.swift | 34 ++++ .../PicoLLMAppTest.xcodeproj/project.pbxproj | 156 ++++-------------- .../contents.xcworkspacedata | 10 -- .../xcshareddata/IDEWorkspaceChecks.plist | 8 - binding/ios/PicoLLMAppTest/Podfile | 10 -- binding/ios/PicoLLMAppTest/Podfile.lock | 16 -- binding/ios/PicoLLMErrors.swift | 2 + binding/ios/README.md | 8 +- binding/ios/picoLLM-iOS.podspec | 4 +- .../PicoLLMChatDemo.xcodeproj/project.pbxproj | 101 ++++-------- demo/ios/Chat/PicoLLMChatDemo/ViewModel.swift | 1 + demo/ios/Chat/Podfile | 6 - demo/ios/Chat/Podfile.lock | 16 -- .../project.pbxproj | 95 +++-------- .../PicoLLMCompletionDemo/ViewModel.swift | 1 + demo/ios/Completion/Podfile | 6 - demo/ios/Completion/Podfile.lock | 16 -- demo/ios/README.md | 6 +- resources/.lint/spell-check/dict.txt | 1 + 22 files changed, 140 insertions(+), 383 deletions(-) create mode 100644 Package.swift delete mode 100644 binding/ios/PicoLLMAppTest/PicoLLMAppTest.xcworkspace/contents.xcworkspacedata delete mode 100644 binding/ios/PicoLLMAppTest/PicoLLMAppTest.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 binding/ios/PicoLLMAppTest/Podfile delete mode 100644 binding/ios/PicoLLMAppTest/Podfile.lock delete mode 100644 demo/ios/Chat/Podfile delete mode 100644 demo/ios/Chat/Podfile.lock delete mode 100644 demo/ios/Completion/Podfile delete mode 100644 demo/ios/Completion/Podfile.lock diff --git a/.github/workflows/ios-demos.yml b/.github/workflows/ios-demos.yml index 74ff133..d38e353 100644 --- a/.github/workflows/ios-demos.yml +++ b/.github/workflows/ios-demos.yml @@ -26,16 +26,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Install Cocoapods - run: gem install cocoapods - - - name: Run Cocoapods - run: pod install --repo-update - - name: Build run: xcrun xcodebuild build -configuration Debug - -workspace PicoLLMCompletionDemo.xcworkspace + -project PicoLLMCompletionDemo.xcodeproj -sdk iphoneos -scheme PicoLLMCompletionDemo -derivedDataPath ddp @@ -51,16 +45,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Install Cocoapods - run: gem install cocoapods - - - name: Run Cocoapods - run: pod install --repo-update - - name: Build run: xcrun xcodebuild build -configuration Debug - -workspace PicoLLMChatDemo.xcworkspace + -project PicoLLMChatDemo.xcodeproj -sdk iphoneos -scheme PicoLLMChatDemo -derivedDataPath ddp diff --git a/.github/workflows/ios-tests.yml b/.github/workflows/ios-tests.yml index 3596f79..430c6f2 100644 --- a/.github/workflows/ios-tests.yml +++ b/.github/workflows/ios-tests.yml @@ -28,9 +28,6 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Run Cocoapods - run: pod install --repo-update - - name: Inject AccessKey run: sed -i '.bak' 's:{TESTING_ACCESS_KEY_HERE}:${{secrets.PV_VALID_ACCESS_KEY}}:' PicoLLMAppTestUITests/BaseTest.swift @@ -42,7 +39,7 @@ jobs: - name: XCode Build run: xcrun xcodebuild build-for-testing -configuration Debug - -workspace PicoLLMAppTest.xcworkspace + -project PicoLLMAppTest.xcodeproj -sdk iphoneos -scheme PicoLLMAppTest -derivedDataPath ddp @@ -50,6 +47,6 @@ jobs: - name: Run Tests on Simulator run: xcrun xcodebuild test - -workspace PicoLLMAppTest.xcworkspace + -project PicoLLMAppTest.xcodeproj -scheme PicoLLMAppTest -destination 'platform=iOS Simulator,name=iPhone 13,OS=16.4' diff --git a/.gitignore b/.gitignore index 8e624b5..fc12acd 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ __pycache__ *.bin *.pllm +.build +Package.resolved +.swiftpm \ No newline at end of file diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..a7bcd7a --- /dev/null +++ b/Package.swift @@ -0,0 +1,34 @@ +// swift-tools-version:5.3 +import PackageDescription +let package = Package( + name: "picoLLM-iOS", + platforms: [ + .iOS(.v13) + ], + products: [ + .library( + name: "PicoLLM", + targets: ["PicoLLM"] + ) + ], + targets: [ + .binaryTarget( + name: "PvPicoLLM", + path: "lib/ios/PvPicoLLM.xcframework" + ), + .target( + name: "PicoLLM", + dependencies: ["PvPicoLLM"], + path: ".", + exclude: [ + "binding/ios/PicoLLMAppTest", + "demo" + ], + sources: [ + "binding/ios/PicoLLM.swift", + "binding/ios/PicoLLMDialog.swift", + "binding/ios/PicoLLMErrors.swift" + ] + ) + ] +) diff --git a/binding/ios/PicoLLMAppTest/PicoLLMAppTest.xcodeproj/project.pbxproj b/binding/ios/PicoLLMAppTest/PicoLLMAppTest.xcodeproj/project.pbxproj index 255bbbf..3bc2d42 100644 --- a/binding/ios/PicoLLMAppTest/PicoLLMAppTest.xcodeproj/project.pbxproj +++ b/binding/ios/PicoLLMAppTest/PicoLLMAppTest.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 55; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ @@ -13,10 +13,10 @@ 1E7744BD27CD9D7F00491D0B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1E7744BC27CD9D7F00491D0B /* Assets.xcassets */; }; 1E7744C027CD9D7F00491D0B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1E7744BE27CD9D7F00491D0B /* LaunchScreen.storyboard */; }; 1E7744D527CD9D7F00491D0B /* PicoLLMAppTestUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E7744D427CD9D7F00491D0B /* PicoLLMAppTestUITests.swift */; }; - 4A22E640019BA3ECBF044BFD /* libPods-PicoLLMAppTestUITests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 294FADF72A91D4790191B72F /* libPods-PicoLLMAppTestUITests.a */; }; - 9002F3251AFE11CB58B4AF91 /* libPods-PicoLLMAppTest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2EC1458495139C3C6B186FB0 /* libPods-PicoLLMAppTest.a */; }; A52A78ED18AA4EDB33D95C4D /* BaseTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = A52A7583A49E7ACAA9C7A0C5 /* BaseTest.swift */; }; C795C0F42BED5A5200BA9BD2 /* test_data.json in Resources */ = {isa = PBXBuildFile; fileRef = C795C0F32BED5A5200BA9BD2 /* test_data.json */; }; + E1E013792D160CE600DB0C2F /* PicoLLM in Frameworks */ = {isa = PBXBuildFile; productRef = E1E013782D160CE600DB0C2F /* PicoLLM */; }; + E1E0137B2D160CEA00DB0C2F /* PicoLLM in Frameworks */ = {isa = PBXBuildFile; productRef = E1E0137A2D160CEA00DB0C2F /* PicoLLM */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -30,8 +30,6 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 107FED2B859E7EE9AC12C374 /* Pods-PerformanceTest.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PerformanceTest.release.xcconfig"; path = "Target Support Files/Pods-PerformanceTest/Pods-PerformanceTest.release.xcconfig"; sourceTree = ""; }; - 1E50C3F5EFC139AC9F72C389 /* Pods-PicoLLMAppTestUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PicoLLMAppTestUITests.debug.xcconfig"; path = "Target Support Files/Pods-PicoLLMAppTestUITests/Pods-PicoLLMAppTestUITests.debug.xcconfig"; sourceTree = ""; }; 1E7744B027CD9D7E00491D0B /* PicoLLMAppTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PicoLLMAppTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; 1E7744B327CD9D7E00491D0B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 1E7744B727CD9D7E00491D0B /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; @@ -42,13 +40,6 @@ 1E7744D027CD9D7F00491D0B /* PicoLLMAppTestUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PicoLLMAppTestUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 1E7744D427CD9D7F00491D0B /* PicoLLMAppTestUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PicoLLMAppTestUITests.swift; sourceTree = ""; }; 1E7744E327CDA13600491D0B /* info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = info.plist; sourceTree = ""; }; - 294FADF72A91D4790191B72F /* libPods-PicoLLMAppTestUITests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PicoLLMAppTestUITests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 2B19DDB15B3549F2A0CEA808 /* Pods-PicoLLMAppTest.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PicoLLMAppTest.release.xcconfig"; path = "Target Support Files/Pods-PicoLLMAppTest/Pods-PicoLLMAppTest.release.xcconfig"; sourceTree = ""; }; - 2EC1458495139C3C6B186FB0 /* libPods-PicoLLMAppTest.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PicoLLMAppTest.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 3B9010DF1EC4645C3AFCD069 /* Pods-PicoLLMAppTestUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PicoLLMAppTestUITests.release.xcconfig"; path = "Target Support Files/Pods-PicoLLMAppTestUITests/Pods-PicoLLMAppTestUITests.release.xcconfig"; sourceTree = ""; }; - 797233CF30E7017467863A8D /* Pods-PerformanceTest.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PerformanceTest.debug.xcconfig"; path = "Target Support Files/Pods-PerformanceTest/Pods-PerformanceTest.debug.xcconfig"; sourceTree = ""; }; - 859BCC69EB5B3DEE304174D9 /* Pods-PicoLLMAppTest.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PicoLLMAppTest.debug.xcconfig"; path = "Target Support Files/Pods-PicoLLMAppTest/Pods-PicoLLMAppTest.debug.xcconfig"; sourceTree = ""; }; - 8EA77D43CC5ED0D3506A9A0F /* libPods-PerformanceTest.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PerformanceTest.a"; sourceTree = BUILT_PRODUCTS_DIR; }; A52A7583A49E7ACAA9C7A0C5 /* BaseTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseTest.swift; sourceTree = ""; }; C795C0F32BED5A5200BA9BD2 /* test_data.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = test_data.json; path = ../../../../../resources/.test/test_data.json; sourceTree = ""; }; C7FA703F2B6B145800F480F3 /* libPicoLLM-iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libPicoLLM-iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -59,7 +50,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9002F3251AFE11CB58B4AF91 /* libPods-PicoLLMAppTest.a in Frameworks */, + E1E013792D160CE600DB0C2F /* PicoLLM in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -67,33 +58,19 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 4A22E640019BA3ECBF044BFD /* libPods-PicoLLMAppTestUITests.a in Frameworks */, + E1E0137B2D160CEA00DB0C2F /* PicoLLM in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 1AF96756F2A5FC2840F81D99 /* Pods */ = { - isa = PBXGroup; - children = ( - 859BCC69EB5B3DEE304174D9 /* Pods-PicoLLMAppTest.debug.xcconfig */, - 2B19DDB15B3549F2A0CEA808 /* Pods-PicoLLMAppTest.release.xcconfig */, - 1E50C3F5EFC139AC9F72C389 /* Pods-PicoLLMAppTestUITests.debug.xcconfig */, - 3B9010DF1EC4645C3AFCD069 /* Pods-PicoLLMAppTestUITests.release.xcconfig */, - 797233CF30E7017467863A8D /* Pods-PerformanceTest.debug.xcconfig */, - 107FED2B859E7EE9AC12C374 /* Pods-PerformanceTest.release.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; 1E7744A727CD9D7E00491D0B = { isa = PBXGroup; children = ( 1E7744B227CD9D7E00491D0B /* PicoLLMAppTest */, 1E7744D327CD9D7F00491D0B /* PicoLLMAppTestUITests */, 1E7744B127CD9D7E00491D0B /* Products */, - 1AF96756F2A5FC2840F81D99 /* Pods */, CF8A3E0166575C420DB0878C /* Frameworks */, ); sourceTree = ""; @@ -143,9 +120,6 @@ isa = PBXGroup; children = ( C7FA703F2B6B145800F480F3 /* libPicoLLM-iOS.a */, - 2EC1458495139C3C6B186FB0 /* libPods-PicoLLMAppTest.a */, - 294FADF72A91D4790191B72F /* libPods-PicoLLMAppTestUITests.a */, - 8EA77D43CC5ED0D3506A9A0F /* libPods-PerformanceTest.a */, ); name = Frameworks; sourceTree = ""; @@ -157,11 +131,9 @@ isa = PBXNativeTarget; buildConfigurationList = 1E7744DA27CD9D7F00491D0B /* Build configuration list for PBXNativeTarget "PicoLLMAppTest" */; buildPhases = ( - B1385005372F1469CA69F7B1 /* [CP] Check Pods Manifest.lock */, 1E7744AC27CD9D7E00491D0B /* Sources */, 1E7744AD27CD9D7E00491D0B /* Frameworks */, 1E7744AE27CD9D7E00491D0B /* Resources */, - 3AB647519EBEBCDE7B48DBB5 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -176,11 +148,9 @@ isa = PBXNativeTarget; buildConfigurationList = 1E7744E027CD9D7F00491D0B /* Build configuration list for PBXNativeTarget "PicoLLMAppTestUITests" */; buildPhases = ( - 56CEA52AE3D3B600B4DCD856 /* [CP] Check Pods Manifest.lock */, 1E7744CC27CD9D7F00491D0B /* Sources */, 1E7744CD27CD9D7F00491D0B /* Frameworks */, 1E7744CE27CD9D7F00491D0B /* Resources */, - CFE0717F041B6628A838F80C /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -220,6 +190,9 @@ Base, ); mainGroup = 1E7744A727CD9D7E00491D0B; + packageReferences = ( + E1E013772D160CDE00DB0C2F /* XCLocalSwiftPackageReference "../../../../picollm" */, + ); productRefGroup = 1E7744B127CD9D7E00491D0B /* Products */; projectDirPath = ""; projectRoot = ""; @@ -251,87 +224,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - 3AB647519EBEBCDE7B48DBB5 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-PicoLLMAppTest/Pods-PicoLLMAppTest-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-PicoLLMAppTest/Pods-PicoLLMAppTest-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PicoLLMAppTest/Pods-PicoLLMAppTest-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 56CEA52AE3D3B600B4DCD856 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-PicoLLMAppTestUITests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - B1385005372F1469CA69F7B1 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-PicoLLMAppTest-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - CFE0717F041B6628A838F80C /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-PicoLLMAppTestUITests/Pods-PicoLLMAppTestUITests-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-PicoLLMAppTestUITests/Pods-PicoLLMAppTestUITests-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PicoLLMAppTestUITests/Pods-PicoLLMAppTestUITests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ 1E7744AC27CD9D7E00491D0B /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -503,13 +395,12 @@ }; 1E7744DB27CD9D7F00491D0B /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 859BCC69EB5B3DEE304174D9 /* Pods-PicoLLMAppTest.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = EU9HUJJU2X; + DEVELOPMENT_TEAM = 65723695GD; ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = PicoLLMAppTest/Info.plist; @@ -539,13 +430,12 @@ }; 1E7744DC27CD9D7F00491D0B /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 2B19DDB15B3549F2A0CEA808 /* Pods-PicoLLMAppTest.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = EU9HUJJU2X; + DEVELOPMENT_TEAM = 65723695GD; ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = PicoLLMAppTest/Info.plist; @@ -574,11 +464,10 @@ }; 1E7744E127CD9D7F00491D0B /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 1E50C3F5EFC139AC9F72C389 /* Pods-PicoLLMAppTestUITests.debug.xcconfig */; buildSettings = { CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = EU9HUJJU2X; + DEVELOPMENT_TEAM = 65723695GD; ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 16.0; @@ -603,11 +492,10 @@ }; 1E7744E227CD9D7F00491D0B /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3B9010DF1EC4645C3AFCD069 /* Pods-PicoLLMAppTestUITests.release.xcconfig */; buildSettings = { CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = EU9HUJJU2X; + DEVELOPMENT_TEAM = 65723695GD; ENABLE_USER_SCRIPT_SANDBOXING = NO; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 16.0; @@ -661,6 +549,26 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + E1E013772D160CDE00DB0C2F /* XCLocalSwiftPackageReference "../../../../picollm" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = ../../../../picollm; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + E1E013782D160CE600DB0C2F /* PicoLLM */ = { + isa = XCSwiftPackageProductDependency; + package = E1E013772D160CDE00DB0C2F /* XCLocalSwiftPackageReference "../../../../picollm" */; + productName = PicoLLM; + }; + E1E0137A2D160CEA00DB0C2F /* PicoLLM */ = { + isa = XCSwiftPackageProductDependency; + package = E1E013772D160CDE00DB0C2F /* XCLocalSwiftPackageReference "../../../../picollm" */; + productName = PicoLLM; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 1E7744A827CD9D7E00491D0B /* Project object */; } diff --git a/binding/ios/PicoLLMAppTest/PicoLLMAppTest.xcworkspace/contents.xcworkspacedata b/binding/ios/PicoLLMAppTest/PicoLLMAppTest.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index d44d9b4..0000000 --- a/binding/ios/PicoLLMAppTest/PicoLLMAppTest.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/binding/ios/PicoLLMAppTest/PicoLLMAppTest.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/binding/ios/PicoLLMAppTest/PicoLLMAppTest.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/binding/ios/PicoLLMAppTest/PicoLLMAppTest.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/binding/ios/PicoLLMAppTest/Podfile b/binding/ios/PicoLLMAppTest/Podfile deleted file mode 100644 index f5f741e..0000000 --- a/binding/ios/PicoLLMAppTest/Podfile +++ /dev/null @@ -1,10 +0,0 @@ -source 'https://cdn.cocoapods.org/' -platform :ios, '16.0' - -target 'PicoLLMAppTest' do - pod 'picoLLM-iOS', :podspec => 'https://raw.githubusercontent.com/Picovoice/picollm/refs/heads/v1.2.3/binding/ios/picoLLM-iOS.podspec' -end - -target 'PicoLLMAppTestUITests' do - pod 'picoLLM-iOS', :podspec => 'https://raw.githubusercontent.com/Picovoice/picollm/refs/heads/v1.2.3/binding/ios/picoLLM-iOS.podspec' -end diff --git a/binding/ios/PicoLLMAppTest/Podfile.lock b/binding/ios/PicoLLMAppTest/Podfile.lock deleted file mode 100644 index 8fe0ea3..0000000 --- a/binding/ios/PicoLLMAppTest/Podfile.lock +++ /dev/null @@ -1,16 +0,0 @@ -PODS: - - picoLLM-iOS (1.2.2) - -DEPENDENCIES: - - picoLLM-iOS (~> 1.2.2) - -SPEC REPOS: - trunk: - - picoLLM-iOS - -SPEC CHECKSUMS: - picoLLM-iOS: 21f92b131dab066b63365f612222c46d04cf3141 - -PODFILE CHECKSUM: 587c9b24dc36d7eaa75ebc7db50d7c26a2e7e92b - -COCOAPODS: 1.15.2 diff --git a/binding/ios/PicoLLMErrors.swift b/binding/ios/PicoLLMErrors.swift index 6d77f93..b82e131 100644 --- a/binding/ios/PicoLLMErrors.swift +++ b/binding/ios/PicoLLMErrors.swift @@ -7,6 +7,8 @@ // specific language governing permissions and limitations under the License. // +import Foundation + public class PicoLLMError: LocalizedError { private let message: String private let messageStack: [String] diff --git a/binding/ios/README.md b/binding/ios/README.md index e390f70..bb24286 100644 --- a/binding/ios/README.md +++ b/binding/ios/README.md @@ -20,9 +20,15 @@ models. picoLLM Inference Engine is: ## Installation -The picoLLM iOS binding is available via [CocoaPods](https://cocoapods.org/pods/picoLLM-iOS). To import it into your iOS project, add the following line to your Podfile: +The picoLLM iOS binding is available via [Swift Package Manager](https://www.swift.org/documentation/package-manager/) or [CocoaPods](https://cocoapods.org/pods/picoLLM-iOS). +To import the package using SPM, open up your project's Package Dependencies in XCode and add: +``` +https://github.com/Picovoice/picollm.git +``` +To import it into your iOS project using CocoaPods, add the following line to your Podfile: + ```ruby pod 'picoLLM-iOS' ``` diff --git a/binding/ios/picoLLM-iOS.podspec b/binding/ios/picoLLM-iOS.podspec index 61ac4db..9272034 100644 --- a/binding/ios/picoLLM-iOS.podspec +++ b/binding/ios/picoLLM-iOS.podspec @@ -8,9 +8,9 @@ Pod::Spec.new do |s| <<-DESC picoLLM Inference Engine iOS SDK. DESC - s.homepage = 'https://github.com/Picovoice/picollm/tree/master/binding/ios' + s.homepage = 'https://github.com/Picovoice/picollm/tree/main/binding/ios' s.author = { 'Picovoice' => 'hello@picovoice.ai' } - s.source = { :git => "https://github.com/Picovoice/picollm.git", :tag => "picoLLM-iOS-v1.2.3" } + s.source = { :git => "https://github.com/Picovoice/picollm.git", :tag => s.version.to_s } s.ios.deployment_target = '16.0' s.swift_version = '5.0' s.vendored_frameworks = 'lib/ios/PvPicoLLM.xcframework' diff --git a/demo/ios/Chat/PicoLLMChatDemo.xcodeproj/project.pbxproj b/demo/ios/Chat/PicoLLMChatDemo.xcodeproj/project.pbxproj index 5127925..0b053eb 100644 --- a/demo/ios/Chat/PicoLLMChatDemo.xcodeproj/project.pbxproj +++ b/demo/ios/Chat/PicoLLMChatDemo.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ @@ -11,10 +11,11 @@ 02A1194B268D39A700A2AC99 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A1194A268D39A700A2AC99 /* ContentView.swift */; }; 02A1194D268D39AB00A2AC99 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 02A1194C268D39AB00A2AC99 /* Assets.xcassets */; }; 02A1195F268D3FD600A2AC99 /* ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A1195E268D3FD600A2AC99 /* ViewModel.swift */; }; - 3D2B8D90C4122A3A0C8C682D /* libPods-PicoLLMChatDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7231C033B41A0972F723C1A6 /* libPods-PicoLLMChatDemo.a */; }; C789D24B2BEA8E5D005FDB10 /* LoadModelView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C789D24A2BEA8E5D005FDB10 /* LoadModelView.swift */; }; C789D24D2BEA8EAE005FDB10 /* ChatView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C789D24C2BEA8EAE005FDB10 /* ChatView.swift */; }; C789D2512BEAD752005FDB10 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = C789D2502BEAD752005FDB10 /* Constants.swift */; }; + E1E0137E2D16114E00DB0C2F /* PicoLLM in Frameworks */ = {isa = PBXBuildFile; productRef = E1E0137D2D16114E00DB0C2F /* PicoLLM */; }; + E1E013842D162B3D00DB0C2F /* PicoLLM in Frameworks */ = {isa = PBXBuildFile; productRef = E1E013832D162B3D00DB0C2F /* PicoLLM */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -24,9 +25,6 @@ 02A1194C268D39AB00A2AC99 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 02A11951268D39AB00A2AC99 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 02A1195E268D3FD600A2AC99 /* ViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewModel.swift; sourceTree = ""; }; - 195F7C81D2A651BE1E18D367 /* Pods-PicoLLMChatDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PicoLLMChatDemo.debug.xcconfig"; path = "Target Support Files/Pods-PicoLLMChatDemo/Pods-PicoLLMChatDemo.debug.xcconfig"; sourceTree = ""; }; - 7231C033B41A0972F723C1A6 /* libPods-PicoLLMChatDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PicoLLMChatDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - B4721F6A98EC8D37F91281AB /* Pods-PicoLLMChatDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PicoLLMChatDemo.release.xcconfig"; path = "Target Support Files/Pods-PicoLLMChatDemo/Pods-PicoLLMChatDemo.release.xcconfig"; sourceTree = ""; }; C789D24A2BEA8E5D005FDB10 /* LoadModelView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadModelView.swift; sourceTree = ""; }; C789D24C2BEA8EAE005FDB10 /* ChatView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatView.swift; sourceTree = ""; }; C789D2502BEAD752005FDB10 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = ""; }; @@ -37,7 +35,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3D2B8D90C4122A3A0C8C682D /* libPods-PicoLLMChatDemo.a in Frameworks */, + E1E0137E2D16114E00DB0C2F /* PicoLLM in Frameworks */, + E1E013842D162B3D00DB0C2F /* PicoLLM in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -49,8 +48,6 @@ children = ( 02A11947268D39A700A2AC99 /* PicoLLMChatDemo */, 02A11946268D39A700A2AC99 /* Products */, - 8DB92FF3DC81AB04D3FF7242 /* Pods */, - F770462E5CFAB5B7D2E94AD8 /* Frameworks */, ); sourceTree = ""; }; @@ -77,23 +74,6 @@ path = PicoLLMChatDemo; sourceTree = ""; }; - 8DB92FF3DC81AB04D3FF7242 /* Pods */ = { - isa = PBXGroup; - children = ( - 195F7C81D2A651BE1E18D367 /* Pods-PicoLLMChatDemo.debug.xcconfig */, - B4721F6A98EC8D37F91281AB /* Pods-PicoLLMChatDemo.release.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; - F770462E5CFAB5B7D2E94AD8 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 7231C033B41A0972F723C1A6 /* libPods-PicoLLMChatDemo.a */, - ); - name = Frameworks; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -101,11 +81,9 @@ isa = PBXNativeTarget; buildConfigurationList = 02A11954268D39AB00A2AC99 /* Build configuration list for PBXNativeTarget "PicoLLMChatDemo" */; buildPhases = ( - 1F448DADB90CE82863E78546 /* [CP] Check Pods Manifest.lock */, 02A11941268D39A700A2AC99 /* Sources */, 02A11942268D39A700A2AC99 /* Frameworks */, 02A11943268D39A700A2AC99 /* Resources */, - FA42AEB90E30635F6CCC7782 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -140,6 +118,9 @@ Base, ); mainGroup = 02A1193C268D39A700A2AC99; + packageReferences = ( + E1E013822D162B3D00DB0C2F /* XCLocalSwiftPackageReference "../../../../picollm" */, + ); productRefGroup = 02A11946268D39A700A2AC99 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -160,48 +141,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - 1F448DADB90CE82863E78546 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-PicoLLMChatDemo-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - FA42AEB90E30635F6CCC7782 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-PicoLLMChatDemo/Pods-PicoLLMChatDemo-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-PicoLLMChatDemo/Pods-PicoLLMChatDemo-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PicoLLMChatDemo/Pods-PicoLLMChatDemo-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ 02A11941268D39A700A2AC99 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -339,13 +278,12 @@ }; 02A11955268D39AB00A2AC99 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 195F7C81D2A651BE1E18D367 /* Pods-PicoLLMChatDemo.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_ASSET_PATHS = ""; - DEVELOPMENT_TEAM = EU9HUJJU2X; + DEVELOPMENT_TEAM = 65723695GD; ENABLE_PREVIEWS = YES; ENABLE_USER_SCRIPT_SANDBOXING = NO; INFOPLIST_FILE = PicoLLMChatDemo/Info.plist; @@ -363,13 +301,12 @@ }; 02A11956268D39AB00A2AC99 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = B4721F6A98EC8D37F91281AB /* Pods-PicoLLMChatDemo.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_ASSET_PATHS = ""; - DEVELOPMENT_TEAM = EU9HUJJU2X; + DEVELOPMENT_TEAM = 65723695GD; ENABLE_PREVIEWS = YES; ENABLE_USER_SCRIPT_SANDBOXING = NO; INFOPLIST_FILE = PicoLLMChatDemo/Info.plist; @@ -407,6 +344,24 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + E1E013822D162B3D00DB0C2F /* XCLocalSwiftPackageReference "../../../../picollm" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = ../../../../picollm; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + E1E0137D2D16114E00DB0C2F /* PicoLLM */ = { + isa = XCSwiftPackageProductDependency; + productName = PicoLLM; + }; + E1E013832D162B3D00DB0C2F /* PicoLLM */ = { + isa = XCSwiftPackageProductDependency; + productName = PicoLLM; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 02A1193D268D39A700A2AC99 /* Project object */; } diff --git a/demo/ios/Chat/PicoLLMChatDemo/ViewModel.swift b/demo/ios/Chat/PicoLLMChatDemo/ViewModel.swift index 9146394..a07b651 100644 --- a/demo/ios/Chat/PicoLLMChatDemo/ViewModel.swift +++ b/demo/ios/Chat/PicoLLMChatDemo/ViewModel.swift @@ -9,6 +9,7 @@ import PicoLLM import Combine +import Foundation class ViewModel: ObservableObject { diff --git a/demo/ios/Chat/Podfile b/demo/ios/Chat/Podfile deleted file mode 100644 index 45e49a6..0000000 --- a/demo/ios/Chat/Podfile +++ /dev/null @@ -1,6 +0,0 @@ -source 'https://cdn.cocoapods.org/' -platform :ios, '16.0' - -target 'PicoLLMChatDemo' do - pod 'picoLLM-iOS', :podspec => 'https://raw.githubusercontent.com/Picovoice/picollm/refs/heads/v1.2.3/binding/ios/picoLLM-iOS.podspec' -end \ No newline at end of file diff --git a/demo/ios/Chat/Podfile.lock b/demo/ios/Chat/Podfile.lock deleted file mode 100644 index c0de5d7..0000000 --- a/demo/ios/Chat/Podfile.lock +++ /dev/null @@ -1,16 +0,0 @@ -PODS: - - picoLLM-iOS (1.2.2) - -DEPENDENCIES: - - picoLLM-iOS (~> 1.2.2) - -SPEC REPOS: - trunk: - - picoLLM-iOS - -SPEC CHECKSUMS: - picoLLM-iOS: 21f92b131dab066b63365f612222c46d04cf3141 - -PODFILE CHECKSUM: 2e5a6651f42b19fdf6b6332b7e013191cff71918 - -COCOAPODS: 1.15.2 diff --git a/demo/ios/Completion/PicoLLMCompletionDemo.xcodeproj/project.pbxproj b/demo/ios/Completion/PicoLLMCompletionDemo.xcodeproj/project.pbxproj index f9e766b..a78961b 100644 --- a/demo/ios/Completion/PicoLLMCompletionDemo.xcodeproj/project.pbxproj +++ b/demo/ios/Completion/PicoLLMCompletionDemo.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ @@ -11,11 +11,11 @@ 02A1194B268D39A700A2AC99 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A1194A268D39A700A2AC99 /* ContentView.swift */; }; 02A1194D268D39AB00A2AC99 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 02A1194C268D39AB00A2AC99 /* Assets.xcassets */; }; 02A1195F268D3FD600A2AC99 /* ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A1195E268D3FD600A2AC99 /* ViewModel.swift */; }; - 3C4D5033D20F3FDD2E9185C2 /* libPods-PicoLLMCompletionDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 70BD182327BB17BA8130F34E /* libPods-PicoLLMCompletionDemo.a */; }; C789D2492BEA8D26005FDB10 /* SidebarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C789D2482BEA8D26005FDB10 /* SidebarView.swift */; }; C789D24B2BEA8E5D005FDB10 /* LoadModelView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C789D24A2BEA8E5D005FDB10 /* LoadModelView.swift */; }; C789D24D2BEA8EAE005FDB10 /* CompletionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C789D24C2BEA8EAE005FDB10 /* CompletionView.swift */; }; C789D2512BEAD752005FDB10 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = C789D2502BEAD752005FDB10 /* Constants.swift */; }; + E1E013812D1612E800DB0C2F /* PicoLLM in Frameworks */ = {isa = PBXBuildFile; productRef = E1E013802D1612E800DB0C2F /* PicoLLM */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -25,9 +25,6 @@ 02A1194C268D39AB00A2AC99 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 02A11951268D39AB00A2AC99 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 02A1195E268D3FD600A2AC99 /* ViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewModel.swift; sourceTree = ""; }; - 38E6CF52FF6B3E0120A1960A /* Pods-PicoLLMCompletionDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PicoLLMCompletionDemo.release.xcconfig"; path = "Target Support Files/Pods-PicoLLMCompletionDemo/Pods-PicoLLMCompletionDemo.release.xcconfig"; sourceTree = ""; }; - 4380C983EB006A338D3FA583 /* Pods-PicoLLMCompletionDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PicoLLMCompletionDemo.debug.xcconfig"; path = "Target Support Files/Pods-PicoLLMCompletionDemo/Pods-PicoLLMCompletionDemo.debug.xcconfig"; sourceTree = ""; }; - 70BD182327BB17BA8130F34E /* libPods-PicoLLMCompletionDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PicoLLMCompletionDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; C789D2482BEA8D26005FDB10 /* SidebarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SidebarView.swift; sourceTree = ""; }; C789D24A2BEA8E5D005FDB10 /* LoadModelView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadModelView.swift; sourceTree = ""; }; C789D24C2BEA8EAE005FDB10 /* CompletionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompletionView.swift; sourceTree = ""; }; @@ -39,7 +36,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3C4D5033D20F3FDD2E9185C2 /* libPods-PicoLLMCompletionDemo.a in Frameworks */, + E1E013812D1612E800DB0C2F /* PicoLLM in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -51,8 +48,6 @@ children = ( 02A11947268D39A700A2AC99 /* PicoLLMCompletionDemo */, 02A11946268D39A700A2AC99 /* Products */, - 8DB92FF3DC81AB04D3FF7242 /* Pods */, - 87BDCEFF73B03E32BDF5463B /* Frameworks */, ); sourceTree = ""; }; @@ -80,23 +75,6 @@ path = PicoLLMCompletionDemo; sourceTree = ""; }; - 87BDCEFF73B03E32BDF5463B /* Frameworks */ = { - isa = PBXGroup; - children = ( - 70BD182327BB17BA8130F34E /* libPods-PicoLLMCompletionDemo.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 8DB92FF3DC81AB04D3FF7242 /* Pods */ = { - isa = PBXGroup; - children = ( - 4380C983EB006A338D3FA583 /* Pods-PicoLLMCompletionDemo.debug.xcconfig */, - 38E6CF52FF6B3E0120A1960A /* Pods-PicoLLMCompletionDemo.release.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -104,11 +82,9 @@ isa = PBXNativeTarget; buildConfigurationList = 02A11954268D39AB00A2AC99 /* Build configuration list for PBXNativeTarget "PicoLLMCompletionDemo" */; buildPhases = ( - DBA5BC7A7A75CABA57760F8A /* [CP] Check Pods Manifest.lock */, 02A11941268D39A700A2AC99 /* Sources */, 02A11942268D39A700A2AC99 /* Frameworks */, 02A11943268D39A700A2AC99 /* Resources */, - 197A83DFE9D0D1EB48085417 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -142,6 +118,9 @@ Base, ); mainGroup = 02A1193C268D39A700A2AC99; + packageReferences = ( + E1E0137F2D1612E800DB0C2F /* XCLocalSwiftPackageReference "../../../../picollm" */, + ); productRefGroup = 02A11946268D39A700A2AC99 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -162,48 +141,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - 197A83DFE9D0D1EB48085417 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-PicoLLMCompletionDemo/Pods-PicoLLMCompletionDemo-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-PicoLLMCompletionDemo/Pods-PicoLLMCompletionDemo-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PicoLLMCompletionDemo/Pods-PicoLLMCompletionDemo-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - DBA5BC7A7A75CABA57760F8A /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-PicoLLMCompletionDemo-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ 02A11941268D39A700A2AC99 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -340,13 +277,12 @@ }; 02A11955268D39AB00A2AC99 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 4380C983EB006A338D3FA583 /* Pods-PicoLLMCompletionDemo.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_ASSET_PATHS = ""; - DEVELOPMENT_TEAM = EU9HUJJU2X; + DEVELOPMENT_TEAM = 65723695GD; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = PicoLLMCompletionDemo/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.0; @@ -363,13 +299,12 @@ }; 02A11956268D39AB00A2AC99 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 38E6CF52FF6B3E0120A1960A /* Pods-PicoLLMCompletionDemo.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_ASSET_PATHS = ""; - DEVELOPMENT_TEAM = EU9HUJJU2X; + DEVELOPMENT_TEAM = 65723695GD; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = PicoLLMCompletionDemo/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.0; @@ -406,6 +341,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + E1E0137F2D1612E800DB0C2F /* XCLocalSwiftPackageReference "../../../../picollm" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = ../../../../picollm; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + E1E013802D1612E800DB0C2F /* PicoLLM */ = { + isa = XCSwiftPackageProductDependency; + productName = PicoLLM; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 02A1193D268D39A700A2AC99 /* Project object */; } diff --git a/demo/ios/Completion/PicoLLMCompletionDemo/ViewModel.swift b/demo/ios/Completion/PicoLLMCompletionDemo/ViewModel.swift index 2261bad..4b604ec 100644 --- a/demo/ios/Completion/PicoLLMCompletionDemo/ViewModel.swift +++ b/demo/ios/Completion/PicoLLMCompletionDemo/ViewModel.swift @@ -9,6 +9,7 @@ import PicoLLM import Combine +import Foundation class ViewModel: ObservableObject { diff --git a/demo/ios/Completion/Podfile b/demo/ios/Completion/Podfile deleted file mode 100644 index dd73c41..0000000 --- a/demo/ios/Completion/Podfile +++ /dev/null @@ -1,6 +0,0 @@ -source 'https://cdn.cocoapods.org/' -platform :ios, '16.0' - -target 'PicoLLMCompletionDemo' do - pod 'picoLLM-iOS', :podspec => 'https://raw.githubusercontent.com/Picovoice/picollm/refs/heads/v1.2.3/binding/ios/picoLLM-iOS.podspec' -end diff --git a/demo/ios/Completion/Podfile.lock b/demo/ios/Completion/Podfile.lock deleted file mode 100644 index 50a17ed..0000000 --- a/demo/ios/Completion/Podfile.lock +++ /dev/null @@ -1,16 +0,0 @@ -PODS: - - picoLLM-iOS (1.2.2) - -DEPENDENCIES: - - picoLLM-iOS (~> 1.2.2) - -SPEC REPOS: - trunk: - - picoLLM-iOS - -SPEC CHECKSUMS: - picoLLM-iOS: 21f92b131dab066b63365f612222c46d04cf3141 - -PODFILE CHECKSUM: 771cb4ad028915be50c77396de5c3c8389345f34 - -COCOAPODS: 1.15.2 diff --git a/demo/ios/README.md b/demo/ios/README.md index 457e01d..053f198 100644 --- a/demo/ios/README.md +++ b/demo/ios/README.md @@ -78,9 +78,9 @@ conversation with the LLM, similar to ChatGPT. pod install ``` -2. Open the `PicoLLMCompletionDemo.xcworkspace` in XCode +2. Open the `PicoLLMCompletionDemo.xcodeproj` in XCode -3. Replace `let ACCESS_KEY = "${YOUR_ACCESS_KEY_HERE}"` in the file [VieModel.swift](./Completion/PicoLLMCompletionDemo/ViewModel.swift) with your AccessKey obtained from [Picovoice Console](https://console.picovoice.ai/). +3. Replace `"${YOUR_ACCESS_KEY_HERE}"` in the file [VieModel.swift](./Completion/PicoLLMCompletionDemo/ViewModel.swift) with your AccessKey obtained from [Picovoice Console](https://console.picovoice.ai/). 4. Build and run the project on your device. @@ -98,7 +98,7 @@ pod install pod install ``` -2. Open the `PicoLLMChatDemo.xcworkspace` in XCode +2. Open the `PicoLLMChatDemo.xcodeproj` in XCode 3. Replace `let ACCESS_KEY = "${YOUR_ACCESS_KEY_HERE}"` in the file [VieModel.swift](./Chat/PicoLLMChatDemo/ViewModel.swift) with your AccessKey obtained from [Picovoice Console](https://console.picovoice.ai/). diff --git a/resources/.lint/spell-check/dict.txt b/resources/.lint/spell-check/dict.txt index 142a4d7..53d70eb 100644 --- a/resources/.lint/spell-check/dict.txt +++ b/resources/.lint/spell-check/dict.txt @@ -70,5 +70,6 @@ drawerlayout Unmanaged Unretained Podfile +xcodeproj xcworkspace webgpu