diff --git a/binding/ios/Eagle.swift b/binding/ios/Eagle.swift index 6a6fa94..ffddd25 100644 --- a/binding/ios/Eagle.swift +++ b/binding/ios/Eagle.swift @@ -37,12 +37,26 @@ public class Eagle: EagleBase { var modelPathArg = modelPath if modelPath == nil { + +#if SWIFT_PACKAGE + + if let bundleURL = Bundle.module.url(forResource: "eagle_params", withExtension: "pv") { + modelPathArg = bundleURL.path + } else { + throw EagleIOError("Could not retrieve default model from the package bundle") + } + +#else + let bundle = Bundle(for: type(of: self)) modelPathArg = bundle.path(forResource: "eagle_params", ofType: "pv") if modelPathArg == nil { throw EagleIOError("Could not retrieve default model from app bundle") } + +#endif + } if !FileManager().fileExists(atPath: modelPathArg!) { diff --git a/binding/ios/EagleAppTest/EagleAppTest.xcodeproj/project.pbxproj b/binding/ios/EagleAppTest/EagleAppTest.xcodeproj/project.pbxproj index 61b7961..3f5df38 100644 --- a/binding/ios/EagleAppTest/EagleAppTest.xcodeproj/project.pbxproj +++ b/binding/ios/EagleAppTest/EagleAppTest.xcodeproj/project.pbxproj @@ -14,13 +14,13 @@ 1E0064D427CEEA66006FF6E9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1E0064D227CEEA66006FF6E9 /* LaunchScreen.storyboard */; }; 1E00654627CFF260006FF6E9 /* EagleAppTestUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E0064E827CEEA66006FF6E9 /* EagleAppTestUITests.swift */; }; 1E5B7B042800D9BE00F8BDDB /* PerformanceTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E5B7B032800D9BE00F8BDDB /* PerformanceTest.swift */; }; - 36696536961DE78B3E1C06FA /* BuildFile in Frameworks */ = {isa = PBXBuildFile; }; + 36696536961DE78B3E1C06FA /* (null) in Frameworks */ = {isa = PBXBuildFile; }; C757D8CD28A1C77100F391C8 /* BaseTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = C757D8CB28A1C77100F391C8 /* BaseTest.swift */; }; C790A6FB2A2012C40074FF7A /* audio_samples in Resources */ = {isa = PBXBuildFile; fileRef = C790A6FA2A2012C40074FF7A /* audio_samples */; }; C790A6FC2A2012C40074FF7A /* audio_samples in Resources */ = {isa = PBXBuildFile; fileRef = C790A6FA2A2012C40074FF7A /* audio_samples */; }; - E17FFF042CFE3B3E00AA5CA9 /* Eagle in Frameworks */ = {isa = PBXBuildFile; productRef = E17FFF032CFE3B3E00AA5CA9 /* Eagle */; }; - E17FFF062CFE3B4300AA5CA9 /* Eagle in Frameworks */ = {isa = PBXBuildFile; productRef = E17FFF052CFE3B4300AA5CA9 /* Eagle */; }; - E17FFF082CFE3B4600AA5CA9 /* Eagle in Frameworks */ = {isa = PBXBuildFile; productRef = E17FFF072CFE3B4600AA5CA9 /* Eagle */; }; + E173C8FE2CFE43C900A0903C /* Eagle in Frameworks */ = {isa = PBXBuildFile; productRef = E173C8FD2CFE43C900A0903C /* Eagle */; }; + E173C9002CFE43CF00A0903C /* Eagle in Frameworks */ = {isa = PBXBuildFile; productRef = E173C8FF2CFE43CF00A0903C /* Eagle */; }; + E173C9022CFE43D400A0903C /* Eagle in Frameworks */ = {isa = PBXBuildFile; productRef = E173C9012CFE43D400A0903C /* Eagle */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -63,7 +63,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - E17FFF042CFE3B3E00AA5CA9 /* Eagle in Frameworks */, + E173C8FE2CFE43C900A0903C /* Eagle in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -71,8 +71,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 36696536961DE78B3E1C06FA /* BuildFile in Frameworks */, - E17FFF062CFE3B4300AA5CA9 /* Eagle in Frameworks */, + 36696536961DE78B3E1C06FA /* (null) in Frameworks */, + E173C9002CFE43CF00A0903C /* Eagle in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -80,7 +80,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - E17FFF082CFE3B4600AA5CA9 /* Eagle in Frameworks */, + E173C9022CFE43D400A0903C /* Eagle in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -93,6 +93,7 @@ 1E5B7B022800D9A500F8BDDB /* PerformanceTest */, 1E0064C627CEEA65006FF6E9 /* EagleAppTest */, 1E0064E727CEEA66006FF6E9 /* EagleAppTestUITests */, + E173C8FC2CFE43C900A0903C /* Frameworks */, 1E0064C527CEEA65006FF6E9 /* Products */, ); sourceTree = ""; @@ -140,6 +141,13 @@ path = PerformanceTest; sourceTree = ""; }; + E173C8FC2CFE43C900A0903C /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -229,7 +237,7 @@ ); mainGroup = 1E0064BB27CEEA65006FF6E9; packageReferences = ( - E17FFF012CFE3B3200AA5CA9 /* XCLocalSwiftPackageReference "eagle" */, + E173C8FB2CFE40F000A0903C /* XCLocalSwiftPackageReference "../../../../eagle" */, ); productRefGroup = 1E0064C527CEEA65006FF6E9 /* Products */; projectDirPath = ""; @@ -644,26 +652,26 @@ /* End XCConfigurationList section */ /* Begin XCLocalSwiftPackageReference section */ - E17FFF012CFE3B3200AA5CA9 /* XCLocalSwiftPackageReference "eagle" */ = { + E173C8FB2CFE40F000A0903C /* XCLocalSwiftPackageReference "../../../../eagle" */ = { isa = XCLocalSwiftPackageReference; relativePath = ../../../../eagle; }; /* End XCLocalSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - E17FFF032CFE3B3E00AA5CA9 /* Eagle */ = { + E173C8FD2CFE43C900A0903C /* Eagle */ = { isa = XCSwiftPackageProductDependency; - package = E17FFF012CFE3B3200AA5CA9 /* XCLocalSwiftPackageReference "eagle" */; + package = E173C8FB2CFE40F000A0903C /* XCLocalSwiftPackageReference "../../../../eagle" */; productName = Eagle; }; - E17FFF052CFE3B4300AA5CA9 /* Eagle */ = { + E173C8FF2CFE43CF00A0903C /* Eagle */ = { isa = XCSwiftPackageProductDependency; - package = E17FFF012CFE3B3200AA5CA9 /* XCLocalSwiftPackageReference "eagle" */; + package = E173C8FB2CFE40F000A0903C /* XCLocalSwiftPackageReference "../../../../eagle" */; productName = Eagle; }; - E17FFF072CFE3B4600AA5CA9 /* Eagle */ = { + E173C9012CFE43D400A0903C /* Eagle */ = { isa = XCSwiftPackageProductDependency; - package = E17FFF012CFE3B3200AA5CA9 /* XCLocalSwiftPackageReference "eagle" */; + package = E173C8FB2CFE40F000A0903C /* XCLocalSwiftPackageReference "../../../../eagle" */; productName = Eagle; }; /* End XCSwiftPackageProductDependency section */