Skip to content

Commit 15d761d

Browse files
committed
Initial setup for Swift package manager
1 parent 4228ad0 commit 15d761d

21 files changed

Lines changed: 281 additions & 20 deletions

ios/Assets/.gitkeep

Whitespace-only changes.

ios/flutter_unity_widget.podspec

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
Pod::Spec.new do |s|
66
s.name = 'flutter_unity_widget'
7-
s.version = '4.0.0'
7+
s.version = '5.0.0'
88
s.summary = 'Flutter unity 3D widget for embedding unity in flutter'
99
s.description = <<-DESC
1010
A new Flutter plugin.
@@ -13,10 +13,10 @@ A new Flutter plugin.
1313
s.license = { :file => '../LICENSE' }
1414
s.author = { 'Rex Isaac Raphael' => 'rex.raphael@outlook.com' }
1515
s.source = { :path => '.' }
16-
s.source_files = 'Classes/**/*'
17-
s.public_header_files = 'Classes/**/*.h'
16+
s.source_files = 'flutter_unity_widget/Sources/flutter_unity_widget/Classes/**/*'
17+
s.public_header_files = 'flutter_unity_widget/Sources/flutter_unity_widget/Classes/**/*.h'
1818
s.dependency 'Flutter'
19-
s.platform = :ios, '8.0'
19+
s.platform = :ios, '12.0'
2020
s.frameworks = 'UnityFramework'
2121

2222
# Flutter.framework does not contain a i386 slice.
@@ -28,5 +28,5 @@ A new Flutter plugin.
2828
'OTHER_LDFLAGS' => '$(inherited) -framework UnityFramework ${PODS_LIBRARIES}'
2929
}
3030

31-
s.resource_bundles = {'flutter_unity_widget_privacy' => ['Resources/PrivacyInfo.xcprivacy']}
31+
s.resource_bundles = {'flutter_unity_widget_privacy' => ['flutter_unity_widget/Sources/flutter_unity_widget/PrivacyInfo.xcprivacy']}
3232
end
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// swift-tools-version: 5.9
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
// created based on https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors
5+
6+
7+
import PackageDescription
8+
9+
let package = Package(
10+
name: "flutter_unity_widget",
11+
platforms: [
12+
.iOS(.v12),
13+
],
14+
products: [
15+
// If the plugin name contains "_", replace with "-" for the library name.
16+
.library(name: "flutter-unity-widget", targets: ["flutter_unity_widget"])
17+
],
18+
dependencies: [
19+
// Mentioned as "new in Flutter 3.41"
20+
// .package(name: "FlutterFramework", path: "../FlutterFramework") // Flutter 3.41
21+
],
22+
targets: [
23+
.target(
24+
name: "flutter_unity_widget",
25+
dependencies: [
26+
"UnityFramework"
27+
28+
// Mentioned as "new in Flutter 3.41"
29+
// .product(name: "FlutterFramework", package: "FlutterFramework")
30+
],
31+
resources: [
32+
// If your plugin requires a privacy manifest
33+
// (e.g. if it uses any required reason APIs), update the PrivacyInfo.xcprivacy file
34+
// to describe your plugin's privacy impact, and then uncomment this line.
35+
// For more information, see:
36+
// https://developer.apple.com/documentation/bundleresources/privacy_manifest_files
37+
.process("PrivacyInfo.xcprivacy")
38+
39+
// If you have other resources that need to be bundled with your plugin, refer to
40+
// the following instructions to add them:
41+
// https://developer.apple.com/documentation/xcode/bundling-resources-with-a-swift-package
42+
]
43+
),
44+
.binaryTarget(
45+
name: "UnityFramework",
46+
// SPM needs this stub framework to compile the plugin, the UnityFramework from Unity-iPhone will get linked in the actual build.
47+
path: "UnityFrameworkStub/UnityFramework.xcframework"
48+
)
49+
]
50+
)

ios/Classes/FLTUnityOptionsSink.swift renamed to ios/flutter_unity_widget/Sources/flutter_unity_widget/FLTUnityOptionsSink.swift

File renamed without changes.

ios/Classes/FLTUnityView.swift renamed to ios/flutter_unity_widget/Sources/flutter_unity_widget/FLTUnityView.swift

File renamed without changes.

ios/Classes/FLTUnityViewFactory.swift renamed to ios/flutter_unity_widget/Sources/flutter_unity_widget/FLTUnityViewFactory.swift

File renamed without changes.

ios/Classes/FLTUnityWidgetController.swift renamed to ios/flutter_unity_widget/Sources/flutter_unity_widget/FLTUnityWidgetController.swift

File renamed without changes.

ios/Classes/FlutterUnityWidgetPlugin.h renamed to ios/flutter_unity_widget/Sources/flutter_unity_widget/FlutterUnityWidgetPlugin.h

File renamed without changes.

ios/Classes/FlutterUnityWidgetPlugin.m renamed to ios/flutter_unity_widget/Sources/flutter_unity_widget/FlutterUnityWidgetPlugin.m

File renamed without changes.

ios/Resources/PrivacyInfo.xcprivacy renamed to ios/flutter_unity_widget/Sources/flutter_unity_widget/PrivacyInfo.xcprivacy

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3-
<plist version="1.0">
4-
<dict>
5-
<key>NSPrivacyTrackingDomains</key>
6-
<array/>
7-
<key>NSPrivacyAccessedAPITypes</key>
8-
<array/>
9-
<key>NSPrivacyCollectedDataTypes</key>
10-
<array/>
11-
<key>NSPrivacyTracking</key>
12-
<false/>
13-
</dict>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>NSPrivacyTrackingDomains</key>
6+
<array/>
7+
<key>NSPrivacyAccessedAPITypes</key>
8+
<array/>
9+
<key>NSPrivacyCollectedDataTypes</key>
10+
<array/>
11+
<key>NSPrivacyTracking</key>
12+
<false/>
13+
</dict>
1414
</plist>

0 commit comments

Comments
 (0)