mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 12:49:08 -04:00
feat: add support for Flutter Linux, macOS and Windows (#10)
This commit is contained in:
parent
a71bb14b86
commit
3d1ee7df3c
12 changed files with 376 additions and 5 deletions
19
macos/Classes/Libgit2dartPlugin.swift
Normal file
19
macos/Classes/Libgit2dartPlugin.swift
Normal file
|
@ -0,0 +1,19 @@
|
|||
import Cocoa
|
||||
import FlutterMacOS
|
||||
|
||||
public class Libgit2dartPlugin: NSObject, FlutterPlugin {
|
||||
public static func register(with registrar: FlutterPluginRegistrar) {
|
||||
let channel = FlutterMethodChannel(name: "libgit2dart", binaryMessenger: registrar.messenger)
|
||||
let instance = Libgit2dartPlugin()
|
||||
registrar.addMethodCallDelegate(instance, channel: channel)
|
||||
}
|
||||
|
||||
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
switch call.method {
|
||||
case "getPlatformVersion":
|
||||
result("macOS " + ProcessInfo.processInfo.operatingSystemVersionString)
|
||||
default:
|
||||
result(FlutterMethodNotImplemented)
|
||||
}
|
||||
}
|
||||
}
|
23
macos/libgit2dart.podspec
Normal file
23
macos/libgit2dart.podspec
Normal file
|
@ -0,0 +1,23 @@
|
|||
#
|
||||
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
|
||||
# Run `pod lib lint libgit2dart.podspec` to validate before publishing.
|
||||
#
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'libgit2dart'
|
||||
s.version = '0.0.1'
|
||||
s.summary = 'Dart bindings to libgit2.'
|
||||
s.description = <<-DESC
|
||||
Dart bindings to libgit2.
|
||||
DESC
|
||||
s.homepage = 'https://github.com/SkinnyMind/libgit2dart'
|
||||
s.license = { :file => '../LICENSE' }
|
||||
s.author = { 'Aleksey Kulikov' => 'skinny.mind@gmail.com' }
|
||||
s.source = { :path => '.' }
|
||||
s.source_files = 'Classes/**/*'
|
||||
s.dependency 'FlutterMacOS'
|
||||
s.vendored_libraries = '../.dart_tool/libgit2/macos/libgit2-1.3.0.dylib'
|
||||
|
||||
s.platform = :osx, '10.11'
|
||||
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
|
||||
s.swift_version = '5.0'
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue