David PHAM-VAN

Fix iOS/macOS release build not working

# Changelog
## 5.0.2
- Fix iOS/macOS release build not working
## 5.0.1
- Update dependencies
... ...
/*
* Copyright (C) 2017, David PHAM-VAN <dev.nfet.net@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <printing/printing-Swift.h>
// Dart:ffi API
void net_nfet_printing_set_document(uint32_t job,
const uint8_t* doc,
uint64_t size) {
[PrintingPlugin setDocumentWithJob:job doc:doc size:size];
}
void net_nfet_printing_set_error(uint32_t job, const char* message) {
[PrintingPlugin setErrorWithJob:job message:message];
}
... ...
... ... @@ -17,29 +17,26 @@
import Flutter
import Foundation
// Dart:ffi API
private var _printingPlugin: PrintingPlugin?
@_cdecl("net_nfet_printing_set_document")
func setDocument(job: UInt32, doc: UnsafePointer<UInt8>, size: UInt64) {
_printingPlugin!.jobs[job]?.setDocument(Data(bytes: doc, count: Int(size)))
}
@_cdecl("net_nfet_printing_set_error")
func setError(job: UInt32, message: UnsafePointer<CChar>) {
_printingPlugin!.jobs[job]?.cancelJob(String(cString: message))
}
// End of Dart:ffi API
@objc
public class PrintingPlugin: NSObject, FlutterPlugin {
private static var instance: PrintingPlugin?
private var channel: FlutterMethodChannel
public var jobs = [UInt32: PrintJob]()
init(_ channel: FlutterMethodChannel) {
self.channel = channel
super.init()
_printingPlugin = self
PrintingPlugin.instance = self
}
@objc
public static func setDocument(job: UInt32, doc: UnsafePointer<UInt8>, size: UInt64) {
instance!.jobs[job]?.setDocument(Data(bytes: doc, count: Int(size)))
}
@objc
public static func setError(job: UInt32, message: UnsafePointer<CChar>) {
instance!.jobs[job]?.cancelJob(String(cString: message))
}
/// Entry point
... ...
/*
* Copyright (C) 2017, David PHAM-VAN <dev.nfet.net@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <printing/printing-Swift.h>
// Dart:ffi API
void net_nfet_printing_set_document(uint32_t job,
const uint8_t* doc,
uint64_t size) {
[PrintingPlugin setDocumentWithJob:job doc:doc size:size];
}
void net_nfet_printing_set_error(uint32_t job, const char* message) {
[PrintingPlugin setErrorWithJob:job message:message];
}
... ...
... ... @@ -17,29 +17,26 @@
import FlutterMacOS
import Foundation
// Dart:ffi API
private var _printingPlugin: PrintingPlugin?
@_cdecl("net_nfet_printing_set_document")
func setDocument(job: UInt32, doc: UnsafePointer<UInt8>, size: UInt64) {
_printingPlugin!.jobs[job]?.setDocument(Data(bytes: doc, count: Int(size)))
}
@_cdecl("net_nfet_printing_set_error")
func setError(job: UInt32, message: UnsafePointer<CChar>) {
_printingPlugin!.jobs[job]?.cancelJob(String(cString: message))
}
// End of Dart:ffi API
@objc
public class PrintingPlugin: NSObject, FlutterPlugin {
private static var instance: PrintingPlugin?
private var channel: FlutterMethodChannel
public var jobs = [UInt32: PrintJob]()
init(_ channel: FlutterMethodChannel) {
self.channel = channel
super.init()
_printingPlugin = self
PrintingPlugin.instance = self
}
@objc
public static func setDocument(job: UInt32, doc: UnsafePointer<UInt8>, size: UInt64) {
instance!.jobs[job]?.setDocument(Data(bytes: doc, count: Int(size)))
}
@objc
public static func setError(job: UInt32, message: UnsafePointer<CChar>) {
instance!.jobs[job]?.cancelJob(String(cString: message))
}
/// Entry point
... ...
... ... @@ -7,7 +7,7 @@ description: >
homepage: https://github.com/DavBfr/dart_pdf/tree/master/printing
repository: https://github.com/DavBfr/dart_pdf
issue_tracker: https://github.com/DavBfr/dart_pdf/issues
version: 5.0.1
version: 5.0.2
environment:
sdk: ">=2.12.0-0 <3.0.0"
... ...