From ac40901e680cf11482b48d125ade7f753494af43 Mon Sep 17 00:00:00 2001 From: Ian Saultz <52051793+atierian@users.noreply.github.com> Date: Mon, 9 Oct 2023 14:17:59 -0400 Subject: [PATCH] link necessary libraries in predictions test targets --- .../project.pbxproj | 86 +++++++++++++++++++ .../PredictionsHostApp/ContentView.swift | 66 -------------- 2 files changed, 86 insertions(+), 66 deletions(-) diff --git a/AmplifyPlugins/Predictions/Tests/PredictionsHostApp/PredictionsHostApp.xcodeproj/project.pbxproj b/AmplifyPlugins/Predictions/Tests/PredictionsHostApp/PredictionsHostApp.xcodeproj/project.pbxproj index ba091df90b..cdd34b7658 100644 --- a/AmplifyPlugins/Predictions/Tests/PredictionsHostApp/PredictionsHostApp.xcodeproj/project.pbxproj +++ b/AmplifyPlugins/Predictions/Tests/PredictionsHostApp/PredictionsHostApp.xcodeproj/project.pbxproj @@ -52,6 +52,18 @@ 90542370291425630000D108 /* testImageCeleb.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 90542363291425630000D108 /* testImageCeleb.jpg */; }; 90542371291425630000D108 /* testImageTextForms.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 90542364291425630000D108 /* testImageTextForms.jpg */; }; 90542372291425630000D108 /* audio.wav in Resources */ = {isa = PBXBuildFile; fileRef = 90542365291425630000D108 /* audio.wav */; }; + 90CF304A2AD47A71006B6FF3 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF30492AD47A71006B6FF3 /* Amplify */; }; + 90CF304C2AD47A74006B6FF3 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF304B2AD47A74006B6FF3 /* Amplify */; }; + 90CF304E2AD47A78006B6FF3 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF304D2AD47A78006B6FF3 /* Amplify */; }; + 90CF30502AD47B0E006B6FF3 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF304F2AD47B0E006B6FF3 /* AWSCognitoAuthPlugin */; }; + 90CF30522AD47B0E006B6FF3 /* AWSPredictionsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF30512AD47B0E006B6FF3 /* AWSPredictionsPlugin */; }; + 90CF30542AD47B0E006B6FF3 /* CoreMLPredictionsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF30532AD47B0E006B6FF3 /* CoreMLPredictionsPlugin */; }; + 90CF30562AD47B19006B6FF3 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF30552AD47B19006B6FF3 /* AWSCognitoAuthPlugin */; }; + 90CF30582AD47B19006B6FF3 /* AWSPredictionsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF30572AD47B19006B6FF3 /* AWSPredictionsPlugin */; }; + 90CF305A2AD47B19006B6FF3 /* CoreMLPredictionsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF30592AD47B19006B6FF3 /* CoreMLPredictionsPlugin */; }; + 90CF305C2AD47B24006B6FF3 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF305B2AD47B24006B6FF3 /* AWSCognitoAuthPlugin */; }; + 90CF305E2AD47B24006B6FF3 /* AWSPredictionsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF305D2AD47B24006B6FF3 /* AWSPredictionsPlugin */; }; + 90CF30602AD47B24006B6FF3 /* CoreMLPredictionsPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 90CF305F2AD47B24006B6FF3 /* CoreMLPredictionsPlugin */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -125,6 +137,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 90CF30602AD47B24006B6FF3 /* CoreMLPredictionsPlugin in Frameworks */, + 90CF304E2AD47A78006B6FF3 /* Amplify in Frameworks */, + 90CF305E2AD47B24006B6FF3 /* AWSPredictionsPlugin in Frameworks */, + 90CF305C2AD47B24006B6FF3 /* AWSCognitoAuthPlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -143,6 +159,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 90CF30542AD47B0E006B6FF3 /* CoreMLPredictionsPlugin in Frameworks */, + 90CF304A2AD47A71006B6FF3 /* Amplify in Frameworks */, + 90CF30522AD47B0E006B6FF3 /* AWSPredictionsPlugin in Frameworks */, + 90CF30502AD47B0E006B6FF3 /* AWSCognitoAuthPlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -150,6 +170,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 90CF305A2AD47B19006B6FF3 /* CoreMLPredictionsPlugin in Frameworks */, + 90CF304C2AD47A74006B6FF3 /* Amplify in Frameworks */, + 90CF30582AD47B19006B6FF3 /* AWSPredictionsPlugin in Frameworks */, + 90CF30562AD47B19006B6FF3 /* AWSCognitoAuthPlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -312,6 +336,10 @@ ); name = AWSPredictionsPluginIntegrationTestsWatch; packageProductDependencies = ( + 90CF304D2AD47A78006B6FF3 /* Amplify */, + 90CF305B2AD47B24006B6FF3 /* AWSCognitoAuthPlugin */, + 90CF305D2AD47B24006B6FF3 /* AWSPredictionsPlugin */, + 90CF305F2AD47B24006B6FF3 /* CoreMLPredictionsPlugin */, ); productName = AWSPredictionsPluginIntegrationTests; productReference = 6875F9242A3CCCB7001C9AAF /* AWSPredictionsPluginIntegrationTestsWatch.xctest */; @@ -355,6 +383,12 @@ 90283038291402D500897087 /* PBXTargetDependency */, ); name = CoreMLPredictionsPluginIntegrationTests; + packageProductDependencies = ( + 90CF30492AD47A71006B6FF3 /* Amplify */, + 90CF304F2AD47B0E006B6FF3 /* AWSCognitoAuthPlugin */, + 90CF30512AD47B0E006B6FF3 /* AWSPredictionsPlugin */, + 90CF30532AD47B0E006B6FF3 /* CoreMLPredictionsPlugin */, + ); productName = CoreMLPredictionsPluginIntegrationTests; productReference = 90283033291402D500897087 /* CoreMLPredictionsPluginIntegrationTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; @@ -374,6 +408,10 @@ ); name = AWSPredictionsPluginIntegrationTests; packageProductDependencies = ( + 90CF304B2AD47A74006B6FF3 /* Amplify */, + 90CF30552AD47B19006B6FF3 /* AWSCognitoAuthPlugin */, + 90CF30572AD47B19006B6FF3 /* AWSPredictionsPlugin */, + 90CF30592AD47B19006B6FF3 /* CoreMLPredictionsPlugin */, ); productName = AWSPredictionsPluginIntegrationTests; productReference = 903555F829141355004B83C2 /* AWSPredictionsPluginIntegrationTests.xctest */; @@ -1118,6 +1156,54 @@ isa = XCSwiftPackageProductDependency; productName = CoreMLPredictionsPlugin; }; + 90CF30492AD47A71006B6FF3 /* Amplify */ = { + isa = XCSwiftPackageProductDependency; + productName = Amplify; + }; + 90CF304B2AD47A74006B6FF3 /* Amplify */ = { + isa = XCSwiftPackageProductDependency; + productName = Amplify; + }; + 90CF304D2AD47A78006B6FF3 /* Amplify */ = { + isa = XCSwiftPackageProductDependency; + productName = Amplify; + }; + 90CF304F2AD47B0E006B6FF3 /* AWSCognitoAuthPlugin */ = { + isa = XCSwiftPackageProductDependency; + productName = AWSCognitoAuthPlugin; + }; + 90CF30512AD47B0E006B6FF3 /* AWSPredictionsPlugin */ = { + isa = XCSwiftPackageProductDependency; + productName = AWSPredictionsPlugin; + }; + 90CF30532AD47B0E006B6FF3 /* CoreMLPredictionsPlugin */ = { + isa = XCSwiftPackageProductDependency; + productName = CoreMLPredictionsPlugin; + }; + 90CF30552AD47B19006B6FF3 /* AWSCognitoAuthPlugin */ = { + isa = XCSwiftPackageProductDependency; + productName = AWSCognitoAuthPlugin; + }; + 90CF30572AD47B19006B6FF3 /* AWSPredictionsPlugin */ = { + isa = XCSwiftPackageProductDependency; + productName = AWSPredictionsPlugin; + }; + 90CF30592AD47B19006B6FF3 /* CoreMLPredictionsPlugin */ = { + isa = XCSwiftPackageProductDependency; + productName = CoreMLPredictionsPlugin; + }; + 90CF305B2AD47B24006B6FF3 /* AWSCognitoAuthPlugin */ = { + isa = XCSwiftPackageProductDependency; + productName = AWSCognitoAuthPlugin; + }; + 90CF305D2AD47B24006B6FF3 /* AWSPredictionsPlugin */ = { + isa = XCSwiftPackageProductDependency; + productName = AWSPredictionsPlugin; + }; + 90CF305F2AD47B24006B6FF3 /* CoreMLPredictionsPlugin */ = { + isa = XCSwiftPackageProductDependency; + productName = CoreMLPredictionsPlugin; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 90282FFA2914027000897087 /* Project object */; diff --git a/AmplifyPlugins/Predictions/Tests/PredictionsHostApp/PredictionsHostApp/ContentView.swift b/AmplifyPlugins/Predictions/Tests/PredictionsHostApp/PredictionsHostApp/ContentView.swift index 3af450c8a8..f5b0b64765 100644 --- a/AmplifyPlugins/Predictions/Tests/PredictionsHostApp/PredictionsHostApp/ContentView.swift +++ b/AmplifyPlugins/Predictions/Tests/PredictionsHostApp/PredictionsHostApp/ContentView.swift @@ -9,8 +9,6 @@ import SwiftUI import Amplify struct ContentView: View { - - var body: some View { VStack { Image(systemName: "globe") @@ -22,70 +20,6 @@ struct ContentView: View { .accessibilityLabel("foobar") .padding() } - - func convert() async throws { - let url = URL(string: "")! - let textToSpeech = try await Amplify.Predictions.convert(.textToSpeech("hello, world!")) - _ = textToSpeech - let speechToText = try await Amplify.Predictions.convert(.speechToText(url: url)) - _ = speechToText - } - - func identify() async throws { - let imageURL = URL(string: "")! - let identifyTextOptions = Predictions.Identify.Options( - defaultNetworkPolicy: .auto, - uploadToRemote: false, - pluginOptions: nil - ) - - let text = try await Amplify.Predictions.identify( - .text, - in: imageURL, - options: identifyTextOptions - ) - - _ = text - let celebrities = try await Amplify.Predictions.identify(.celebrities, in: imageURL) - _ = celebrities - let entities = try await Amplify.Predictions.identify(.entities, in: imageURL) - _ = entities - let entitiesFromCollection = try await Amplify.Predictions.identify( - .entitiesFromCollection(withID: ""), - in: imageURL - ) - _ = entitiesFromCollection - let allLabels = try await Amplify.Predictions.identify( - .labels(type: .all), - in: imageURL - ) - _ = allLabels - let labels = try await Amplify.Predictions.identify( - .labels(type: .labels), - in: imageURL - ) - _ = labels - let moderationLabels = try await Amplify.Predictions.identify( - .labels(type: .moderation), - in: imageURL - ) - _ = moderationLabels - let textFromDocAll = try await Amplify.Predictions.identify( - .textInDocument(textFormatType: .all), - in: imageURL - ) - _ = textFromDocAll - let textFromDocForm = try await Amplify.Predictions.identify( - .textInDocument(textFormatType: .form), - in: imageURL - ) - _ = textFromDocForm - let textFromDocTable = try await Amplify.Predictions.identify( - .textInDocument(textFormatType: .table), - in: imageURL - ) - _ = textFromDocTable - } } struct ContentView_Previews: PreviewProvider {