Skip to content

Commit

Permalink
added support for macos on flutter_js plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
abner committed Apr 2, 2021
1 parent c887e57 commit 0b58c5d
Show file tree
Hide file tree
Showing 36 changed files with 1,403 additions and 6 deletions.
6 changes: 4 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
{
"name": "flutter_js",
"request": "launch",
"type": "dart"
"type": "dart",
"args": ["--verbose"]
},
{
"name": "example",
"cwd": "example",
"request": "launch",
"type": "dart"
"type": "dart",
"args": ["--verbose"]
},
{
"name": "packages",
Expand Down
6 changes: 6 additions & 0 deletions example/macos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Flutter-related
**/Flutter/ephemeral/
**/Pods/

# Xcode-related
**/xcuserdata/
2 changes: 2 additions & 0 deletions example/macos/Flutter/Flutter-Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
2 changes: 2 additions & 0 deletions example/macos/Flutter/Flutter-Release.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
14 changes: 14 additions & 0 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// Generated file. Do not edit.
//

import FlutterMacOS
import Foundation

import flutter_js
import flutter_qjs

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FlutterJsPlugin.register(with: registry.registrar(forPlugin: "FlutterJsPlugin"))
FlutterQjsPlugin.register(with: registry.registrar(forPlugin: "FlutterQjsPlugin"))
}
40 changes: 40 additions & 0 deletions example/macos/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
platform :osx, '10.11'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_macos_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
end
end
28 changes: 28 additions & 0 deletions example/macos/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
PODS:
- flutter_js (0.0.1):
- FlutterMacOS
- flutter_qjs (0.0.1):
- FlutterMacOS
- FlutterMacOS (1.0.0)

DEPENDENCIES:
- flutter_js (from `Flutter/ephemeral/.symlinks/plugins/flutter_js/macos`)
- flutter_qjs (from `Flutter/ephemeral/.symlinks/plugins/flutter_qjs/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)

EXTERNAL SOURCES:
flutter_js:
:path: Flutter/ephemeral/.symlinks/plugins/flutter_js/macos
flutter_qjs:
:path: Flutter/ephemeral/.symlinks/plugins/flutter_qjs/macos
FlutterMacOS:
:path: Flutter/ephemeral

SPEC CHECKSUMS:
flutter_js: c664361655af1d8fc24e278c7d086e9cbe0d68bc
flutter_qjs: 1a3a4a23a9bb18d0583b5ee44d09ed9383a36e9f
FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424

PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c

COCOAPODS: 1.10.1
Loading

0 comments on commit 0b58c5d

Please sign in to comment.