diff --git a/packages/shared_preferences/shared_preferences_foundation/CHANGELOG.md b/packages/shared_preferences/shared_preferences_foundation/CHANGELOG.md index 317d893cd375..e487278c4986 100644 --- a/packages/shared_preferences/shared_preferences_foundation/CHANGELOG.md +++ b/packages/shared_preferences/shared_preferences_foundation/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 2.4.0 +* Adds Swift Package Manager compatibility. * Updates minimum iOS version to 12.0 and minimum Flutter version to 3.16.6. ## 2.3.5 diff --git a/packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation.podspec b/packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation.podspec index 41ec1683c17f..008f51f30f41 100644 --- a/packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation.podspec +++ b/packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation.podspec @@ -12,7 +12,7 @@ Wraps NSUserDefaults, providing a persistent store for simple key-value pairs. s.license = { :type => 'BSD', :file => '../LICENSE' } s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/shared_preferences/shared_preferences_foundation' } - s.source_files = 'Classes/**/*' + s.source_files = 'shared_preferences_foundation/Sources/shared_preferences_foundation/**/*.swift' s.ios.dependency 'Flutter' s.osx.dependency 'FlutterMacOS' s.ios.deployment_target = '12.0' @@ -23,6 +23,6 @@ Wraps NSUserDefaults, providing a persistent store for simple key-value pairs. 'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift', } s.swift_version = '5.0' - s.resource_bundles = {'shared_preferences_foundation_privacy' => ['Resources/PrivacyInfo.xcprivacy']} + s.resource_bundles = {'shared_preferences_foundation_privacy' => ['shared_preferences_foundation/Sources/shared_preferences_foundation/Resources/PrivacyInfo.xcprivacy']} end diff --git a/packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation/Package.swift b/packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation/Package.swift new file mode 100644 index 000000000000..eae02a420e82 --- /dev/null +++ b/packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation/Package.swift @@ -0,0 +1,28 @@ +// swift-tools-version: 5.9 + +// 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: "shared_preferences_foundation", + platforms: [ + .iOS("12.0"), + .macOS("10.14"), + ], + products: [ + .library(name: "shared-preferences-foundation", targets: ["shared_preferences_foundation"]) + ], + dependencies: [], + targets: [ + .target( + name: "shared_preferences_foundation", + dependencies: [], + resources: [ + .process("Resources") + ] + ) + ] +) diff --git a/packages/shared_preferences/shared_preferences_foundation/darwin/Resources/PrivacyInfo.xcprivacy b/packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation/Sources/shared_preferences_foundation/Resources/PrivacyInfo.xcprivacy similarity index 100% rename from packages/shared_preferences/shared_preferences_foundation/darwin/Resources/PrivacyInfo.xcprivacy rename to packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation/Sources/shared_preferences_foundation/Resources/PrivacyInfo.xcprivacy diff --git a/packages/shared_preferences/shared_preferences_foundation/darwin/Classes/SharedPreferencesPlugin.swift b/packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation/Sources/shared_preferences_foundation/SharedPreferencesPlugin.swift similarity index 100% rename from packages/shared_preferences/shared_preferences_foundation/darwin/Classes/SharedPreferencesPlugin.swift rename to packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation/Sources/shared_preferences_foundation/SharedPreferencesPlugin.swift diff --git a/packages/shared_preferences/shared_preferences_foundation/darwin/Classes/messages.g.swift b/packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation/Sources/shared_preferences_foundation/messages.g.swift similarity index 100% rename from packages/shared_preferences/shared_preferences_foundation/darwin/Classes/messages.g.swift rename to packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation/Sources/shared_preferences_foundation/messages.g.swift diff --git a/packages/shared_preferences/shared_preferences_foundation/example/ios/Runner.xcodeproj/project.pbxproj b/packages/shared_preferences/shared_preferences_foundation/example/ios/Runner.xcodeproj/project.pbxproj index 4f0d99270a26..a2ad88eea841 100644 --- a/packages/shared_preferences/shared_preferences_foundation/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/shared_preferences/shared_preferences_foundation/example/ios/Runner.xcodeproj/project.pbxproj @@ -215,7 +215,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 331C8080294A63A400263BE5 = { diff --git a/packages/shared_preferences/shared_preferences_foundation/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/shared_preferences/shared_preferences_foundation/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 87131a09bea5..8e3ca5dfe193 100644 --- a/packages/shared_preferences/shared_preferences_foundation/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/shared_preferences/shared_preferences_foundation/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ Bool { return true diff --git a/packages/shared_preferences/shared_preferences_foundation/pigeons/messages.dart b/packages/shared_preferences/shared_preferences_foundation/pigeons/messages.dart index 46deeef2bdf1..ad8060e34741 100644 --- a/packages/shared_preferences/shared_preferences_foundation/pigeons/messages.dart +++ b/packages/shared_preferences/shared_preferences_foundation/pigeons/messages.dart @@ -7,7 +7,8 @@ import 'package:pigeon/pigeon.dart'; @ConfigurePigeon(PigeonOptions( dartOut: 'lib/messages.g.dart', dartTestOut: 'test/test_api.g.dart', - swiftOut: 'darwin/Classes/messages.g.swift', + swiftOut: + 'darwin/shared_preferences_foundation/Sources/shared_preferences_foundation/messages.g.swift', copyrightHeader: 'pigeons/copyright_header.txt', )) @HostApi(dartHostTestHandler: 'TestUserDefaultsApi') diff --git a/packages/shared_preferences/shared_preferences_foundation/pubspec.yaml b/packages/shared_preferences/shared_preferences_foundation/pubspec.yaml index c94bdae980c7..2e5d728e1422 100644 --- a/packages/shared_preferences/shared_preferences_foundation/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_foundation/pubspec.yaml @@ -2,7 +2,7 @@ name: shared_preferences_foundation description: iOS and macOS implementation of the shared_preferences plugin. repository: https://github.com/flutter/packages/tree/main/packages/shared_preferences/shared_preferences_foundation issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+shared_preferences%22 -version: 2.3.5 +version: 2.4.0 environment: sdk: ^3.2.3