Skip to content

Commit aae59bb

Browse files
feat: able macos support
1 parent 2b075f7 commit aae59bb

30 files changed

+1269
-18
lines changed

example/.metadata

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file should be version controlled.
55

66
version:
7-
revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
7+
revision: f72efea43c3013323d1b95cff571f3c1caa37583
88
channel: stable
99

1010
project_type: app
@@ -13,23 +13,11 @@ project_type: app
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
17-
base_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
18-
- platform: android
19-
create_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
20-
base_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
21-
- platform: ios
22-
create_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
23-
base_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
24-
- platform: linux
25-
create_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
26-
base_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
27-
- platform: web
28-
create_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
29-
base_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
30-
- platform: windows
31-
create_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
32-
base_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57
16+
create_revision: f72efea43c3013323d1b95cff571f3c1caa37583
17+
base_revision: f72efea43c3013323d1b95cff571f3c1caa37583
18+
- platform: macos
19+
create_revision: f72efea43c3013323d1b95cff571f3c1caa37583
20+
base_revision: f72efea43c3013323d1b95cff571f3c1caa37583
3321

3422
# User provided section
3523

example/macos/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Flutter-related
2+
**/Flutter/ephemeral/
3+
**/Pods/
4+
5+
# Xcode-related
6+
**/dgph
7+
**/xcuserdata/
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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//
2+
// Generated file. Do not edit.
3+
//
4+
5+
import FlutterMacOS
6+
import Foundation
7+
8+
9+
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
10+
}

example/macos/Podfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
platform :osx, '10.14'
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)