From a668cf4a2c833156cc06e073db95998e927e22e1 Mon Sep 17 00:00:00 2001 From: Ryan Heise Date: Tue, 4 Feb 2025 01:21:07 +1100 Subject: [PATCH] Fix SwiftPM support on macOS. --- just_audio/CHANGELOG.md | 4 ++ .../include/just_audio/AudioPlayer.h | 2 +- .../include/just_audio/AudioSource.h | 1 + .../include/just_audio/BetterEventChannel.h | 1 + .../include/just_audio/ClippingAudioSource.h | 1 + .../just_audio/ConcatenatingAudioSource.h | 1 + .../include/just_audio/IndexedAudioSource.h | 2 +- .../include/just_audio/JustAudioPlugin.h | 1 + .../include/just_audio/LoopingAudioSource.h | 1 + .../include/just_audio/UriAudioSource.h | 1 + .../macos/Runner.xcodeproj/project.pbxproj | 45 +++++++++---------- .../xcshareddata/xcschemes/Runner.xcscheme | 18 ++++++++ just_audio/example/pubspec.yaml | 2 +- just_audio/pubspec.yaml | 2 +- 14 files changed, 55 insertions(+), 27 deletions(-) diff --git a/just_audio/CHANGELOG.md b/just_audio/CHANGELOG.md index 0572b63f6..b82e8e2f5 100644 --- a/just_audio/CHANGELOG.md +++ b/just_audio/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.9.46 + +* Fix SwiftPM support on macOS. + ## 0.9.45 * Add setWebSinkId for web (@dganzella). diff --git a/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/AudioPlayer.h b/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/AudioPlayer.h index 3538be34a..ae402b4b1 100644 --- a/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/AudioPlayer.h +++ b/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/AudioPlayer.h @@ -1,9 +1,9 @@ +#import #if TARGET_OS_OSX #import #else #import #endif -#import @interface AudioPlayer : NSObject diff --git a/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/AudioSource.h b/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/AudioSource.h index b23811195..b07371bd8 100644 --- a/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/AudioSource.h +++ b/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/AudioSource.h @@ -1,3 +1,4 @@ +#import #if TARGET_OS_OSX #import #else diff --git a/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/BetterEventChannel.h b/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/BetterEventChannel.h index 7974f0268..999395d08 100644 --- a/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/BetterEventChannel.h +++ b/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/BetterEventChannel.h @@ -1,3 +1,4 @@ +#import #if TARGET_OS_OSX #import #else diff --git a/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/ClippingAudioSource.h b/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/ClippingAudioSource.h index 47863f45c..cccb49855 100644 --- a/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/ClippingAudioSource.h +++ b/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/ClippingAudioSource.h @@ -1,5 +1,6 @@ #import "AudioSource.h" #import "UriAudioSource.h" +#import #if TARGET_OS_OSX #import #else diff --git a/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/ConcatenatingAudioSource.h b/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/ConcatenatingAudioSource.h index 359e6e89c..07c5bc1ab 100644 --- a/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/ConcatenatingAudioSource.h +++ b/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/ConcatenatingAudioSource.h @@ -1,4 +1,5 @@ #import "AudioSource.h" +#import #if TARGET_OS_OSX #import #else diff --git a/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/IndexedAudioSource.h b/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/IndexedAudioSource.h index a46b02a48..5e560f1cb 100644 --- a/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/IndexedAudioSource.h +++ b/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/IndexedAudioSource.h @@ -1,11 +1,11 @@ #import "AudioSource.h" #import "IndexedPlayerItem.h" +#import #if TARGET_OS_OSX #import #else #import #endif -#import @interface IndexedAudioSource : AudioSource diff --git a/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/JustAudioPlugin.h b/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/JustAudioPlugin.h index ada737102..bdb94e742 100644 --- a/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/JustAudioPlugin.h +++ b/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/JustAudioPlugin.h @@ -1,3 +1,4 @@ +#import #if TARGET_OS_OSX #import #else diff --git a/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/LoopingAudioSource.h b/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/LoopingAudioSource.h index dab706196..ce6e4b163 100644 --- a/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/LoopingAudioSource.h +++ b/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/LoopingAudioSource.h @@ -1,4 +1,5 @@ #import "AudioSource.h" +#import #if TARGET_OS_OSX #import #else diff --git a/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/UriAudioSource.h b/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/UriAudioSource.h index 2a8050999..ddf380439 100644 --- a/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/UriAudioSource.h +++ b/just_audio/darwin/just_audio/Sources/just_audio/include/just_audio/UriAudioSource.h @@ -1,5 +1,6 @@ #import "IndexedAudioSource.h" #import "LoadControl.h" +#import #if TARGET_OS_OSX #import #else diff --git a/just_audio/example/macos/Runner.xcodeproj/project.pbxproj b/just_audio/example/macos/Runner.xcodeproj/project.pbxproj index f635c2bd5..2bdc1f71e 100644 --- a/just_audio/example/macos/Runner.xcodeproj/project.pbxproj +++ b/just_audio/example/macos/Runner.xcodeproj/project.pbxproj @@ -27,6 +27,7 @@ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -80,6 +81,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, 1BEEF829E111499DFFB9AFA4 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -184,7 +186,6 @@ 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - 31D443903C4E40636BA59DB3 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -192,6 +193,9 @@ 33CC11202044C79F0003C045 /* PBXTargetDependency */, ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 33CC10ED2044A3C60003C045 /* example.app */; productType = "com.apple.product-type.application"; @@ -231,6 +235,9 @@ Base, ); mainGroup = 33CC10E42044A3C60003C045; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -276,28 +283,6 @@ 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; }; - 31D443903C4E40636BA59DB3 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/audio_session/audio_session.framework", - "${BUILT_PRODUCTS_DIR}/just_audio/just_audio.framework", - "${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/audio_session.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/just_audio.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -645,6 +630,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 33CC10E52044A3C60003C045 /* Project object */; } diff --git a/just_audio/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/just_audio/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index bfbc9cb8e..8de585b49 100644 --- a/just_audio/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/just_audio/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + +