Skip to content

Commit 78a9ad9

Browse files
committed
Add iOS and macOS podspecs for cnativeapi plugin
Introduces cnativeapi.podspec files for iOS and macOS platforms to support Flutter plugin integration with native code. Also comments out multiple_window_example from the workspace in pubspec.yaml.
1 parent aa44ee9 commit 78a9ad9

3 files changed

Lines changed: 88 additions & 1 deletion

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#
2+
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
3+
# Run `pod lib lint cnativeapi.podspec` to validate before publishing.
4+
#
5+
Pod::Spec.new do |s|
6+
s.name = 'cnativeapi'
7+
s.version = '0.0.1'
8+
s.summary = 'A new Flutter plugin project.'
9+
s.description = <<-DESC
10+
A new Flutter plugin project.
11+
DESC
12+
s.homepage = 'http://example.com'
13+
s.license = { :file => '../LICENSE' }
14+
s.author = { 'Your Company' => 'email@example.com' }
15+
s.source = { :path => '.' }
16+
s.source_files = 'cnativeapi/Sources/cnativeapi/**/*', '../cxx_impl/**/*.{cpp,h,mm}'
17+
s.dependency 'Flutter'
18+
s.platform = :ios, '13.0'
19+
20+
# Flutter.framework does not contain a i386 slice.
21+
s.pod_target_xcconfig = {
22+
'DEFINES_MODULE' => 'YES',
23+
# Configure to compile .cpp files as Objective-C++
24+
'CLANG_ENABLE_OBJC_ARC' => 'YES',
25+
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17',
26+
'CLANG_CXX_LIBRARY' => 'libc++',
27+
'OTHER_CPLUSPLUSFLAGS' => '-std=c++17',
28+
# Enable Objective-C++ compilation for .cpp files
29+
'OTHER_CFLAGS' => '-DOBJC_OLD_DISPATCH_PROTOTYPES=0',
30+
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited)',
31+
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386',
32+
}
33+
s.swift_version = '5.0'
34+
35+
# Explicitly set file types to compile as Objective-C++
36+
s.compiler_flags = '-x objective-c++'
37+
38+
# If your plugin requires a privacy manifest, for example if it uses any
39+
# required reason APIs, update the PrivacyInfo.xcprivacy file to describe your
40+
# plugin's privacy impact, and then uncomment this line. For more information,
41+
# see https://developer.apple.com/documentation/bundleresources/privacy_manifest_files
42+
# s.resource_bundles = {'cnativeapi_privacy' => ['cnativeapi/Sources/cnativeapi/PrivacyInfo.xcprivacy']}
43+
end
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#
2+
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
3+
# Run `pod lib lint cnativeapi.podspec` to validate before publishing.
4+
#
5+
Pod::Spec.new do |s|
6+
s.name = 'cnativeapi'
7+
s.version = '0.0.1'
8+
s.summary = 'A new Flutter plugin project.'
9+
s.description = <<-DESC
10+
A new Flutter plugin project.
11+
DESC
12+
s.homepage = 'http://example.com'
13+
s.license = { :file => '../LICENSE' }
14+
s.author = { 'Your Company' => 'email@example.com' }
15+
16+
s.source = { :path => '.' }
17+
s.source_files = 'cnativeapi/Sources/cnativeapi/**/*', '../cxx_impl/**/*.{cpp,h,mm}'
18+
19+
# If your plugin requires a privacy manifest, for example if it collects user
20+
# data, update the PrivacyInfo.xcprivacy file to describe your plugin's
21+
# privacy impact, and then uncomment this line. For more information,
22+
# see https://developer.apple.com/documentation/bundleresources/privacy_manifest_files
23+
# s.resource_bundles = {'cnativeapi_privacy' => ['cnativeapi/Sources/cnativeapi/PrivacyInfo.xcprivacy']}
24+
25+
s.dependency 'FlutterMacOS'
26+
27+
s.platform = :osx, '10.15'
28+
s.pod_target_xcconfig = {
29+
'DEFINES_MODULE' => 'YES',
30+
# Configure to compile .cpp files as Objective-C++
31+
'CLANG_ENABLE_OBJC_ARC' => 'YES',
32+
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17',
33+
'CLANG_CXX_LIBRARY' => 'libc++',
34+
'OTHER_CPLUSPLUSFLAGS' => '-std=c++17',
35+
# Enable Objective-C++ compilation for .cpp files
36+
'OTHER_CFLAGS' => '-DOBJC_OLD_DISPATCH_PROTOTYPES=0',
37+
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited)',
38+
'MACOSX_DEPLOYMENT_TARGET' => '10.15'
39+
}
40+
s.swift_version = '5.0'
41+
42+
# Explicitly set file types to compile as Objective-C++
43+
s.compiler_flags = '-x objective-c++'
44+
end

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ environment:
66
workspace:
77
- examples/display_example
88
- examples/menu_example
9-
- examples/multiple_window_example
9+
# - examples/multiple_window_example
1010
- examples/storage_example
1111
- examples/tray_icon_example
1212
- examples/window_example

0 commit comments

Comments
 (0)