From ef756dabab117164f549a4824bb8a42c0e35dc28 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Tue, 21 May 2024 16:10:44 -0400 Subject: [PATCH] [interactive_media_ads] Add SPM support (#6756) Restructures the placeholder iOS implementation to follow the Swift Package Manager layout, and enables SPM support. Also marks the plugin as unpublished since it's not ready for incremental changes to be published yet. Fixes https://github.com/flutter/flutter/issues/146906 --- packages/interactive_media_ads/CHANGELOG.md | 4 +++ .../ios/interactive_media_ads.podspec | 4 +-- .../ios/interactive_media_ads/Package.swift | 28 +++++++++++++++++++ .../InteractiveMediaAdsPlugin.swift | 0 .../Resources/PrivacyInfo.xcprivacy | 0 packages/interactive_media_ads/pubspec.yaml | 2 +- 6 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 packages/interactive_media_ads/ios/interactive_media_ads/Package.swift rename packages/interactive_media_ads/ios/{Classes => interactive_media_ads/Sources/interactive_media_ads}/InteractiveMediaAdsPlugin.swift (100%) rename packages/interactive_media_ads/ios/{ => interactive_media_ads/Sources/interactive_media_ads}/Resources/PrivacyInfo.xcprivacy (100%) diff --git a/packages/interactive_media_ads/CHANGELOG.md b/packages/interactive_media_ads/CHANGELOG.md index 477158a8871e9..e52ec79d88660 100644 --- a/packages/interactive_media_ads/CHANGELOG.md +++ b/packages/interactive_media_ads/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.1+1 + +* Adds Swift Package Manager support. + ## 0.0.1 * Adds platform interface for Android and iOS. diff --git a/packages/interactive_media_ads/ios/interactive_media_ads.podspec b/packages/interactive_media_ads/ios/interactive_media_ads.podspec index 8980d486c2121..bb42cc28763bd 100644 --- a/packages/interactive_media_ads/ios/interactive_media_ads.podspec +++ b/packages/interactive_media_ads/ios/interactive_media_ads.podspec @@ -14,7 +14,7 @@ Downloaded by pub (not CocoaPods). s.license = { :type => 'BSD', :file => '../LICENSE' } s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/interactive_media_ads/interactive_media_ads' } - s.source_files = 'Classes/**/*' + s.source_files = 'interactive_media_ads/Sources/interactive_media_ads/**/*.swift' s.dependency 'Flutter' s.platform = :ios, '12.0' @@ -25,5 +25,5 @@ Downloaded by pub (not CocoaPods). 'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift', } s.swift_version = '5.0' - s.resource_bundles = {'interactive_media_ads_privacy' => ['Resources/PrivacyInfo.xcprivacy']} + s.resource_bundles = {'interactive_media_ads_privacy' => ['interactive_media_ads/Sources/interactive_media_ads/Resources/PrivacyInfo.xcprivacy']} end diff --git a/packages/interactive_media_ads/ios/interactive_media_ads/Package.swift b/packages/interactive_media_ads/ios/interactive_media_ads/Package.swift new file mode 100644 index 0000000000000..1864dffbb7873 --- /dev/null +++ b/packages/interactive_media_ads/ios/interactive_media_ads/Package.swift @@ -0,0 +1,28 @@ +// swift-tools-version: 5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import PackageDescription + +let package = Package( + name: "interactive_media_ads", + platforms: [ + .iOS("12.0") + ], + products: [ + .library(name: "interactive-media-ads", targets: ["interactive_media_ads"]) + ], + dependencies: [], + targets: [ + .target( + name: "interactive_media_ads", + dependencies: [], + resources: [ + .process("Resources") + ] + ) + ] +) diff --git a/packages/interactive_media_ads/ios/Classes/InteractiveMediaAdsPlugin.swift b/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/InteractiveMediaAdsPlugin.swift similarity index 100% rename from packages/interactive_media_ads/ios/Classes/InteractiveMediaAdsPlugin.swift rename to packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/InteractiveMediaAdsPlugin.swift diff --git a/packages/interactive_media_ads/ios/Resources/PrivacyInfo.xcprivacy b/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/Resources/PrivacyInfo.xcprivacy similarity index 100% rename from packages/interactive_media_ads/ios/Resources/PrivacyInfo.xcprivacy rename to packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/Resources/PrivacyInfo.xcprivacy diff --git a/packages/interactive_media_ads/pubspec.yaml b/packages/interactive_media_ads/pubspec.yaml index a6b7b04a21487..c4a0bc24ce729 100644 --- a/packages/interactive_media_ads/pubspec.yaml +++ b/packages/interactive_media_ads/pubspec.yaml @@ -2,7 +2,7 @@ name: interactive_media_ads description: A Flutter plugin for using the Interactive Media Ads SDKs on Android and iOS. repository: https://github.com/flutter/packages/tree/main/packages/interactive_media_ads issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+interactive_media_ads%22 -version: 0.0.1 +version: 0.0.1+1 environment: sdk: ^3.2.3