mirror of
https://github.com/wgh136/flutter_qjs.git
synced 2025-09-26 21:27:23 +00:00
update ios and macos
This commit is contained in:
@@ -7,10 +7,10 @@ mkdir ./cxx
|
||||
sed 's/\#include \"quickjs\/quickjs.h\"/\#include \"quickjs.h\"/g' ../cxx/ffi.h > ./cxx/ffi.h
|
||||
cp ../cxx/ffi.cpp ./cxx/ffi.cpp
|
||||
|
||||
cp ../cxx/quickjs/*.h ./cxx/
|
||||
cp ../cxx/quickjs/cutils.c ./cxx/
|
||||
cp ../cxx/quickjs/libregexp.c ./cxx/
|
||||
cp ../cxx/quickjs/libunicode.c ./cxx/
|
||||
cp -r ../cxx/quickjs/* ./cxx
|
||||
|
||||
rm ./cxx/quickjs.c
|
||||
|
||||
|
||||
quickjs_version=$(cat ../cxx/quickjs/VERSION)
|
||||
|
||||
|
@@ -1,4 +0,0 @@
|
||||
#import <Flutter/Flutter.h>
|
||||
|
||||
@interface FlutterQjsPlugin : NSObject<FlutterPlugin>
|
||||
@end
|
@@ -1,15 +0,0 @@
|
||||
#import "FlutterQjsPlugin.h"
|
||||
#if __has_include(<flutter_qjs/flutter_qjs-Swift.h>)
|
||||
#import <flutter_qjs/flutter_qjs-Swift.h>
|
||||
#else
|
||||
// Support project import fallback if the generated compatibility header
|
||||
// is not copied when this plugin is created as a library.
|
||||
// https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816
|
||||
#import "flutter_qjs-Swift.h"
|
||||
#endif
|
||||
|
||||
@implementation FlutterQjsPlugin
|
||||
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
|
||||
[SwiftFlutterQjsPlugin registerWithRegistrar:registrar];
|
||||
}
|
||||
@end
|
@@ -1,19 +0,0 @@
|
||||
import Flutter
|
||||
import UIKit
|
||||
|
||||
public class FlutterQjsPlugin: NSObject, FlutterPlugin {
|
||||
public static func register(with registrar: FlutterPluginRegistrar) {
|
||||
let channel = FlutterMethodChannel(name: "flutter_qjs", binaryMessenger: registrar.messenger())
|
||||
let instance = FlutterQjsPlugin()
|
||||
registrar.addMethodCallDelegate(instance, channel: channel)
|
||||
}
|
||||
|
||||
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
switch call.method {
|
||||
case "getPlatformVersion":
|
||||
result("iOS " + UIDevice.current.systemVersion)
|
||||
default:
|
||||
result(FlutterMethodNotImplemented)
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,14 +0,0 @@
|
||||
import Flutter
|
||||
import UIKit
|
||||
|
||||
public class SwiftFlutterQjsPlugin: NSObject, FlutterPlugin {
|
||||
public static func register(with registrar: FlutterPluginRegistrar) {
|
||||
let channel = FlutterMethodChannel(name: "flutter_qjs", binaryMessenger: registrar.messenger())
|
||||
let instance = SwiftFlutterQjsPlugin()
|
||||
registrar.addMethodCallDelegate(instance, channel: channel)
|
||||
}
|
||||
|
||||
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
result("iOS " + UIDevice.current.systemVersion)
|
||||
}
|
||||
}
|
@@ -14,9 +14,9 @@ This plugin is a simple js engine for flutter using the `quickjs` project. Plugi
|
||||
s.author = { 'ekibun' => 'soekibun@gmail.com' }
|
||||
s.source = { :path => '.' }
|
||||
s.compiler_flags = '-DDUMP_LEAKS'
|
||||
s.source_files = ['Classes/**/*', 'cxx/*.{c,cpp}']
|
||||
s.source_files = ['cxx/*.{c,cpp}']
|
||||
s.dependency 'Flutter'
|
||||
s.platform = :ios, '8.0'
|
||||
s.platform = :ios, '11.0'
|
||||
|
||||
# Flutter.framework does not contain a i386 slice.
|
||||
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
|
||||
|
Reference in New Issue
Block a user