Skip to content

Commit 7623d0a

Browse files
committed
Initial commit of adding MacOS support.
Heavily inspired by flutter#5854
1 parent f55c7ff commit 7623d0a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1376
-8
lines changed

packages/in_app_purchase/in_app_purchase/example/pubspec.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,11 @@ dev_dependencies:
3030

3131
flutter:
3232
uses-material-design: true
33+
34+
35+
# FOR TESTING ONLY. DO NOT MERGE.
36+
dependency_overrides:
37+
in_app_purchase:
38+
path: ../../../in_app_purchase/in_app_purchase
39+
in_app_purchase_storekit:
40+
path: ../../../in_app_purchase/in_app_purchase_storekit

packages/in_app_purchase/in_app_purchase/pubspec.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,9 @@ dev_dependencies:
3232
sdk: flutter
3333
plugin_platform_interface: ^2.0.0
3434
test: ^1.16.0
35+
36+
37+
# FOR TESTING ONLY. DO NOT MERGE.
38+
dependency_overrides:
39+
in_app_purchase_storekit:
40+
path: ../../in_app_purchase/in_app_purchase_storekit

packages/in_app_purchase/in_app_purchase_storekit/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# in\_app\_purchase\_storekit
22

3-
The iOS implementation of [`in_app_purchase`][1].
3+
The iOS and MacOS implementation of [`in_app_purchase`][1].
44

55
## Usage
66

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2+
#include "ephemeral/Flutter-Generated.xcconfig"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2+
#include "ephemeral/Flutter-Generated.xcconfig"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
platform :osx, '10.15'
2+
3+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
4+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
5+
6+
project 'Runner', {
7+
'Debug' => :debug,
8+
'Profile' => :release,
9+
'Release' => :release,
10+
}
11+
12+
def flutter_root
13+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
14+
unless File.exist?(generated_xcode_build_settings_path)
15+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
16+
end
17+
18+
File.foreach(generated_xcode_build_settings_path) do |line|
19+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
20+
return matches[1].strip if matches
21+
end
22+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
23+
end
24+
25+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
26+
27+
flutter_macos_podfile_setup
28+
29+
target 'Runner' do
30+
use_frameworks!
31+
use_modular_headers!
32+
33+
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
34+
end
35+
36+
post_install do |installer|
37+
installer.pods_project.targets.each do |target|
38+
flutter_additional_macos_build_settings(target)
39+
end
40+
end

0 commit comments

Comments
 (0)