diff --git a/ios/.gitignore b/darwin/.gitignore similarity index 100% rename from ios/.gitignore rename to darwin/.gitignore diff --git a/ios/Assets/.gitkeep b/darwin/Assets/.gitkeep similarity index 100% rename from ios/Assets/.gitkeep rename to darwin/Assets/.gitkeep diff --git a/ios/Classes/SwiftWebcryptoPlugin.swift b/darwin/Classes/SwiftWebcryptoPlugin.swift similarity index 69% rename from ios/Classes/SwiftWebcryptoPlugin.swift rename to darwin/Classes/SwiftWebcryptoPlugin.swift index ae447aad..70e66121 100644 --- a/ios/Classes/SwiftWebcryptoPlugin.swift +++ b/darwin/Classes/SwiftWebcryptoPlugin.swift @@ -14,17 +14,36 @@ * limitations under the License. */ +#if os(iOS) import Flutter -import UIKit +#elseif os(macOS) +import FlutterMacOS +#endif + +import Foundation public class SwiftWebcryptoPlugin: NSObject, FlutterPlugin { public static func register(with registrar: FlutterPluginRegistrar) { - let channel = FlutterMethodChannel(name: "webcrypto", binaryMessenger: registrar.messenger()) + #if os(iOS) + let messenger = registrar.messenger() + #else + let messenger = registrar.messenger + #endif + + let channel = FlutterMethodChannel(name: "webcrypto", binaryMessenger: messenger) let instance = SwiftWebcryptoPlugin() registrar.addMethodCallDelegate(instance, channel: channel) } public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { - result("iOS " + UIDevice.current.systemVersion) + #if os(iOS) + let platform = "iOS " + #elseif os(macOS) + let platform = "macOS " + #else + let platform = "unknown " + #endif + + result(platform + ProcessInfo.processInfo.operatingSystemVersionString) } } diff --git a/ios/Classes/WebcryptoPlugin.h b/darwin/Classes/WebcryptoPlugin.h similarity index 81% rename from ios/Classes/WebcryptoPlugin.h rename to darwin/Classes/WebcryptoPlugin.h index e1539186..c15d48bb 100644 --- a/ios/Classes/WebcryptoPlugin.h +++ b/darwin/Classes/WebcryptoPlugin.h @@ -14,7 +14,13 @@ * limitations under the License. */ -#import <Flutter/Flutter.h> +#include <TargetConditionals.h> + +#if TARGET_OS_IOS + #import <Flutter/Flutter.h> +#elif TARGET_OS_OSX + #import <FlutterMacOS/FlutterMacOS.h> +#endif @interface WebcryptoPlugin : NSObject<FlutterPlugin> @end diff --git a/ios/Classes/WebcryptoPlugin.m b/darwin/Classes/WebcryptoPlugin.m similarity index 100% rename from ios/Classes/WebcryptoPlugin.m rename to darwin/Classes/WebcryptoPlugin.m diff --git a/ios/Classes/include_webcrypto.c b/darwin/Classes/include_webcrypto.c similarity index 100% rename from ios/Classes/include_webcrypto.c rename to darwin/Classes/include_webcrypto.c diff --git a/ios/third_party/boringssl/err_data.c b/darwin/third_party/boringssl/err_data.c similarity index 100% rename from ios/third_party/boringssl/err_data.c rename to darwin/third_party/boringssl/err_data.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/a_bitstr.c b/darwin/third_party/boringssl/src/crypto/asn1/a_bitstr.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/a_bitstr.c rename to darwin/third_party/boringssl/src/crypto/asn1/a_bitstr.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/a_bool.c b/darwin/third_party/boringssl/src/crypto/asn1/a_bool.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/a_bool.c rename to darwin/third_party/boringssl/src/crypto/asn1/a_bool.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/a_d2i_fp.c b/darwin/third_party/boringssl/src/crypto/asn1/a_d2i_fp.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/a_d2i_fp.c rename to darwin/third_party/boringssl/src/crypto/asn1/a_d2i_fp.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/a_dup.c b/darwin/third_party/boringssl/src/crypto/asn1/a_dup.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/a_dup.c rename to darwin/third_party/boringssl/src/crypto/asn1/a_dup.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/a_gentm.c b/darwin/third_party/boringssl/src/crypto/asn1/a_gentm.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/a_gentm.c rename to darwin/third_party/boringssl/src/crypto/asn1/a_gentm.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/a_i2d_fp.c b/darwin/third_party/boringssl/src/crypto/asn1/a_i2d_fp.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/a_i2d_fp.c rename to darwin/third_party/boringssl/src/crypto/asn1/a_i2d_fp.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/a_int.c b/darwin/third_party/boringssl/src/crypto/asn1/a_int.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/a_int.c rename to darwin/third_party/boringssl/src/crypto/asn1/a_int.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/a_mbstr.c b/darwin/third_party/boringssl/src/crypto/asn1/a_mbstr.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/a_mbstr.c rename to darwin/third_party/boringssl/src/crypto/asn1/a_mbstr.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/a_object.c b/darwin/third_party/boringssl/src/crypto/asn1/a_object.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/a_object.c rename to darwin/third_party/boringssl/src/crypto/asn1/a_object.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/a_octet.c b/darwin/third_party/boringssl/src/crypto/asn1/a_octet.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/a_octet.c rename to darwin/third_party/boringssl/src/crypto/asn1/a_octet.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/a_print.c b/darwin/third_party/boringssl/src/crypto/asn1/a_print.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/a_print.c rename to darwin/third_party/boringssl/src/crypto/asn1/a_print.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/a_strex.c b/darwin/third_party/boringssl/src/crypto/asn1/a_strex.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/a_strex.c rename to darwin/third_party/boringssl/src/crypto/asn1/a_strex.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/a_strnid.c b/darwin/third_party/boringssl/src/crypto/asn1/a_strnid.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/a_strnid.c rename to darwin/third_party/boringssl/src/crypto/asn1/a_strnid.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/a_time.c b/darwin/third_party/boringssl/src/crypto/asn1/a_time.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/a_time.c rename to darwin/third_party/boringssl/src/crypto/asn1/a_time.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/a_type.c b/darwin/third_party/boringssl/src/crypto/asn1/a_type.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/a_type.c rename to darwin/third_party/boringssl/src/crypto/asn1/a_type.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/a_utctm.c b/darwin/third_party/boringssl/src/crypto/asn1/a_utctm.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/a_utctm.c rename to darwin/third_party/boringssl/src/crypto/asn1/a_utctm.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/a_utf8.c b/darwin/third_party/boringssl/src/crypto/asn1/a_utf8.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/a_utf8.c rename to darwin/third_party/boringssl/src/crypto/asn1/a_utf8.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/asn1_lib.c b/darwin/third_party/boringssl/src/crypto/asn1/asn1_lib.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/asn1_lib.c rename to darwin/third_party/boringssl/src/crypto/asn1/asn1_lib.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/asn1_par.c b/darwin/third_party/boringssl/src/crypto/asn1/asn1_par.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/asn1_par.c rename to darwin/third_party/boringssl/src/crypto/asn1/asn1_par.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/asn_pack.c b/darwin/third_party/boringssl/src/crypto/asn1/asn_pack.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/asn_pack.c rename to darwin/third_party/boringssl/src/crypto/asn1/asn_pack.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/f_int.c b/darwin/third_party/boringssl/src/crypto/asn1/f_int.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/f_int.c rename to darwin/third_party/boringssl/src/crypto/asn1/f_int.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/f_string.c b/darwin/third_party/boringssl/src/crypto/asn1/f_string.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/f_string.c rename to darwin/third_party/boringssl/src/crypto/asn1/f_string.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/posix_time.c b/darwin/third_party/boringssl/src/crypto/asn1/posix_time.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/posix_time.c rename to darwin/third_party/boringssl/src/crypto/asn1/posix_time.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/tasn_dec.c b/darwin/third_party/boringssl/src/crypto/asn1/tasn_dec.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/tasn_dec.c rename to darwin/third_party/boringssl/src/crypto/asn1/tasn_dec.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/tasn_enc.c b/darwin/third_party/boringssl/src/crypto/asn1/tasn_enc.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/tasn_enc.c rename to darwin/third_party/boringssl/src/crypto/asn1/tasn_enc.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/tasn_fre.c b/darwin/third_party/boringssl/src/crypto/asn1/tasn_fre.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/tasn_fre.c rename to darwin/third_party/boringssl/src/crypto/asn1/tasn_fre.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/tasn_new.c b/darwin/third_party/boringssl/src/crypto/asn1/tasn_new.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/tasn_new.c rename to darwin/third_party/boringssl/src/crypto/asn1/tasn_new.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/tasn_typ.c b/darwin/third_party/boringssl/src/crypto/asn1/tasn_typ.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/tasn_typ.c rename to darwin/third_party/boringssl/src/crypto/asn1/tasn_typ.c diff --git a/ios/third_party/boringssl/src/crypto/asn1/tasn_utl.c b/darwin/third_party/boringssl/src/crypto/asn1/tasn_utl.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/asn1/tasn_utl.c rename to darwin/third_party/boringssl/src/crypto/asn1/tasn_utl.c diff --git a/ios/third_party/boringssl/src/crypto/base64/base64.c b/darwin/third_party/boringssl/src/crypto/base64/base64.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/base64/base64.c rename to darwin/third_party/boringssl/src/crypto/base64/base64.c diff --git a/ios/third_party/boringssl/src/crypto/bio/bio.c b/darwin/third_party/boringssl/src/crypto/bio/bio.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/bio/bio.c rename to darwin/third_party/boringssl/src/crypto/bio/bio.c diff --git a/ios/third_party/boringssl/src/crypto/bio/bio_mem.c b/darwin/third_party/boringssl/src/crypto/bio/bio_mem.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/bio/bio_mem.c rename to darwin/third_party/boringssl/src/crypto/bio/bio_mem.c diff --git a/ios/third_party/boringssl/src/crypto/bio/connect.c b/darwin/third_party/boringssl/src/crypto/bio/connect.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/bio/connect.c rename to darwin/third_party/boringssl/src/crypto/bio/connect.c diff --git a/ios/third_party/boringssl/src/crypto/bio/fd.c b/darwin/third_party/boringssl/src/crypto/bio/fd.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/bio/fd.c rename to darwin/third_party/boringssl/src/crypto/bio/fd.c diff --git a/ios/third_party/boringssl/src/crypto/bio/file.c b/darwin/third_party/boringssl/src/crypto/bio/file.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/bio/file.c rename to darwin/third_party/boringssl/src/crypto/bio/file.c diff --git a/ios/third_party/boringssl/src/crypto/bio/hexdump.c b/darwin/third_party/boringssl/src/crypto/bio/hexdump.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/bio/hexdump.c rename to darwin/third_party/boringssl/src/crypto/bio/hexdump.c diff --git a/ios/third_party/boringssl/src/crypto/bio/pair.c b/darwin/third_party/boringssl/src/crypto/bio/pair.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/bio/pair.c rename to darwin/third_party/boringssl/src/crypto/bio/pair.c diff --git a/ios/third_party/boringssl/src/crypto/bio/printf.c b/darwin/third_party/boringssl/src/crypto/bio/printf.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/bio/printf.c rename to darwin/third_party/boringssl/src/crypto/bio/printf.c diff --git a/ios/third_party/boringssl/src/crypto/bio/socket.c b/darwin/third_party/boringssl/src/crypto/bio/socket.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/bio/socket.c rename to darwin/third_party/boringssl/src/crypto/bio/socket.c diff --git a/ios/third_party/boringssl/src/crypto/bio/socket_helper.c b/darwin/third_party/boringssl/src/crypto/bio/socket_helper.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/bio/socket_helper.c rename to darwin/third_party/boringssl/src/crypto/bio/socket_helper.c diff --git a/ios/third_party/boringssl/src/crypto/blake2/blake2.c b/darwin/third_party/boringssl/src/crypto/blake2/blake2.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/blake2/blake2.c rename to darwin/third_party/boringssl/src/crypto/blake2/blake2.c diff --git a/ios/third_party/boringssl/src/crypto/bn_extra/bn_asn1.c b/darwin/third_party/boringssl/src/crypto/bn_extra/bn_asn1.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/bn_extra/bn_asn1.c rename to darwin/third_party/boringssl/src/crypto/bn_extra/bn_asn1.c diff --git a/ios/third_party/boringssl/src/crypto/bn_extra/convert.c b/darwin/third_party/boringssl/src/crypto/bn_extra/convert.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/bn_extra/convert.c rename to darwin/third_party/boringssl/src/crypto/bn_extra/convert.c diff --git a/ios/third_party/boringssl/src/crypto/buf/buf.c b/darwin/third_party/boringssl/src/crypto/buf/buf.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/buf/buf.c rename to darwin/third_party/boringssl/src/crypto/buf/buf.c diff --git a/ios/third_party/boringssl/src/crypto/bytestring/asn1_compat.c b/darwin/third_party/boringssl/src/crypto/bytestring/asn1_compat.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/bytestring/asn1_compat.c rename to darwin/third_party/boringssl/src/crypto/bytestring/asn1_compat.c diff --git a/ios/third_party/boringssl/src/crypto/bytestring/ber.c b/darwin/third_party/boringssl/src/crypto/bytestring/ber.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/bytestring/ber.c rename to darwin/third_party/boringssl/src/crypto/bytestring/ber.c diff --git a/ios/third_party/boringssl/src/crypto/bytestring/cbb.c b/darwin/third_party/boringssl/src/crypto/bytestring/cbb.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/bytestring/cbb.c rename to darwin/third_party/boringssl/src/crypto/bytestring/cbb.c diff --git a/ios/third_party/boringssl/src/crypto/bytestring/cbs.c b/darwin/third_party/boringssl/src/crypto/bytestring/cbs.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/bytestring/cbs.c rename to darwin/third_party/boringssl/src/crypto/bytestring/cbs.c diff --git a/ios/third_party/boringssl/src/crypto/bytestring/unicode.c b/darwin/third_party/boringssl/src/crypto/bytestring/unicode.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/bytestring/unicode.c rename to darwin/third_party/boringssl/src/crypto/bytestring/unicode.c diff --git a/ios/third_party/boringssl/src/crypto/chacha/chacha.c b/darwin/third_party/boringssl/src/crypto/chacha/chacha.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/chacha/chacha.c rename to darwin/third_party/boringssl/src/crypto/chacha/chacha.c diff --git a/ios/third_party/boringssl/src/crypto/cipher_extra/cipher_extra.c b/darwin/third_party/boringssl/src/crypto/cipher_extra/cipher_extra.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/cipher_extra/cipher_extra.c rename to darwin/third_party/boringssl/src/crypto/cipher_extra/cipher_extra.c diff --git a/ios/third_party/boringssl/src/crypto/cipher_extra/derive_key.c b/darwin/third_party/boringssl/src/crypto/cipher_extra/derive_key.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/cipher_extra/derive_key.c rename to darwin/third_party/boringssl/src/crypto/cipher_extra/derive_key.c diff --git a/ios/third_party/boringssl/src/crypto/cipher_extra/e_aesctrhmac.c b/darwin/third_party/boringssl/src/crypto/cipher_extra/e_aesctrhmac.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/cipher_extra/e_aesctrhmac.c rename to darwin/third_party/boringssl/src/crypto/cipher_extra/e_aesctrhmac.c diff --git a/ios/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c b/darwin/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c rename to darwin/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c diff --git a/ios/third_party/boringssl/src/crypto/cipher_extra/e_chacha20poly1305.c b/darwin/third_party/boringssl/src/crypto/cipher_extra/e_chacha20poly1305.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/cipher_extra/e_chacha20poly1305.c rename to darwin/third_party/boringssl/src/crypto/cipher_extra/e_chacha20poly1305.c diff --git a/ios/third_party/boringssl/src/crypto/cipher_extra/e_des.c b/darwin/third_party/boringssl/src/crypto/cipher_extra/e_des.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/cipher_extra/e_des.c rename to darwin/third_party/boringssl/src/crypto/cipher_extra/e_des.c diff --git a/ios/third_party/boringssl/src/crypto/cipher_extra/e_null.c b/darwin/third_party/boringssl/src/crypto/cipher_extra/e_null.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/cipher_extra/e_null.c rename to darwin/third_party/boringssl/src/crypto/cipher_extra/e_null.c diff --git a/ios/third_party/boringssl/src/crypto/cipher_extra/e_rc2.c b/darwin/third_party/boringssl/src/crypto/cipher_extra/e_rc2.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/cipher_extra/e_rc2.c rename to darwin/third_party/boringssl/src/crypto/cipher_extra/e_rc2.c diff --git a/ios/third_party/boringssl/src/crypto/cipher_extra/e_rc4.c b/darwin/third_party/boringssl/src/crypto/cipher_extra/e_rc4.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/cipher_extra/e_rc4.c rename to darwin/third_party/boringssl/src/crypto/cipher_extra/e_rc4.c diff --git a/ios/third_party/boringssl/src/crypto/cipher_extra/e_tls.c b/darwin/third_party/boringssl/src/crypto/cipher_extra/e_tls.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/cipher_extra/e_tls.c rename to darwin/third_party/boringssl/src/crypto/cipher_extra/e_tls.c diff --git a/ios/third_party/boringssl/src/crypto/cipher_extra/tls_cbc.c b/darwin/third_party/boringssl/src/crypto/cipher_extra/tls_cbc.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/cipher_extra/tls_cbc.c rename to darwin/third_party/boringssl/src/crypto/cipher_extra/tls_cbc.c diff --git a/ios/third_party/boringssl/src/crypto/conf/conf.c b/darwin/third_party/boringssl/src/crypto/conf/conf.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/conf/conf.c rename to darwin/third_party/boringssl/src/crypto/conf/conf.c diff --git a/ios/third_party/boringssl/src/crypto/cpu_aarch64_apple.c b/darwin/third_party/boringssl/src/crypto/cpu_aarch64_apple.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/cpu_aarch64_apple.c rename to darwin/third_party/boringssl/src/crypto/cpu_aarch64_apple.c diff --git a/ios/third_party/boringssl/src/crypto/cpu_aarch64_fuchsia.c b/darwin/third_party/boringssl/src/crypto/cpu_aarch64_fuchsia.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/cpu_aarch64_fuchsia.c rename to darwin/third_party/boringssl/src/crypto/cpu_aarch64_fuchsia.c diff --git a/ios/third_party/boringssl/src/crypto/cpu_aarch64_linux.c b/darwin/third_party/boringssl/src/crypto/cpu_aarch64_linux.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/cpu_aarch64_linux.c rename to darwin/third_party/boringssl/src/crypto/cpu_aarch64_linux.c diff --git a/ios/third_party/boringssl/src/crypto/cpu_aarch64_win.c b/darwin/third_party/boringssl/src/crypto/cpu_aarch64_win.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/cpu_aarch64_win.c rename to darwin/third_party/boringssl/src/crypto/cpu_aarch64_win.c diff --git a/ios/third_party/boringssl/src/crypto/cpu_arm.c b/darwin/third_party/boringssl/src/crypto/cpu_arm.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/cpu_arm.c rename to darwin/third_party/boringssl/src/crypto/cpu_arm.c diff --git a/ios/third_party/boringssl/src/crypto/cpu_arm_linux.c b/darwin/third_party/boringssl/src/crypto/cpu_arm_linux.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/cpu_arm_linux.c rename to darwin/third_party/boringssl/src/crypto/cpu_arm_linux.c diff --git a/ios/third_party/boringssl/src/crypto/cpu_intel.c b/darwin/third_party/boringssl/src/crypto/cpu_intel.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/cpu_intel.c rename to darwin/third_party/boringssl/src/crypto/cpu_intel.c diff --git a/ios/third_party/boringssl/src/crypto/cpu_ppc64le.c b/darwin/third_party/boringssl/src/crypto/cpu_ppc64le.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/cpu_ppc64le.c rename to darwin/third_party/boringssl/src/crypto/cpu_ppc64le.c diff --git a/ios/third_party/boringssl/src/crypto/crypto.c b/darwin/third_party/boringssl/src/crypto/crypto.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/crypto.c rename to darwin/third_party/boringssl/src/crypto/crypto.c diff --git a/ios/third_party/boringssl/src/crypto/curve25519/curve25519.c b/darwin/third_party/boringssl/src/crypto/curve25519/curve25519.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/curve25519/curve25519.c rename to darwin/third_party/boringssl/src/crypto/curve25519/curve25519.c diff --git a/ios/third_party/boringssl/src/crypto/curve25519/spake25519.c b/darwin/third_party/boringssl/src/crypto/curve25519/spake25519.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/curve25519/spake25519.c rename to darwin/third_party/boringssl/src/crypto/curve25519/spake25519.c diff --git a/ios/third_party/boringssl/src/crypto/des/des.c b/darwin/third_party/boringssl/src/crypto/des/des.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/des/des.c rename to darwin/third_party/boringssl/src/crypto/des/des.c diff --git a/ios/third_party/boringssl/src/crypto/dh_extra/dh_asn1.c b/darwin/third_party/boringssl/src/crypto/dh_extra/dh_asn1.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/dh_extra/dh_asn1.c rename to darwin/third_party/boringssl/src/crypto/dh_extra/dh_asn1.c diff --git a/ios/third_party/boringssl/src/crypto/dh_extra/params.c b/darwin/third_party/boringssl/src/crypto/dh_extra/params.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/dh_extra/params.c rename to darwin/third_party/boringssl/src/crypto/dh_extra/params.c diff --git a/ios/third_party/boringssl/src/crypto/digest_extra/digest_extra.c b/darwin/third_party/boringssl/src/crypto/digest_extra/digest_extra.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/digest_extra/digest_extra.c rename to darwin/third_party/boringssl/src/crypto/digest_extra/digest_extra.c diff --git a/ios/third_party/boringssl/src/crypto/dsa/dsa.c b/darwin/third_party/boringssl/src/crypto/dsa/dsa.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/dsa/dsa.c rename to darwin/third_party/boringssl/src/crypto/dsa/dsa.c diff --git a/ios/third_party/boringssl/src/crypto/dsa/dsa_asn1.c b/darwin/third_party/boringssl/src/crypto/dsa/dsa_asn1.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/dsa/dsa_asn1.c rename to darwin/third_party/boringssl/src/crypto/dsa/dsa_asn1.c diff --git a/ios/third_party/boringssl/src/crypto/ec_extra/ec_asn1.c b/darwin/third_party/boringssl/src/crypto/ec_extra/ec_asn1.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/ec_extra/ec_asn1.c rename to darwin/third_party/boringssl/src/crypto/ec_extra/ec_asn1.c diff --git a/ios/third_party/boringssl/src/crypto/ec_extra/ec_derive.c b/darwin/third_party/boringssl/src/crypto/ec_extra/ec_derive.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/ec_extra/ec_derive.c rename to darwin/third_party/boringssl/src/crypto/ec_extra/ec_derive.c diff --git a/ios/third_party/boringssl/src/crypto/ec_extra/hash_to_curve.c b/darwin/third_party/boringssl/src/crypto/ec_extra/hash_to_curve.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/ec_extra/hash_to_curve.c rename to darwin/third_party/boringssl/src/crypto/ec_extra/hash_to_curve.c diff --git a/ios/third_party/boringssl/src/crypto/ecdh_extra/ecdh_extra.c b/darwin/third_party/boringssl/src/crypto/ecdh_extra/ecdh_extra.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/ecdh_extra/ecdh_extra.c rename to darwin/third_party/boringssl/src/crypto/ecdh_extra/ecdh_extra.c diff --git a/ios/third_party/boringssl/src/crypto/ecdsa_extra/ecdsa_asn1.c b/darwin/third_party/boringssl/src/crypto/ecdsa_extra/ecdsa_asn1.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/ecdsa_extra/ecdsa_asn1.c rename to darwin/third_party/boringssl/src/crypto/ecdsa_extra/ecdsa_asn1.c diff --git a/ios/third_party/boringssl/src/crypto/engine/engine.c b/darwin/third_party/boringssl/src/crypto/engine/engine.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/engine/engine.c rename to darwin/third_party/boringssl/src/crypto/engine/engine.c diff --git a/ios/third_party/boringssl/src/crypto/err/err.c b/darwin/third_party/boringssl/src/crypto/err/err.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/err/err.c rename to darwin/third_party/boringssl/src/crypto/err/err.c diff --git a/ios/third_party/boringssl/src/crypto/evp/evp.c b/darwin/third_party/boringssl/src/crypto/evp/evp.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/evp/evp.c rename to darwin/third_party/boringssl/src/crypto/evp/evp.c diff --git a/ios/third_party/boringssl/src/crypto/evp/evp_asn1.c b/darwin/third_party/boringssl/src/crypto/evp/evp_asn1.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/evp/evp_asn1.c rename to darwin/third_party/boringssl/src/crypto/evp/evp_asn1.c diff --git a/ios/third_party/boringssl/src/crypto/evp/evp_ctx.c b/darwin/third_party/boringssl/src/crypto/evp/evp_ctx.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/evp/evp_ctx.c rename to darwin/third_party/boringssl/src/crypto/evp/evp_ctx.c diff --git a/ios/third_party/boringssl/src/crypto/evp/p_dsa_asn1.c b/darwin/third_party/boringssl/src/crypto/evp/p_dsa_asn1.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/evp/p_dsa_asn1.c rename to darwin/third_party/boringssl/src/crypto/evp/p_dsa_asn1.c diff --git a/ios/third_party/boringssl/src/crypto/evp/p_ec.c b/darwin/third_party/boringssl/src/crypto/evp/p_ec.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/evp/p_ec.c rename to darwin/third_party/boringssl/src/crypto/evp/p_ec.c diff --git a/ios/third_party/boringssl/src/crypto/evp/p_ec_asn1.c b/darwin/third_party/boringssl/src/crypto/evp/p_ec_asn1.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/evp/p_ec_asn1.c rename to darwin/third_party/boringssl/src/crypto/evp/p_ec_asn1.c diff --git a/ios/third_party/boringssl/src/crypto/evp/p_ed25519.c b/darwin/third_party/boringssl/src/crypto/evp/p_ed25519.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/evp/p_ed25519.c rename to darwin/third_party/boringssl/src/crypto/evp/p_ed25519.c diff --git a/ios/third_party/boringssl/src/crypto/evp/p_ed25519_asn1.c b/darwin/third_party/boringssl/src/crypto/evp/p_ed25519_asn1.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/evp/p_ed25519_asn1.c rename to darwin/third_party/boringssl/src/crypto/evp/p_ed25519_asn1.c diff --git a/ios/third_party/boringssl/src/crypto/evp/p_hkdf.c b/darwin/third_party/boringssl/src/crypto/evp/p_hkdf.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/evp/p_hkdf.c rename to darwin/third_party/boringssl/src/crypto/evp/p_hkdf.c diff --git a/ios/third_party/boringssl/src/crypto/evp/p_rsa.c b/darwin/third_party/boringssl/src/crypto/evp/p_rsa.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/evp/p_rsa.c rename to darwin/third_party/boringssl/src/crypto/evp/p_rsa.c diff --git a/ios/third_party/boringssl/src/crypto/evp/p_rsa_asn1.c b/darwin/third_party/boringssl/src/crypto/evp/p_rsa_asn1.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/evp/p_rsa_asn1.c rename to darwin/third_party/boringssl/src/crypto/evp/p_rsa_asn1.c diff --git a/ios/third_party/boringssl/src/crypto/evp/p_x25519.c b/darwin/third_party/boringssl/src/crypto/evp/p_x25519.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/evp/p_x25519.c rename to darwin/third_party/boringssl/src/crypto/evp/p_x25519.c diff --git a/ios/third_party/boringssl/src/crypto/evp/p_x25519_asn1.c b/darwin/third_party/boringssl/src/crypto/evp/p_x25519_asn1.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/evp/p_x25519_asn1.c rename to darwin/third_party/boringssl/src/crypto/evp/p_x25519_asn1.c diff --git a/ios/third_party/boringssl/src/crypto/evp/pbkdf.c b/darwin/third_party/boringssl/src/crypto/evp/pbkdf.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/evp/pbkdf.c rename to darwin/third_party/boringssl/src/crypto/evp/pbkdf.c diff --git a/ios/third_party/boringssl/src/crypto/evp/print.c b/darwin/third_party/boringssl/src/crypto/evp/print.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/evp/print.c rename to darwin/third_party/boringssl/src/crypto/evp/print.c diff --git a/ios/third_party/boringssl/src/crypto/evp/scrypt.c b/darwin/third_party/boringssl/src/crypto/evp/scrypt.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/evp/scrypt.c rename to darwin/third_party/boringssl/src/crypto/evp/scrypt.c diff --git a/ios/third_party/boringssl/src/crypto/evp/sign.c b/darwin/third_party/boringssl/src/crypto/evp/sign.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/evp/sign.c rename to darwin/third_party/boringssl/src/crypto/evp/sign.c diff --git a/ios/third_party/boringssl/src/crypto/ex_data.c b/darwin/third_party/boringssl/src/crypto/ex_data.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/ex_data.c rename to darwin/third_party/boringssl/src/crypto/ex_data.c diff --git a/ios/third_party/boringssl/src/crypto/fipsmodule/bcm.c b/darwin/third_party/boringssl/src/crypto/fipsmodule/bcm.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/fipsmodule/bcm.c rename to darwin/third_party/boringssl/src/crypto/fipsmodule/bcm.c diff --git a/ios/third_party/boringssl/src/crypto/fipsmodule/fips_shared_support.c b/darwin/third_party/boringssl/src/crypto/fipsmodule/fips_shared_support.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/fipsmodule/fips_shared_support.c rename to darwin/third_party/boringssl/src/crypto/fipsmodule/fips_shared_support.c diff --git a/ios/third_party/boringssl/src/crypto/hkdf/hkdf.c b/darwin/third_party/boringssl/src/crypto/hkdf/hkdf.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/hkdf/hkdf.c rename to darwin/third_party/boringssl/src/crypto/hkdf/hkdf.c diff --git a/ios/third_party/boringssl/src/crypto/hpke/hpke.c b/darwin/third_party/boringssl/src/crypto/hpke/hpke.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/hpke/hpke.c rename to darwin/third_party/boringssl/src/crypto/hpke/hpke.c diff --git a/ios/third_party/boringssl/src/crypto/hrss/hrss.c b/darwin/third_party/boringssl/src/crypto/hrss/hrss.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/hrss/hrss.c rename to darwin/third_party/boringssl/src/crypto/hrss/hrss.c diff --git a/ios/third_party/boringssl/src/crypto/lhash/lhash.c b/darwin/third_party/boringssl/src/crypto/lhash/lhash.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/lhash/lhash.c rename to darwin/third_party/boringssl/src/crypto/lhash/lhash.c diff --git a/ios/third_party/boringssl/src/crypto/mem.c b/darwin/third_party/boringssl/src/crypto/mem.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/mem.c rename to darwin/third_party/boringssl/src/crypto/mem.c diff --git a/ios/third_party/boringssl/src/crypto/obj/obj.c b/darwin/third_party/boringssl/src/crypto/obj/obj.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/obj/obj.c rename to darwin/third_party/boringssl/src/crypto/obj/obj.c diff --git a/ios/third_party/boringssl/src/crypto/obj/obj_xref.c b/darwin/third_party/boringssl/src/crypto/obj/obj_xref.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/obj/obj_xref.c rename to darwin/third_party/boringssl/src/crypto/obj/obj_xref.c diff --git a/ios/third_party/boringssl/src/crypto/pem/pem_all.c b/darwin/third_party/boringssl/src/crypto/pem/pem_all.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/pem/pem_all.c rename to darwin/third_party/boringssl/src/crypto/pem/pem_all.c diff --git a/ios/third_party/boringssl/src/crypto/pem/pem_info.c b/darwin/third_party/boringssl/src/crypto/pem/pem_info.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/pem/pem_info.c rename to darwin/third_party/boringssl/src/crypto/pem/pem_info.c diff --git a/ios/third_party/boringssl/src/crypto/pem/pem_lib.c b/darwin/third_party/boringssl/src/crypto/pem/pem_lib.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/pem/pem_lib.c rename to darwin/third_party/boringssl/src/crypto/pem/pem_lib.c diff --git a/ios/third_party/boringssl/src/crypto/pem/pem_oth.c b/darwin/third_party/boringssl/src/crypto/pem/pem_oth.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/pem/pem_oth.c rename to darwin/third_party/boringssl/src/crypto/pem/pem_oth.c diff --git a/ios/third_party/boringssl/src/crypto/pem/pem_pk8.c b/darwin/third_party/boringssl/src/crypto/pem/pem_pk8.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/pem/pem_pk8.c rename to darwin/third_party/boringssl/src/crypto/pem/pem_pk8.c diff --git a/ios/third_party/boringssl/src/crypto/pem/pem_pkey.c b/darwin/third_party/boringssl/src/crypto/pem/pem_pkey.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/pem/pem_pkey.c rename to darwin/third_party/boringssl/src/crypto/pem/pem_pkey.c diff --git a/ios/third_party/boringssl/src/crypto/pem/pem_x509.c b/darwin/third_party/boringssl/src/crypto/pem/pem_x509.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/pem/pem_x509.c rename to darwin/third_party/boringssl/src/crypto/pem/pem_x509.c diff --git a/ios/third_party/boringssl/src/crypto/pem/pem_xaux.c b/darwin/third_party/boringssl/src/crypto/pem/pem_xaux.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/pem/pem_xaux.c rename to darwin/third_party/boringssl/src/crypto/pem/pem_xaux.c diff --git a/ios/third_party/boringssl/src/crypto/pkcs7/pkcs7.c b/darwin/third_party/boringssl/src/crypto/pkcs7/pkcs7.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/pkcs7/pkcs7.c rename to darwin/third_party/boringssl/src/crypto/pkcs7/pkcs7.c diff --git a/ios/third_party/boringssl/src/crypto/pkcs7/pkcs7_x509.c b/darwin/third_party/boringssl/src/crypto/pkcs7/pkcs7_x509.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/pkcs7/pkcs7_x509.c rename to darwin/third_party/boringssl/src/crypto/pkcs7/pkcs7_x509.c diff --git a/ios/third_party/boringssl/src/crypto/pkcs8/p5_pbev2.c b/darwin/third_party/boringssl/src/crypto/pkcs8/p5_pbev2.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/pkcs8/p5_pbev2.c rename to darwin/third_party/boringssl/src/crypto/pkcs8/p5_pbev2.c diff --git a/ios/third_party/boringssl/src/crypto/pkcs8/pkcs8.c b/darwin/third_party/boringssl/src/crypto/pkcs8/pkcs8.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/pkcs8/pkcs8.c rename to darwin/third_party/boringssl/src/crypto/pkcs8/pkcs8.c diff --git a/ios/third_party/boringssl/src/crypto/pkcs8/pkcs8_x509.c b/darwin/third_party/boringssl/src/crypto/pkcs8/pkcs8_x509.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/pkcs8/pkcs8_x509.c rename to darwin/third_party/boringssl/src/crypto/pkcs8/pkcs8_x509.c diff --git a/ios/third_party/boringssl/src/crypto/poly1305/poly1305.c b/darwin/third_party/boringssl/src/crypto/poly1305/poly1305.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/poly1305/poly1305.c rename to darwin/third_party/boringssl/src/crypto/poly1305/poly1305.c diff --git a/ios/third_party/boringssl/src/crypto/poly1305/poly1305_arm.c b/darwin/third_party/boringssl/src/crypto/poly1305/poly1305_arm.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/poly1305/poly1305_arm.c rename to darwin/third_party/boringssl/src/crypto/poly1305/poly1305_arm.c diff --git a/ios/third_party/boringssl/src/crypto/poly1305/poly1305_vec.c b/darwin/third_party/boringssl/src/crypto/poly1305/poly1305_vec.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/poly1305/poly1305_vec.c rename to darwin/third_party/boringssl/src/crypto/poly1305/poly1305_vec.c diff --git a/ios/third_party/boringssl/src/crypto/pool/pool.c b/darwin/third_party/boringssl/src/crypto/pool/pool.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/pool/pool.c rename to darwin/third_party/boringssl/src/crypto/pool/pool.c diff --git a/ios/third_party/boringssl/src/crypto/rand_extra/deterministic.c b/darwin/third_party/boringssl/src/crypto/rand_extra/deterministic.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/rand_extra/deterministic.c rename to darwin/third_party/boringssl/src/crypto/rand_extra/deterministic.c diff --git a/ios/third_party/boringssl/src/crypto/rand_extra/forkunsafe.c b/darwin/third_party/boringssl/src/crypto/rand_extra/forkunsafe.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/rand_extra/forkunsafe.c rename to darwin/third_party/boringssl/src/crypto/rand_extra/forkunsafe.c diff --git a/ios/third_party/boringssl/src/crypto/rand_extra/fuchsia.c b/darwin/third_party/boringssl/src/crypto/rand_extra/fuchsia.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/rand_extra/fuchsia.c rename to darwin/third_party/boringssl/src/crypto/rand_extra/fuchsia.c diff --git a/ios/third_party/boringssl/src/crypto/rand_extra/passive.c b/darwin/third_party/boringssl/src/crypto/rand_extra/passive.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/rand_extra/passive.c rename to darwin/third_party/boringssl/src/crypto/rand_extra/passive.c diff --git a/ios/third_party/boringssl/src/crypto/rand_extra/rand_extra.c b/darwin/third_party/boringssl/src/crypto/rand_extra/rand_extra.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/rand_extra/rand_extra.c rename to darwin/third_party/boringssl/src/crypto/rand_extra/rand_extra.c diff --git a/ios/third_party/boringssl/src/crypto/rand_extra/windows.c b/darwin/third_party/boringssl/src/crypto/rand_extra/windows.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/rand_extra/windows.c rename to darwin/third_party/boringssl/src/crypto/rand_extra/windows.c diff --git a/ios/third_party/boringssl/src/crypto/rc4/rc4.c b/darwin/third_party/boringssl/src/crypto/rc4/rc4.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/rc4/rc4.c rename to darwin/third_party/boringssl/src/crypto/rc4/rc4.c diff --git a/ios/third_party/boringssl/src/crypto/refcount_c11.c b/darwin/third_party/boringssl/src/crypto/refcount_c11.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/refcount_c11.c rename to darwin/third_party/boringssl/src/crypto/refcount_c11.c diff --git a/ios/third_party/boringssl/src/crypto/refcount_lock.c b/darwin/third_party/boringssl/src/crypto/refcount_lock.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/refcount_lock.c rename to darwin/third_party/boringssl/src/crypto/refcount_lock.c diff --git a/ios/third_party/boringssl/src/crypto/rsa_extra/rsa_asn1.c b/darwin/third_party/boringssl/src/crypto/rsa_extra/rsa_asn1.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/rsa_extra/rsa_asn1.c rename to darwin/third_party/boringssl/src/crypto/rsa_extra/rsa_asn1.c diff --git a/ios/third_party/boringssl/src/crypto/rsa_extra/rsa_print.c b/darwin/third_party/boringssl/src/crypto/rsa_extra/rsa_print.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/rsa_extra/rsa_print.c rename to darwin/third_party/boringssl/src/crypto/rsa_extra/rsa_print.c diff --git a/ios/third_party/boringssl/src/crypto/siphash/siphash.c b/darwin/third_party/boringssl/src/crypto/siphash/siphash.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/siphash/siphash.c rename to darwin/third_party/boringssl/src/crypto/siphash/siphash.c diff --git a/ios/third_party/boringssl/src/crypto/stack/stack.c b/darwin/third_party/boringssl/src/crypto/stack/stack.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/stack/stack.c rename to darwin/third_party/boringssl/src/crypto/stack/stack.c diff --git a/ios/third_party/boringssl/src/crypto/thread.c b/darwin/third_party/boringssl/src/crypto/thread.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/thread.c rename to darwin/third_party/boringssl/src/crypto/thread.c diff --git a/ios/third_party/boringssl/src/crypto/thread_none.c b/darwin/third_party/boringssl/src/crypto/thread_none.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/thread_none.c rename to darwin/third_party/boringssl/src/crypto/thread_none.c diff --git a/ios/third_party/boringssl/src/crypto/thread_pthread.c b/darwin/third_party/boringssl/src/crypto/thread_pthread.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/thread_pthread.c rename to darwin/third_party/boringssl/src/crypto/thread_pthread.c diff --git a/ios/third_party/boringssl/src/crypto/thread_win.c b/darwin/third_party/boringssl/src/crypto/thread_win.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/thread_win.c rename to darwin/third_party/boringssl/src/crypto/thread_win.c diff --git a/ios/third_party/boringssl/src/crypto/trust_token/pmbtoken.c b/darwin/third_party/boringssl/src/crypto/trust_token/pmbtoken.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/trust_token/pmbtoken.c rename to darwin/third_party/boringssl/src/crypto/trust_token/pmbtoken.c diff --git a/ios/third_party/boringssl/src/crypto/trust_token/trust_token.c b/darwin/third_party/boringssl/src/crypto/trust_token/trust_token.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/trust_token/trust_token.c rename to darwin/third_party/boringssl/src/crypto/trust_token/trust_token.c diff --git a/ios/third_party/boringssl/src/crypto/trust_token/voprf.c b/darwin/third_party/boringssl/src/crypto/trust_token/voprf.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/trust_token/voprf.c rename to darwin/third_party/boringssl/src/crypto/trust_token/voprf.c diff --git a/ios/third_party/boringssl/src/crypto/x509/a_digest.c b/darwin/third_party/boringssl/src/crypto/x509/a_digest.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/a_digest.c rename to darwin/third_party/boringssl/src/crypto/x509/a_digest.c diff --git a/ios/third_party/boringssl/src/crypto/x509/a_sign.c b/darwin/third_party/boringssl/src/crypto/x509/a_sign.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/a_sign.c rename to darwin/third_party/boringssl/src/crypto/x509/a_sign.c diff --git a/ios/third_party/boringssl/src/crypto/x509/a_verify.c b/darwin/third_party/boringssl/src/crypto/x509/a_verify.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/a_verify.c rename to darwin/third_party/boringssl/src/crypto/x509/a_verify.c diff --git a/ios/third_party/boringssl/src/crypto/x509/algorithm.c b/darwin/third_party/boringssl/src/crypto/x509/algorithm.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/algorithm.c rename to darwin/third_party/boringssl/src/crypto/x509/algorithm.c diff --git a/ios/third_party/boringssl/src/crypto/x509/asn1_gen.c b/darwin/third_party/boringssl/src/crypto/x509/asn1_gen.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/asn1_gen.c rename to darwin/third_party/boringssl/src/crypto/x509/asn1_gen.c diff --git a/ios/third_party/boringssl/src/crypto/x509/by_dir.c b/darwin/third_party/boringssl/src/crypto/x509/by_dir.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/by_dir.c rename to darwin/third_party/boringssl/src/crypto/x509/by_dir.c diff --git a/ios/third_party/boringssl/src/crypto/x509/by_file.c b/darwin/third_party/boringssl/src/crypto/x509/by_file.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/by_file.c rename to darwin/third_party/boringssl/src/crypto/x509/by_file.c diff --git a/ios/third_party/boringssl/src/crypto/x509/i2d_pr.c b/darwin/third_party/boringssl/src/crypto/x509/i2d_pr.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/i2d_pr.c rename to darwin/third_party/boringssl/src/crypto/x509/i2d_pr.c diff --git a/ios/third_party/boringssl/src/crypto/x509/name_print.c b/darwin/third_party/boringssl/src/crypto/x509/name_print.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/name_print.c rename to darwin/third_party/boringssl/src/crypto/x509/name_print.c diff --git a/ios/third_party/boringssl/src/crypto/x509/rsa_pss.c b/darwin/third_party/boringssl/src/crypto/x509/rsa_pss.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/rsa_pss.c rename to darwin/third_party/boringssl/src/crypto/x509/rsa_pss.c diff --git a/ios/third_party/boringssl/src/crypto/x509/t_crl.c b/darwin/third_party/boringssl/src/crypto/x509/t_crl.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/t_crl.c rename to darwin/third_party/boringssl/src/crypto/x509/t_crl.c diff --git a/ios/third_party/boringssl/src/crypto/x509/t_req.c b/darwin/third_party/boringssl/src/crypto/x509/t_req.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/t_req.c rename to darwin/third_party/boringssl/src/crypto/x509/t_req.c diff --git a/ios/third_party/boringssl/src/crypto/x509/t_x509.c b/darwin/third_party/boringssl/src/crypto/x509/t_x509.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/t_x509.c rename to darwin/third_party/boringssl/src/crypto/x509/t_x509.c diff --git a/ios/third_party/boringssl/src/crypto/x509/t_x509a.c b/darwin/third_party/boringssl/src/crypto/x509/t_x509a.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/t_x509a.c rename to darwin/third_party/boringssl/src/crypto/x509/t_x509a.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x509.c b/darwin/third_party/boringssl/src/crypto/x509/x509.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x509.c rename to darwin/third_party/boringssl/src/crypto/x509/x509.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x509_att.c b/darwin/third_party/boringssl/src/crypto/x509/x509_att.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x509_att.c rename to darwin/third_party/boringssl/src/crypto/x509/x509_att.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x509_cmp.c b/darwin/third_party/boringssl/src/crypto/x509/x509_cmp.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x509_cmp.c rename to darwin/third_party/boringssl/src/crypto/x509/x509_cmp.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x509_d2.c b/darwin/third_party/boringssl/src/crypto/x509/x509_d2.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x509_d2.c rename to darwin/third_party/boringssl/src/crypto/x509/x509_d2.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x509_def.c b/darwin/third_party/boringssl/src/crypto/x509/x509_def.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x509_def.c rename to darwin/third_party/boringssl/src/crypto/x509/x509_def.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x509_ext.c b/darwin/third_party/boringssl/src/crypto/x509/x509_ext.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x509_ext.c rename to darwin/third_party/boringssl/src/crypto/x509/x509_ext.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x509_lu.c b/darwin/third_party/boringssl/src/crypto/x509/x509_lu.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x509_lu.c rename to darwin/third_party/boringssl/src/crypto/x509/x509_lu.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x509_obj.c b/darwin/third_party/boringssl/src/crypto/x509/x509_obj.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x509_obj.c rename to darwin/third_party/boringssl/src/crypto/x509/x509_obj.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x509_req.c b/darwin/third_party/boringssl/src/crypto/x509/x509_req.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x509_req.c rename to darwin/third_party/boringssl/src/crypto/x509/x509_req.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x509_set.c b/darwin/third_party/boringssl/src/crypto/x509/x509_set.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x509_set.c rename to darwin/third_party/boringssl/src/crypto/x509/x509_set.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x509_trs.c b/darwin/third_party/boringssl/src/crypto/x509/x509_trs.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x509_trs.c rename to darwin/third_party/boringssl/src/crypto/x509/x509_trs.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x509_txt.c b/darwin/third_party/boringssl/src/crypto/x509/x509_txt.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x509_txt.c rename to darwin/third_party/boringssl/src/crypto/x509/x509_txt.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x509_v3.c b/darwin/third_party/boringssl/src/crypto/x509/x509_v3.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x509_v3.c rename to darwin/third_party/boringssl/src/crypto/x509/x509_v3.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x509_vfy.c b/darwin/third_party/boringssl/src/crypto/x509/x509_vfy.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x509_vfy.c rename to darwin/third_party/boringssl/src/crypto/x509/x509_vfy.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x509_vpm.c b/darwin/third_party/boringssl/src/crypto/x509/x509_vpm.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x509_vpm.c rename to darwin/third_party/boringssl/src/crypto/x509/x509_vpm.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x509cset.c b/darwin/third_party/boringssl/src/crypto/x509/x509cset.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x509cset.c rename to darwin/third_party/boringssl/src/crypto/x509/x509cset.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x509name.c b/darwin/third_party/boringssl/src/crypto/x509/x509name.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x509name.c rename to darwin/third_party/boringssl/src/crypto/x509/x509name.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x509rset.c b/darwin/third_party/boringssl/src/crypto/x509/x509rset.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x509rset.c rename to darwin/third_party/boringssl/src/crypto/x509/x509rset.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x509spki.c b/darwin/third_party/boringssl/src/crypto/x509/x509spki.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x509spki.c rename to darwin/third_party/boringssl/src/crypto/x509/x509spki.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x_algor.c b/darwin/third_party/boringssl/src/crypto/x509/x_algor.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x_algor.c rename to darwin/third_party/boringssl/src/crypto/x509/x_algor.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x_all.c b/darwin/third_party/boringssl/src/crypto/x509/x_all.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x_all.c rename to darwin/third_party/boringssl/src/crypto/x509/x_all.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x_attrib.c b/darwin/third_party/boringssl/src/crypto/x509/x_attrib.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x_attrib.c rename to darwin/third_party/boringssl/src/crypto/x509/x_attrib.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x_crl.c b/darwin/third_party/boringssl/src/crypto/x509/x_crl.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x_crl.c rename to darwin/third_party/boringssl/src/crypto/x509/x_crl.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x_exten.c b/darwin/third_party/boringssl/src/crypto/x509/x_exten.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x_exten.c rename to darwin/third_party/boringssl/src/crypto/x509/x_exten.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x_info.c b/darwin/third_party/boringssl/src/crypto/x509/x_info.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x_info.c rename to darwin/third_party/boringssl/src/crypto/x509/x_info.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x_name.c b/darwin/third_party/boringssl/src/crypto/x509/x_name.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x_name.c rename to darwin/third_party/boringssl/src/crypto/x509/x_name.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x_pkey.c b/darwin/third_party/boringssl/src/crypto/x509/x_pkey.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x_pkey.c rename to darwin/third_party/boringssl/src/crypto/x509/x_pkey.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x_pubkey.c b/darwin/third_party/boringssl/src/crypto/x509/x_pubkey.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x_pubkey.c rename to darwin/third_party/boringssl/src/crypto/x509/x_pubkey.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x_req.c b/darwin/third_party/boringssl/src/crypto/x509/x_req.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x_req.c rename to darwin/third_party/boringssl/src/crypto/x509/x_req.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x_sig.c b/darwin/third_party/boringssl/src/crypto/x509/x_sig.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x_sig.c rename to darwin/third_party/boringssl/src/crypto/x509/x_sig.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x_spki.c b/darwin/third_party/boringssl/src/crypto/x509/x_spki.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x_spki.c rename to darwin/third_party/boringssl/src/crypto/x509/x_spki.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x_val.c b/darwin/third_party/boringssl/src/crypto/x509/x_val.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x_val.c rename to darwin/third_party/boringssl/src/crypto/x509/x_val.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x_x509.c b/darwin/third_party/boringssl/src/crypto/x509/x_x509.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x_x509.c rename to darwin/third_party/boringssl/src/crypto/x509/x_x509.c diff --git a/ios/third_party/boringssl/src/crypto/x509/x_x509a.c b/darwin/third_party/boringssl/src/crypto/x509/x_x509a.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509/x_x509a.c rename to darwin/third_party/boringssl/src/crypto/x509/x_x509a.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/pcy_cache.c b/darwin/third_party/boringssl/src/crypto/x509v3/pcy_cache.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/pcy_cache.c rename to darwin/third_party/boringssl/src/crypto/x509v3/pcy_cache.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/pcy_data.c b/darwin/third_party/boringssl/src/crypto/x509v3/pcy_data.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/pcy_data.c rename to darwin/third_party/boringssl/src/crypto/x509v3/pcy_data.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/pcy_map.c b/darwin/third_party/boringssl/src/crypto/x509v3/pcy_map.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/pcy_map.c rename to darwin/third_party/boringssl/src/crypto/x509v3/pcy_map.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/pcy_node.c b/darwin/third_party/boringssl/src/crypto/x509v3/pcy_node.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/pcy_node.c rename to darwin/third_party/boringssl/src/crypto/x509v3/pcy_node.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/pcy_tree.c b/darwin/third_party/boringssl/src/crypto/x509v3/pcy_tree.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/pcy_tree.c rename to darwin/third_party/boringssl/src/crypto/x509v3/pcy_tree.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_akey.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_akey.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_akey.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_akey.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_akeya.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_akeya.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_akeya.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_akeya.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_alt.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_alt.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_alt.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_alt.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_bcons.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_bcons.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_bcons.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_bcons.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_bitst.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_bitst.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_bitst.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_bitst.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_conf.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_conf.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_conf.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_conf.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_cpols.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_cpols.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_cpols.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_cpols.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_crld.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_crld.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_crld.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_crld.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_enum.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_enum.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_enum.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_enum.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_extku.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_extku.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_extku.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_extku.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_genn.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_genn.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_genn.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_genn.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_ia5.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_ia5.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_ia5.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_ia5.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_info.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_info.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_info.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_info.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_int.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_int.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_int.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_int.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_lib.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_lib.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_lib.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_lib.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_ncons.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_ncons.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_ncons.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_ncons.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_ocsp.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_ocsp.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_ocsp.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_ocsp.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_pci.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_pci.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_pci.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_pci.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_pcia.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_pcia.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_pcia.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_pcia.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_pcons.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_pcons.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_pcons.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_pcons.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_pmaps.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_pmaps.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_pmaps.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_pmaps.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_prn.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_prn.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_prn.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_prn.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_purp.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_purp.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_purp.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_purp.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_skey.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_skey.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_skey.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_skey.c diff --git a/ios/third_party/boringssl/src/crypto/x509v3/v3_utl.c b/darwin/third_party/boringssl/src/crypto/x509v3/v3_utl.c similarity index 100% rename from ios/third_party/boringssl/src/crypto/x509v3/v3_utl.c rename to darwin/third_party/boringssl/src/crypto/x509v3/v3_utl.c diff --git a/ios/webcrypto.podspec b/darwin/webcrypto.podspec similarity index 92% rename from ios/webcrypto.podspec rename to darwin/webcrypto.podspec index 9856ded7..13c9d766 100644 --- a/ios/webcrypto.podspec +++ b/darwin/webcrypto.podspec @@ -13,8 +13,10 @@ Pod::Spec.new do |s| s.author = { 'Jonas Finnemann Jensen' => 'jonasfj@google.com' } s.source = { :path => '.' } s.swift_version = '5.0' - s.platform = :ios, '9.0' - s.dependency 'Flutter' + s.ios.dependency 'Flutter' + s.osx.dependency 'FlutterMacOS' + s.ios.deployment_target = '9.0' + s.osx.deployment_target = '10.11' s.public_header_files = 'Classes/**/*.h' s.source_files = [ diff --git a/example/.metadata b/example/.metadata index 9151f725..df64d29e 100644 --- a/example/.metadata +++ b/example/.metadata @@ -4,7 +4,7 @@ # This file should be version controlled. version: - revision: 85684f9300908116a78138ea4c6036c35c9a1236 + revision: 796c8ef79279f9c774545b3771238c3098dbefab channel: stable project_type: app @@ -13,17 +13,11 @@ project_type: app migration: platforms: - platform: root - create_revision: 85684f9300908116a78138ea4c6036c35c9a1236 - base_revision: 85684f9300908116a78138ea4c6036c35c9a1236 - - platform: android - create_revision: 85684f9300908116a78138ea4c6036c35c9a1236 - base_revision: 85684f9300908116a78138ea4c6036c35c9a1236 - - platform: ios - create_revision: 85684f9300908116a78138ea4c6036c35c9a1236 - base_revision: 85684f9300908116a78138ea4c6036c35c9a1236 - - platform: web - create_revision: 85684f9300908116a78138ea4c6036c35c9a1236 - base_revision: 85684f9300908116a78138ea4c6036c35c9a1236 + create_revision: 796c8ef79279f9c774545b3771238c3098dbefab + base_revision: 796c8ef79279f9c774545b3771238c3098dbefab + - platform: windows + create_revision: 796c8ef79279f9c774545b3771238c3098dbefab + base_revision: 796c8ef79279f9c774545b3771238c3098dbefab # User provided section diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index 8d4492f9..9625e105 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ <key>CFBundleVersion</key> <string>1.0</string> <key>MinimumOSVersion</key> - <string>9.0</string> + <string>11.0</string> </dict> </plist> diff --git a/example/ios/Podfile b/example/ios/Podfile index 1e8c3c90..88359b22 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '9.0' +# platform :ios, '11.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 5e693d24..2a81a31d 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,22 +1,28 @@ PODS: - Flutter (1.0.0) + - integration_test (0.0.1): + - Flutter - webcrypto (0.1.1): - Flutter DEPENDENCIES: - Flutter (from `Flutter`) - - webcrypto (from `.symlinks/plugins/webcrypto/ios`) + - integration_test (from `.symlinks/plugins/integration_test/ios`) + - webcrypto (from `.symlinks/plugins/webcrypto/darwin`) EXTERNAL SOURCES: Flutter: :path: Flutter + integration_test: + :path: ".symlinks/plugins/integration_test/ios" webcrypto: - :path: ".symlinks/plugins/webcrypto/ios" + :path: ".symlinks/plugins/webcrypto/darwin" SPEC CHECKSUMS: - Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a - webcrypto: 58dac29c85327d3d72a47d19d44128f10905f58e + Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + integration_test: 13825b8a9334a850581300559b8839134b124670 + webcrypto: ac6760231381596272150408fb76d5dece3d74fd -PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c +PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3 -COCOAPODS: 1.11.3 +COCOAPODS: 1.12.1 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 810ed824..8571544b 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -68,7 +68,6 @@ 7B936E079E8A89F5F72B366E /* Pods-Runner.release.xcconfig */, 948EB5348641EBC22DBF0A87 /* Pods-Runner.profile.xcconfig */, ); - name = Pods; path = Pods; sourceTree = "<group>"; }; @@ -200,10 +199,12 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -231,6 +232,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -340,7 +342,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -356,7 +358,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = F5VWE32T4U; + DEVELOPMENT_TEAM = VU9TZX2APU; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -418,7 +420,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -467,7 +469,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -485,7 +487,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = F5VWE32T4U; + DEVELOPMENT_TEAM = VU9TZX2APU; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -508,7 +510,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = F5VWE32T4U; + DEVELOPMENT_TEAM = VU9TZX2APU; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist index 12f680d3..41319eb9 100644 --- a/example/ios/Runner/Info.plist +++ b/example/ios/Runner/Info.plist @@ -45,5 +45,7 @@ <false/> <key>CADisableMinimumFrameDurationOnPhone</key> <true/> + <key>UIApplicationSupportsIndirectInputEvents</key> + <true/> </dict> </plist> diff --git a/example/macos/.gitignore b/example/macos/.gitignore new file mode 100644 index 00000000..746adbb6 --- /dev/null +++ b/example/macos/.gitignore @@ -0,0 +1,7 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/dgph +**/xcuserdata/ diff --git a/example/macos/Flutter/Flutter-Debug.xcconfig b/example/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 00000000..4b81f9b2 --- /dev/null +++ b/example/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/example/macos/Flutter/Flutter-Release.xcconfig b/example/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 00000000..5caa9d15 --- /dev/null +++ b/example/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/example/macos/Flutter/GeneratedPluginRegistrant.swift b/example/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 00000000..edfcf939 --- /dev/null +++ b/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,12 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import webcrypto + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + WebcryptoPlugin.register(with: registry.registrar(forPlugin: "WebcryptoPlugin")) +} diff --git a/example/macos/Podfile b/example/macos/Podfile new file mode 100644 index 00000000..c795730d --- /dev/null +++ b/example/macos/Podfile @@ -0,0 +1,43 @@ +platform :osx, '10.14' + +# 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__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/example/macos/Podfile.lock b/example/macos/Podfile.lock new file mode 100644 index 00000000..7065f5b8 --- /dev/null +++ b/example/macos/Podfile.lock @@ -0,0 +1,23 @@ +PODS: + - FlutterMacOS (1.0.0) + - webcrypto (0.1.1): + - Flutter + - FlutterMacOS + +DEPENDENCIES: + - FlutterMacOS (from `Flutter/ephemeral`) + - webcrypto (from `Flutter/ephemeral/.symlinks/plugins/webcrypto/darwin`) + +EXTERNAL SOURCES: + FlutterMacOS: + :path: Flutter/ephemeral + webcrypto: + :path: Flutter/ephemeral/.symlinks/plugins/webcrypto/darwin + +SPEC CHECKSUMS: + FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 + webcrypto: f44963fa2d88f93deea971a9f59f2e21c2301689 + +PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367 + +COCOAPODS: 1.12.1 diff --git a/example/macos/Runner.xcodeproj/project.pbxproj b/example/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..c02a361f --- /dev/null +++ b/example/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,791 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + 40AE9382C9F6BA4231808A8F /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA5B2E54E60C29EE16497380 /* Pods_RunnerTests.framework */; }; + 4C3CCB7ED4822AA66D942BBA /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D77B2651F31BCFB99C919C91 /* Pods_Runner.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC10EC2044A3C60003C045; + remoteInfo = Runner; + }; + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1C50EA1A1D9FC7AE9B1E75C6 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; }; + 217C9BE7B520FC84ED014EA3 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; }; + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; }; + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; }; + 33CC10ED2044A3C60003C045 /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = "<group>"; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = "<group>"; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = "<group>"; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = "<group>"; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = "<group>"; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; }; + 5756F1F65E1F97EEB74DA1C3 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; }; + 6AA19177C6A3D2A53B049A12 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; }; + D5EF4C9035BAFB1A36A62907 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; }; + D77B2651F31BCFB99C919C91 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D9A14E966DC67FB72914B6BD /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; }; + FA5B2E54E60C29EE16497380 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 331C80D2294CF70F00263BE5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 40AE9382C9F6BA4231808A8F /* Pods_RunnerTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 4C3CCB7ED4822AA66D942BBA /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C80D6294CF71000263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C80D7294CF71000263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = "<group>"; + }; + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = "<group>"; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 331C80D6294CF71000263BE5 /* RunnerTests */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + 7024B34E4E5C632C26946D94 /* Pods */, + ); + sourceTree = "<group>"; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* example.app */, + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = "<group>"; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = "<group>"; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + ); + path = Flutter; + sourceTree = "<group>"; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = "<group>"; + }; + 7024B34E4E5C632C26946D94 /* Pods */ = { + isa = PBXGroup; + children = ( + D5EF4C9035BAFB1A36A62907 /* Pods-Runner.debug.xcconfig */, + 217C9BE7B520FC84ED014EA3 /* Pods-Runner.release.xcconfig */, + D9A14E966DC67FB72914B6BD /* Pods-Runner.profile.xcconfig */, + 1C50EA1A1D9FC7AE9B1E75C6 /* Pods-RunnerTests.debug.xcconfig */, + 6AA19177C6A3D2A53B049A12 /* Pods-RunnerTests.release.xcconfig */, + 5756F1F65E1F97EEB74DA1C3 /* Pods-RunnerTests.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = "<group>"; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + D77B2651F31BCFB99C919C91 /* Pods_Runner.framework */, + FA5B2E54E60C29EE16497380 /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = "<group>"; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C80D4294CF70F00263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 1839A43E771D766AC9CCDAEF /* [CP] Check Pods Manifest.lock */, + 331C80D1294CF70F00263BE5 /* Sources */, + 331C80D2294CF70F00263BE5 /* Frameworks */, + 331C80D3294CF70F00263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C80DA294CF71000263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 6800ED0710F546F9643253C7 /* [CP] Check Pods Manifest.lock */, + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + CB0ADEBB4CE3CEFA218C5D2C /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* example.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 1300; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C80D4294CF70F00263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 33CC10EC2044A3C60003C045; + }; + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 331C80D4294CF70F00263BE5 /* RunnerTests */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C80D3294CF70F00263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 1839A43E771D766AC9CCDAEF /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; + 6800ED0710F546F9643253C7 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + CB0ADEBB4CE3CEFA218C5D2C /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C80D1294CF70F00263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC10EC2044A3C60003C045 /* Runner */; + targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; + }; + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = "<group>"; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 331C80DB294CF71000263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 1C50EA1A1D9FC7AE9B1E75C6 /* Pods-RunnerTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example"; + }; + name = Debug; + }; + 331C80DC294CF71000263BE5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 6AA19177C6A3D2A53B049A12 /* Pods-RunnerTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example"; + }; + name = Release; + }; + 331C80DD294CF71000263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5756F1F65E1F97EEB74DA1C3 /* Pods-RunnerTests.profile.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example"; + }; + name = Profile; + }; + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C80DB294CF71000263BE5 /* Debug */, + 331C80DC294CF71000263BE5 /* Release */, + 331C80DD294CF71000263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>IDEDidComputeMac32BitWarning</key> + <true/> +</dict> +</plist> diff --git a/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..8fedab68 --- /dev/null +++ b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + LastUpgradeVersion = "1300" + version = "1.3"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES"> + <BuildActionEntries> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "33CC10EC2044A3C60003C045" + BuildableName = "example.app" + BlueprintName = "Runner" + ReferencedContainer = "container:Runner.xcodeproj"> + </BuildableReference> + </BuildActionEntry> + </BuildActionEntries> + </BuildAction> + <TestAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES"> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "33CC10EC2044A3C60003C045" + BuildableName = "example.app" + BlueprintName = "Runner" + ReferencedContainer = "container:Runner.xcodeproj"> + </BuildableReference> + </MacroExpansion> + <Testables> + <TestableReference + skipped = "NO" + parallelizable = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "331C80D4294CF70F00263BE5" + BuildableName = "RunnerTests.xctest" + BlueprintName = "RunnerTests" + ReferencedContainer = "container:Runner.xcodeproj"> + </BuildableReference> + </TestableReference> + </Testables> + </TestAction> + <LaunchAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "NO" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "YES" + debugServiceExtension = "internal" + allowLocationSimulation = "YES"> + <BuildableProductRunnable + runnableDebuggingMode = "0"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "33CC10EC2044A3C60003C045" + BuildableName = "example.app" + BlueprintName = "Runner" + ReferencedContainer = "container:Runner.xcodeproj"> + </BuildableReference> + </BuildableProductRunnable> + </LaunchAction> + <ProfileAction + buildConfiguration = "Profile" + shouldUseLaunchSchemeArgsEnv = "YES" + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + debugDocumentVersioning = "YES"> + <BuildableProductRunnable + runnableDebuggingMode = "0"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "33CC10EC2044A3C60003C045" + BuildableName = "example.app" + BlueprintName = "Runner" + ReferencedContainer = "container:Runner.xcodeproj"> + </BuildableReference> + </BuildableProductRunnable> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Debug"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Release" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> diff --git a/example/macos/Runner.xcworkspace/contents.xcworkspacedata b/example/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..21a3cc14 --- /dev/null +++ b/example/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Workspace + version = "1.0"> + <FileRef + location = "group:Runner.xcodeproj"> + </FileRef> + <FileRef + location = "group:Pods/Pods.xcodeproj"> + </FileRef> +</Workspace> diff --git a/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>IDEDidComputeMac32BitWarning</key> + <true/> +</dict> +</plist> diff --git a/example/macos/Runner/AppDelegate.swift b/example/macos/Runner/AppDelegate.swift new file mode 100644 index 00000000..d53ef643 --- /dev/null +++ b/example/macos/Runner/AppDelegate.swift @@ -0,0 +1,9 @@ +import Cocoa +import FlutterMacOS + +@NSApplicationMain +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } +} diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..a2ec33f1 --- /dev/null +++ b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_1024.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 00000000..82b6f9d9 Binary files /dev/null and b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 00000000..13b35eba Binary files /dev/null and b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 00000000..0a3f5fa4 Binary files /dev/null and b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 00000000..bdb57226 Binary files /dev/null and b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 00000000..f083318e Binary files /dev/null and b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 00000000..326c0e72 Binary files /dev/null and b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 00000000..2f1632cf Binary files /dev/null and b/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/example/macos/Runner/Base.lproj/MainMenu.xib b/example/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 00000000..80e867a4 --- /dev/null +++ b/example/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,343 @@ +<?xml version="1.0" encoding="UTF-8"?> +<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct"> + <dependencies> + <deployment identifier="macosx"/> + <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/> + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> + </dependencies> + <objects> + <customObject id="-2" userLabel="File's Owner" customClass="NSApplication"> + <connections> + <outlet property="delegate" destination="Voe-Tx-rLC" id="GzC-gU-4Uq"/> + </connections> + </customObject> + <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> + <customObject id="-3" userLabel="Application" customClass="NSObject"/> + <customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="Runner" customModuleProvider="target"> + <connections> + <outlet property="applicationMenu" destination="uQy-DD-JDr" id="XBo-yE-nKs"/> + <outlet property="mainFlutterWindow" destination="QvC-M9-y7g" id="gIp-Ho-8D9"/> + </connections> + </customObject> + <customObject id="YLy-65-1bz" customClass="NSFontManager"/> + <menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6"> + <items> + <menuItem title="APP_NAME" id="1Xt-HY-uBw"> + <modifierMask key="keyEquivalentModifierMask"/> + <menu key="submenu" title="APP_NAME" systemMenu="apple" id="uQy-DD-JDr"> + <items> + <menuItem title="About APP_NAME" id="5kV-Vb-QxS"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="orderFrontStandardAboutPanel:" target="-1" id="Exp-CZ-Vem"/> + </connections> + </menuItem> + <menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/> + <menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/> + <menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/> + <menuItem title="Services" id="NMo-om-nkz"> + <modifierMask key="keyEquivalentModifierMask"/> + <menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/> + </menuItem> + <menuItem isSeparatorItem="YES" id="4je-JR-u6R"/> + <menuItem title="Hide APP_NAME" keyEquivalent="h" id="Olw-nP-bQN"> + <connections> + <action selector="hide:" target="-1" id="PnN-Uc-m68"/> + </connections> + </menuItem> + <menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO"> + <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> + <connections> + <action selector="hideOtherApplications:" target="-1" id="VT4-aY-XCT"/> + </connections> + </menuItem> + <menuItem title="Show All" id="Kd2-mp-pUS"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="unhideAllApplications:" target="-1" id="Dhg-Le-xox"/> + </connections> + </menuItem> + <menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/> + <menuItem title="Quit APP_NAME" keyEquivalent="q" id="4sb-4s-VLi"> + <connections> + <action selector="terminate:" target="-1" id="Te7-pn-YzF"/> + </connections> + </menuItem> + </items> + </menu> + </menuItem> + <menuItem title="Edit" id="5QF-Oa-p0T"> + <modifierMask key="keyEquivalentModifierMask"/> + <menu key="submenu" title="Edit" id="W48-6f-4Dl"> + <items> + <menuItem title="Undo" keyEquivalent="z" id="dRJ-4n-Yzg"> + <connections> + <action selector="undo:" target="-1" id="M6e-cu-g7V"/> + </connections> + </menuItem> + <menuItem title="Redo" keyEquivalent="Z" id="6dh-zS-Vam"> + <connections> + <action selector="redo:" target="-1" id="oIA-Rs-6OD"/> + </connections> + </menuItem> + <menuItem isSeparatorItem="YES" id="WRV-NI-Exz"/> + <menuItem title="Cut" keyEquivalent="x" id="uRl-iY-unG"> + <connections> + <action selector="cut:" target="-1" id="YJe-68-I9s"/> + </connections> + </menuItem> + <menuItem title="Copy" keyEquivalent="c" id="x3v-GG-iWU"> + <connections> + <action selector="copy:" target="-1" id="G1f-GL-Joy"/> + </connections> + </menuItem> + <menuItem title="Paste" keyEquivalent="v" id="gVA-U4-sdL"> + <connections> + <action selector="paste:" target="-1" id="UvS-8e-Qdg"/> + </connections> + </menuItem> + <menuItem title="Paste and Match Style" keyEquivalent="V" id="WeT-3V-zwk"> + <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> + <connections> + <action selector="pasteAsPlainText:" target="-1" id="cEh-KX-wJQ"/> + </connections> + </menuItem> + <menuItem title="Delete" id="pa3-QI-u2k"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="delete:" target="-1" id="0Mk-Ml-PaM"/> + </connections> + </menuItem> + <menuItem title="Select All" keyEquivalent="a" id="Ruw-6m-B2m"> + <connections> + <action selector="selectAll:" target="-1" id="VNm-Mi-diN"/> + </connections> + </menuItem> + <menuItem isSeparatorItem="YES" id="uyl-h8-XO2"/> + <menuItem title="Find" id="4EN-yA-p0u"> + <modifierMask key="keyEquivalentModifierMask"/> + <menu key="submenu" title="Find" id="1b7-l0-nxx"> + <items> + <menuItem title="Find…" tag="1" keyEquivalent="f" id="Xz5-n4-O0W"> + <connections> + <action selector="performFindPanelAction:" target="-1" id="cD7-Qs-BN4"/> + </connections> + </menuItem> + <menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="YEy-JH-Tfz"> + <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> + <connections> + <action selector="performFindPanelAction:" target="-1" id="WD3-Gg-5AJ"/> + </connections> + </menuItem> + <menuItem title="Find Next" tag="2" keyEquivalent="g" id="q09-fT-Sye"> + <connections> + <action selector="performFindPanelAction:" target="-1" id="NDo-RZ-v9R"/> + </connections> + </menuItem> + <menuItem title="Find Previous" tag="3" keyEquivalent="G" id="OwM-mh-QMV"> + <connections> + <action selector="performFindPanelAction:" target="-1" id="HOh-sY-3ay"/> + </connections> + </menuItem> + <menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="buJ-ug-pKt"> + <connections> + <action selector="performFindPanelAction:" target="-1" id="U76-nv-p5D"/> + </connections> + </menuItem> + <menuItem title="Jump to Selection" keyEquivalent="j" id="S0p-oC-mLd"> + <connections> + <action selector="centerSelectionInVisibleArea:" target="-1" id="IOG-6D-g5B"/> + </connections> + </menuItem> + </items> + </menu> + </menuItem> + <menuItem title="Spelling and Grammar" id="Dv1-io-Yv7"> + <modifierMask key="keyEquivalentModifierMask"/> + <menu key="submenu" title="Spelling" id="3IN-sU-3Bg"> + <items> + <menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="HFo-cy-zxI"> + <connections> + <action selector="showGuessPanel:" target="-1" id="vFj-Ks-hy3"/> + </connections> + </menuItem> + <menuItem title="Check Document Now" keyEquivalent=";" id="hz2-CU-CR7"> + <connections> + <action selector="checkSpelling:" target="-1" id="fz7-VC-reM"/> + </connections> + </menuItem> + <menuItem isSeparatorItem="YES" id="bNw-od-mp5"/> + <menuItem title="Check Spelling While Typing" id="rbD-Rh-wIN"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="toggleContinuousSpellChecking:" target="-1" id="7w6-Qz-0kB"/> + </connections> + </menuItem> + <menuItem title="Check Grammar With Spelling" id="mK6-2p-4JG"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="toggleGrammarChecking:" target="-1" id="muD-Qn-j4w"/> + </connections> + </menuItem> + <menuItem title="Correct Spelling Automatically" id="78Y-hA-62v"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="toggleAutomaticSpellingCorrection:" target="-1" id="2lM-Qi-WAP"/> + </connections> + </menuItem> + </items> + </menu> + </menuItem> + <menuItem title="Substitutions" id="9ic-FL-obx"> + <modifierMask key="keyEquivalentModifierMask"/> + <menu key="submenu" title="Substitutions" id="FeM-D8-WVr"> + <items> + <menuItem title="Show Substitutions" id="z6F-FW-3nz"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="orderFrontSubstitutionsPanel:" target="-1" id="oku-mr-iSq"/> + </connections> + </menuItem> + <menuItem isSeparatorItem="YES" id="gPx-C9-uUO"/> + <menuItem title="Smart Copy/Paste" id="9yt-4B-nSM"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="toggleSmartInsertDelete:" target="-1" id="3IJ-Se-DZD"/> + </connections> + </menuItem> + <menuItem title="Smart Quotes" id="hQb-2v-fYv"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="toggleAutomaticQuoteSubstitution:" target="-1" id="ptq-xd-QOA"/> + </connections> + </menuItem> + <menuItem title="Smart Dashes" id="rgM-f4-ycn"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="toggleAutomaticDashSubstitution:" target="-1" id="oCt-pO-9gS"/> + </connections> + </menuItem> + <menuItem title="Smart Links" id="cwL-P1-jid"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="toggleAutomaticLinkDetection:" target="-1" id="Gip-E3-Fov"/> + </connections> + </menuItem> + <menuItem title="Data Detectors" id="tRr-pd-1PS"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="toggleAutomaticDataDetection:" target="-1" id="R1I-Nq-Kbl"/> + </connections> + </menuItem> + <menuItem title="Text Replacement" id="HFQ-gK-NFA"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="toggleAutomaticTextReplacement:" target="-1" id="DvP-Fe-Py6"/> + </connections> + </menuItem> + </items> + </menu> + </menuItem> + <menuItem title="Transformations" id="2oI-Rn-ZJC"> + <modifierMask key="keyEquivalentModifierMask"/> + <menu key="submenu" title="Transformations" id="c8a-y6-VQd"> + <items> + <menuItem title="Make Upper Case" id="vmV-6d-7jI"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="uppercaseWord:" target="-1" id="sPh-Tk-edu"/> + </connections> + </menuItem> + <menuItem title="Make Lower Case" id="d9M-CD-aMd"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="lowercaseWord:" target="-1" id="iUZ-b5-hil"/> + </connections> + </menuItem> + <menuItem title="Capitalize" id="UEZ-Bs-lqG"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="capitalizeWord:" target="-1" id="26H-TL-nsh"/> + </connections> + </menuItem> + </items> + </menu> + </menuItem> + <menuItem title="Speech" id="xrE-MZ-jX0"> + <modifierMask key="keyEquivalentModifierMask"/> + <menu key="submenu" title="Speech" id="3rS-ZA-NoH"> + <items> + <menuItem title="Start Speaking" id="Ynk-f8-cLZ"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="startSpeaking:" target="-1" id="654-Ng-kyl"/> + </connections> + </menuItem> + <menuItem title="Stop Speaking" id="Oyz-dy-DGm"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="stopSpeaking:" target="-1" id="dX8-6p-jy9"/> + </connections> + </menuItem> + </items> + </menu> + </menuItem> + </items> + </menu> + </menuItem> + <menuItem title="View" id="H8h-7b-M4v"> + <modifierMask key="keyEquivalentModifierMask"/> + <menu key="submenu" title="View" id="HyV-fh-RgO"> + <items> + <menuItem title="Enter Full Screen" keyEquivalent="f" id="4J7-dP-txa"> + <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/> + <connections> + <action selector="toggleFullScreen:" target="-1" id="dU3-MA-1Rq"/> + </connections> + </menuItem> + </items> + </menu> + </menuItem> + <menuItem title="Window" id="aUF-d1-5bR"> + <modifierMask key="keyEquivalentModifierMask"/> + <menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo"> + <items> + <menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV"> + <connections> + <action selector="performMiniaturize:" target="-1" id="VwT-WD-YPe"/> + </connections> + </menuItem> + <menuItem title="Zoom" id="R4o-n2-Eq4"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="performZoom:" target="-1" id="DIl-cC-cCs"/> + </connections> + </menuItem> + <menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/> + <menuItem title="Bring All to Front" id="LE2-aR-0XJ"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="arrangeInFront:" target="-1" id="DRN-fu-gQh"/> + </connections> + </menuItem> + </items> + </menu> + </menuItem> + <menuItem title="Help" id="EPT-qC-fAb"> + <modifierMask key="keyEquivalentModifierMask"/> + <menu key="submenu" title="Help" systemMenu="help" id="rJ0-wn-3NY"/> + </menuItem> + </items> + <point key="canvasLocation" x="142" y="-258"/> + </menu> + <window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target"> + <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/> + <rect key="contentRect" x="335" y="390" width="800" height="600"/> + <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1577"/> + <view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ"> + <rect key="frame" x="0.0" y="0.0" width="800" height="600"/> + <autoresizingMask key="autoresizingMask"/> + </view> + </window> + </objects> +</document> diff --git a/example/macos/Runner/Configs/AppInfo.xcconfig b/example/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 00000000..dda192bc --- /dev/null +++ b/example/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = example + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.example.example + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved. diff --git a/example/macos/Runner/Configs/Debug.xcconfig b/example/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 00000000..36b0fd94 --- /dev/null +++ b/example/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/example/macos/Runner/Configs/Release.xcconfig b/example/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 00000000..dff4f495 --- /dev/null +++ b/example/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/example/macos/Runner/Configs/Warnings.xcconfig b/example/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 00000000..42bcbf47 --- /dev/null +++ b/example/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/example/macos/Runner/DebugProfile.entitlements b/example/macos/Runner/DebugProfile.entitlements new file mode 100644 index 00000000..dddb8a30 --- /dev/null +++ b/example/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>com.apple.security.app-sandbox</key> + <true/> + <key>com.apple.security.cs.allow-jit</key> + <true/> + <key>com.apple.security.network.server</key> + <true/> +</dict> +</plist> diff --git a/example/macos/Runner/Info.plist b/example/macos/Runner/Info.plist new file mode 100644 index 00000000..4789daa6 --- /dev/null +++ b/example/macos/Runner/Info.plist @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>$(DEVELOPMENT_LANGUAGE)</string> + <key>CFBundleExecutable</key> + <string>$(EXECUTABLE_NAME)</string> + <key>CFBundleIconFile</key> + <string></string> + <key>CFBundleIdentifier</key> + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>$(PRODUCT_NAME)</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleShortVersionString</key> + <string>$(FLUTTER_BUILD_NAME)</string> + <key>CFBundleVersion</key> + <string>$(FLUTTER_BUILD_NUMBER)</string> + <key>LSMinimumSystemVersion</key> + <string>$(MACOSX_DEPLOYMENT_TARGET)</string> + <key>NSHumanReadableCopyright</key> + <string>$(PRODUCT_COPYRIGHT)</string> + <key>NSMainNibFile</key> + <string>MainMenu</string> + <key>NSPrincipalClass</key> + <string>NSApplication</string> +</dict> +</plist> diff --git a/example/macos/Runner/MainFlutterWindow.swift b/example/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 00000000..3cc05eb2 --- /dev/null +++ b/example/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/example/macos/Runner/Release.entitlements b/example/macos/Runner/Release.entitlements new file mode 100644 index 00000000..852fa1a4 --- /dev/null +++ b/example/macos/Runner/Release.entitlements @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>com.apple.security.app-sandbox</key> + <true/> +</dict> +</plist> diff --git a/example/macos/RunnerTests/RunnerTests.swift b/example/macos/RunnerTests/RunnerTests.swift new file mode 100644 index 00000000..5418c9f5 --- /dev/null +++ b/example/macos/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import FlutterMacOS +import Cocoa +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/example/pubspec.lock b/example/pubspec.lock index bc932a5b..1ce51987 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,114 +5,122 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + sha256: "4897882604d919befd350648c7f91926a9d5de99e67b455bf0917cc2362f4bb8" + url: "https://pub.dev" source: hosted version: "47.0.0" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.dartlang.org" + sha256: "690e335554a8385bc9d787117d9eb52c0c03ee207a607e593de3c9d71b1cfe80" + url: "https://pub.dev" source: hosted version: "4.7.0" - archive: - dependency: transitive - description: - name: archive - url: "https://pub.dartlang.org" - source: hosted - version: "3.3.0" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + sha256: b003c3098049a51720352d219b0bb5f219b60fbfb68e7a4748139a06a5676515 + url: "https://pub.dev" source: hosted version: "2.3.1" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.9.0" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.1" convert: dependency: "direct main" description: name: convert - url: "https://pub.dartlang.org" + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" source: hosted version: "3.1.1" coverage: dependency: transitive description: name: coverage - url: "https://pub.dartlang.org" + sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097" + url: "https://pub.dev" source: hosted - version: "1.5.0" + version: "1.6.3" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 + url: "https://pub.dev" source: hosted version: "3.0.2" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + url: "https://pub.dev" source: hosted version: "1.0.5" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted version: "1.3.1" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978 + url: "https://pub.dev" source: hosted version: "2.0.1" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" source: hosted - version: "6.1.2" + version: "6.1.4" flutter: dependency: "direct main" description: flutter @@ -137,9 +145,10 @@ packages: dependency: transitive description: name: frontend_server_client - url: "https://pub.dartlang.org" + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "3.2.0" fuchsia_remote_debug_protocol: dependency: transitive description: flutter @@ -149,21 +158,24 @@ packages: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + sha256: c51b4fdfee4d281f49b8c957f1add91b815473597f76bcf07377987f66a55729 + url: "https://pub.dev" source: hosted version: "2.1.0" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.dartlang.org" + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" source: hosted version: "3.2.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" source: hosted version: "4.0.2" integration_test: @@ -175,126 +187,144 @@ packages: dependency: transitive description: name: io - url: "https://pub.dartlang.org" + sha256: "0d4c73c3653ab85bf696d51a9657604c900a370549196a91f33e4c39af760852" + url: "https://pub.dev" source: hosted version: "1.0.3" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" source: hosted - version: "0.6.4" + version: "0.6.7" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: c0bbfe94d46aedf9b8b3e695cf3bd48c8e14b35e3b2c639e0aa7755d589ba946 + url: "https://pub.dev" source: hosted version: "1.1.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" source: hosted - version: "0.12.12" + version: "0.12.15" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "0.1.5" + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" mime: dependency: transitive description: name: mime - url: "https://pub.dartlang.org" + sha256: dab22e92b41aa1255ea90ddc4bc2feaf35544fd0728e209638cad041a6e3928a + url: "https://pub.dev" source: hosted version: "1.0.2" node_preamble: dependency: transitive description: name: node_preamble - url: "https://pub.dartlang.org" + sha256: "8ebdbaa3b96d5285d068f80772390d27c21e1fa10fb2df6627b1b9415043608d" + url: "https://pub.dev" source: hosted version: "2.0.1" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" source: hosted version: "2.1.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + url: "https://pub.dev" source: hosted version: "3.1.0" pool: dependency: transitive description: name: pool - url: "https://pub.dartlang.org" + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" source: hosted version: "1.5.1" process: dependency: transitive description: name: process - url: "https://pub.dartlang.org" + sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" + url: "https://pub.dev" source: hosted version: "4.2.4" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.dartlang.org" + sha256: b959af0a045c3484c4a8f4997731f5bfe4cac60d732fd8ce35b351f2d6a459fe + url: "https://pub.dev" source: hosted version: "2.1.2" shelf: dependency: transitive description: name: shelf - url: "https://pub.dartlang.org" + sha256: c24a96135a2ccd62c64b69315a14adc5c3419df63b4d7c05832a346fdb73682c + url: "https://pub.dev" source: hosted version: "1.4.0" shelf_packages_handler: dependency: transitive description: name: shelf_packages_handler - url: "https://pub.dartlang.org" + sha256: aef74dc9195746a384843102142ab65b6a4735bb3beea791e63527b88cc83306 + url: "https://pub.dev" source: hosted version: "3.0.1" shelf_static: dependency: transitive description: name: shelf_static - url: "https://pub.dartlang.org" + sha256: e792b76b96a36d4a41b819da593aff4bdd413576b3ba6150df5d8d9996d2e74c + url: "https://pub.dev" source: hosted version: "1.1.1" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.dartlang.org" + sha256: "6db16374bc3497d21aa0eebe674d3db9fdf82082aac0f04dc7b44e4af5b08afc" + url: "https://pub.dev" source: hosted version: "1.0.2" sky_engine: @@ -306,112 +336,128 @@ packages: dependency: transitive description: name: source_map_stack_trace - url: "https://pub.dartlang.org" + sha256: "8c463326277f68a628abab20580047b419c2ff66756fd0affd451f73f9508c11" + url: "https://pub.dev" source: hosted version: "2.1.0" source_maps: dependency: transitive description: name: source_maps - url: "https://pub.dartlang.org" + sha256: "52de2200bb098de739794c82d09c41ac27b2e42fd7e23cce7b9c74bf653c7296" + url: "https://pub.dev" source: hosted version: "0.10.10" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" sync_http: dependency: transitive description: name: sync_http - url: "https://pub.dartlang.org" + sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" + url: "https://pub.dev" source: hosted version: "0.3.1" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted version: "1.2.1" test: dependency: "direct dev" description: name: test - url: "https://pub.dartlang.org" + sha256: "3dac9aecf2c3991d09b9cdde4f98ded7b30804a88a0d7e4e7e1678e78d6b97f4" + url: "https://pub.dev" source: hosted - version: "1.21.4" + version: "1.24.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" source: hosted - version: "0.4.12" + version: "0.5.1" test_core: dependency: transitive description: name: test_core - url: "https://pub.dartlang.org" + sha256: "5138dbffb77b2289ecb12b81c11ba46036590b72a64a7a90d6ffb880f1a29e93" + url: "https://pub.dev" source: hosted - version: "0.4.16" + version: "0.5.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" + url: "https://pub.dev" source: hosted version: "1.3.1" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" vm_service: dependency: transitive description: name: vm_service - url: "https://pub.dartlang.org" + sha256: f6deed8ed625c52864792459709183da231ebf66ff0cf09e69b573227c377efe + url: "https://pub.dev" source: hosted - version: "9.0.0" + version: "11.3.0" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + sha256: "6a7f46926b01ce81bfc339da6a7f20afbe7733eff9846f6d6a5466aa4c6667c0" + url: "https://pub.dev" source: hosted version: "1.0.2" web_socket_channel: dependency: transitive description: name: web_socket_channel - url: "https://pub.dartlang.org" + sha256: "3a969ddcc204a3e34e863d204b29c0752716f78b6f9cc8235083208d268a4ccd" + url: "https://pub.dev" source: hosted version: "2.2.0" webcrypto: @@ -420,28 +466,31 @@ packages: path: ".." relative: true source: path - version: "0.5.3" + version: "0.5.4" webdriver: dependency: transitive description: name: webdriver - url: "https://pub.dartlang.org" + sha256: "3c923e918918feeb90c4c9fdf1fe39220fa4c0e8e2c0fffaded174498ef86c49" + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.0.2" webkit_inspection_protocol: dependency: transitive description: name: webkit_inspection_protocol - url: "https://pub.dartlang.org" + sha256: "67d3a8b6c79e1987d19d848b0892e582dbb0c66c57cc1fef58a177dd2aa2823d" + url: "https://pub.dev" source: hosted version: "1.2.0" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" + url: "https://pub.dev" source: hosted version: "3.1.1" sdks: - dart: ">=2.18.0 <3.0.0" + dart: ">=3.0.0-0 <4.0.0" flutter: ">=3.0.0" diff --git a/example/windows/.gitignore b/example/windows/.gitignore new file mode 100644 index 00000000..ec4098aa --- /dev/null +++ b/example/windows/.gitignore @@ -0,0 +1,17 @@ +flutter/ephemeral/ + +# Visual Studio user-specific files. +*.suo +*.user +*.userosscache +*.sln.docstates + +# Visual Studio build-related files. +x64/ +x86/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ diff --git a/example/windows/CMakeLists.txt b/example/windows/CMakeLists.txt new file mode 100644 index 00000000..1711b9ba --- /dev/null +++ b/example/windows/CMakeLists.txt @@ -0,0 +1,102 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.14) +project(example LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "example") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(SET CMP0063 NEW) + +# Define build configuration option. +get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(IS_MULTICONFIG) + set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" + CACHE STRING "" FORCE) +else() + if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") + endif() +endif() +# Define settings for the Profile build mode. +set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") +set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") +set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") +set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") + +# Use Unicode for all projects. +add_definitions(-DUNICODE -D_UNICODE) + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_17) + target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") + target_compile_options(${TARGET} PRIVATE /EHsc) + target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") + target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# Support files are copied into place next to the executable, so that it can +# run in place. This is done instead of making a separate bundle (as on Linux) +# so that building and running from within Visual Studio will work. +set(BUILD_BUNDLE_DIR "$<TARGET_FILE_DIR:${BINARY_NAME}>") +# Make the "install" step default, as it's required to run. +set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + CONFIGURATIONS Profile;Release + COMPONENT Runtime) diff --git a/example/windows/flutter/CMakeLists.txt b/example/windows/flutter/CMakeLists.txt new file mode 100644 index 00000000..3f71e173 --- /dev/null +++ b/example/windows/flutter/CMakeLists.txt @@ -0,0 +1,104 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.14) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. +set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") + +# === Flutter Library === +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "flutter_export.h" + "flutter_windows.h" + "flutter_messenger.h" + "flutter_plugin_registrar.h" + "flutter_texture_registrar.h" +) +list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") +add_dependencies(flutter flutter_assemble) + +# === Wrapper === +list(APPEND CPP_WRAPPER_SOURCES_CORE + "core_implementations.cc" + "standard_codec.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_PLUGIN + "plugin_registrar.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_APP + "flutter_engine.cc" + "flutter_view_controller.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") + +# Wrapper sources needed for a plugin. +add_library(flutter_wrapper_plugin STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} +) +apply_standard_settings(flutter_wrapper_plugin) +set_target_properties(flutter_wrapper_plugin PROPERTIES + POSITION_INDEPENDENT_CODE ON) +set_target_properties(flutter_wrapper_plugin PROPERTIES + CXX_VISIBILITY_PRESET hidden) +target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) +target_include_directories(flutter_wrapper_plugin PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_plugin flutter_assemble) + +# Wrapper sources needed for the runner. +add_library(flutter_wrapper_app STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_APP} +) +apply_standard_settings(flutter_wrapper_app) +target_link_libraries(flutter_wrapper_app PUBLIC flutter) +target_include_directories(flutter_wrapper_app PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_app flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") +set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} + ${PHONY_OUTPUT} + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" + windows-x64 $<CONFIG> + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} +) diff --git a/example/windows/flutter/generated_plugin_registrant.cc b/example/windows/flutter/generated_plugin_registrant.cc new file mode 100644 index 00000000..99f616cb --- /dev/null +++ b/example/windows/flutter/generated_plugin_registrant.cc @@ -0,0 +1,14 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include <webcrypto/webcrypto_plugin.h> + +void RegisterPlugins(flutter::PluginRegistry* registry) { + WebcryptoPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("WebcryptoPlugin")); +} diff --git a/example/windows/flutter/generated_plugin_registrant.h b/example/windows/flutter/generated_plugin_registrant.h new file mode 100644 index 00000000..dc139d85 --- /dev/null +++ b/example/windows/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include <flutter/plugin_registry.h> + +// Registers Flutter plugins. +void RegisterPlugins(flutter::PluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/example/windows/flutter/generated_plugins.cmake b/example/windows/flutter/generated_plugins.cmake new file mode 100644 index 00000000..7fcb5cfa --- /dev/null +++ b/example/windows/flutter/generated_plugins.cmake @@ -0,0 +1,24 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + webcrypto +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/example/windows/runner/CMakeLists.txt b/example/windows/runner/CMakeLists.txt new file mode 100644 index 00000000..2041a044 --- /dev/null +++ b/example/windows/runner/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.14) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} WIN32 + "flutter_window.cpp" + "main.cpp" + "utils.cpp" + "win32_window.cpp" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" + "Runner.rc" + "runner.exe.manifest" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the build version. +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") + +# Disable Windows macros that collide with C++ standard library functions. +target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") + +# Add dependency libraries and include directories. Add any application-specific +# dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/example/windows/runner/Runner.rc b/example/windows/runner/Runner.rc new file mode 100644 index 00000000..3ff8f01e --- /dev/null +++ b/example/windows/runner/Runner.rc @@ -0,0 +1,121 @@ +// Microsoft Visual C++ generated resource script. +// +#pragma code_page(65001) +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_APP_ICON ICON "resources\\app_icon.ico" + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) +#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD +#else +#define VERSION_AS_NUMBER 1,0,0,0 +#endif + +#if defined(FLUTTER_VERSION) +#define VERSION_AS_STRING FLUTTER_VERSION +#else +#define VERSION_AS_STRING "1.0.0" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION VERSION_AS_NUMBER + PRODUCTVERSION VERSION_AS_NUMBER + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS__WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "com.example" "\0" + VALUE "FileDescription", "example" "\0" + VALUE "FileVersion", VERSION_AS_STRING "\0" + VALUE "InternalName", "example" "\0" + VALUE "LegalCopyright", "Copyright (C) 2023 com.example. All rights reserved." "\0" + VALUE "OriginalFilename", "example.exe" "\0" + VALUE "ProductName", "example" "\0" + VALUE "ProductVersion", VERSION_AS_STRING "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/example/windows/runner/flutter_window.cpp b/example/windows/runner/flutter_window.cpp new file mode 100644 index 00000000..c819cb08 --- /dev/null +++ b/example/windows/runner/flutter_window.cpp @@ -0,0 +1,71 @@ +#include "flutter_window.h" + +#include <optional> + +#include "flutter/generated_plugin_registrant.h" + +FlutterWindow::FlutterWindow(const flutter::DartProject& project) + : project_(project) {} + +FlutterWindow::~FlutterWindow() {} + +bool FlutterWindow::OnCreate() { + if (!Win32Window::OnCreate()) { + return false; + } + + RECT frame = GetClientArea(); + + // The size here must match the window dimensions to avoid unnecessary surface + // creation / destruction in the startup path. + flutter_controller_ = std::make_unique<flutter::FlutterViewController>( + frame.right - frame.left, frame.bottom - frame.top, project_); + // Ensure that basic setup of the controller was successful. + if (!flutter_controller_->engine() || !flutter_controller_->view()) { + return false; + } + RegisterPlugins(flutter_controller_->engine()); + SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + + // Flutter can complete the first frame before the "show window" callback is + // registered. The following call ensures a frame is pending to ensure the + // window is shown. It is a no-op if the first frame hasn't completed yet. + flutter_controller_->ForceRedraw(); + + return true; +} + +void FlutterWindow::OnDestroy() { + if (flutter_controller_) { + flutter_controller_ = nullptr; + } + + Win32Window::OnDestroy(); +} + +LRESULT +FlutterWindow::MessageHandler(HWND hwnd, UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + // Give Flutter, including plugins, an opportunity to handle window messages. + if (flutter_controller_) { + std::optional<LRESULT> result = + flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, + lparam); + if (result) { + return *result; + } + } + + switch (message) { + case WM_FONTCHANGE: + flutter_controller_->engine()->ReloadSystemFonts(); + break; + } + + return Win32Window::MessageHandler(hwnd, message, wparam, lparam); +} diff --git a/example/windows/runner/flutter_window.h b/example/windows/runner/flutter_window.h new file mode 100644 index 00000000..28c23839 --- /dev/null +++ b/example/windows/runner/flutter_window.h @@ -0,0 +1,33 @@ +#ifndef RUNNER_FLUTTER_WINDOW_H_ +#define RUNNER_FLUTTER_WINDOW_H_ + +#include <flutter/dart_project.h> +#include <flutter/flutter_view_controller.h> + +#include <memory> + +#include "win32_window.h" + +// A window that does nothing but host a Flutter view. +class FlutterWindow : public Win32Window { + public: + // Creates a new FlutterWindow hosting a Flutter view running |project|. + explicit FlutterWindow(const flutter::DartProject& project); + virtual ~FlutterWindow(); + + protected: + // Win32Window: + bool OnCreate() override; + void OnDestroy() override; + LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, + LPARAM const lparam) noexcept override; + + private: + // The project to run. + flutter::DartProject project_; + + // The Flutter instance hosted by this window. + std::unique_ptr<flutter::FlutterViewController> flutter_controller_; +}; + +#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/example/windows/runner/main.cpp b/example/windows/runner/main.cpp new file mode 100644 index 00000000..9632f06e --- /dev/null +++ b/example/windows/runner/main.cpp @@ -0,0 +1,43 @@ +#include <flutter/dart_project.h> +#include <flutter/flutter_view_controller.h> +#include <windows.h> + +#include "flutter_window.h" +#include "utils.h" + +int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, + _In_ wchar_t *command_line, _In_ int show_command) { + // Attach to console when present (e.g., 'flutter run') or create a + // new console when running with a debugger. + if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { + CreateAndAttachConsole(); + } + + // Initialize COM, so that it is available for use in the library and/or + // plugins. + ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); + + flutter::DartProject project(L"data"); + + std::vector<std::string> command_line_arguments = + GetCommandLineArguments(); + + project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); + + FlutterWindow window(project); + Win32Window::Point origin(10, 10); + Win32Window::Size size(1280, 720); + if (!window.Create(L"example", origin, size)) { + return EXIT_FAILURE; + } + window.SetQuitOnClose(true); + + ::MSG msg; + while (::GetMessage(&msg, nullptr, 0, 0)) { + ::TranslateMessage(&msg); + ::DispatchMessage(&msg); + } + + ::CoUninitialize(); + return EXIT_SUCCESS; +} diff --git a/example/windows/runner/resource.h b/example/windows/runner/resource.h new file mode 100644 index 00000000..ddc7f3ef --- /dev/null +++ b/example/windows/runner/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Runner.rc +// +#define IDI_APP_ICON 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/example/windows/runner/resources/app_icon.ico b/example/windows/runner/resources/app_icon.ico new file mode 100644 index 00000000..c04e20ca Binary files /dev/null and b/example/windows/runner/resources/app_icon.ico differ diff --git a/example/windows/runner/runner.exe.manifest b/example/windows/runner/runner.exe.manifest new file mode 100644 index 00000000..157e871f --- /dev/null +++ b/example/windows/runner/runner.exe.manifest @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> + <application xmlns="urn:schemas-microsoft-com:asm.v3"> + <windowsSettings> + <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness> + </windowsSettings> + </application> + <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> + <application> + <!-- Windows 10 and Windows 11 --> + <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/> + <!-- Windows 8.1 --> + <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/> + <!-- Windows 8 --> + <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/> + <!-- Windows 7 --> + <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> + </application> + </compatibility> +</assembly> diff --git a/example/windows/runner/utils.cpp b/example/windows/runner/utils.cpp new file mode 100644 index 00000000..fc55c573 --- /dev/null +++ b/example/windows/runner/utils.cpp @@ -0,0 +1,65 @@ +#include "utils.h" + +#include <flutter_windows.h> +#include <io.h> +#include <stdio.h> +#include <windows.h> + +#include <iostream> + +void CreateAndAttachConsole() { + if (::AllocConsole()) { + FILE *unused; + if (freopen_s(&unused, "CONOUT$", "w", stdout)) { + _dup2(_fileno(stdout), 1); + } + if (freopen_s(&unused, "CONOUT$", "w", stderr)) { + _dup2(_fileno(stdout), 2); + } + std::ios::sync_with_stdio(); + FlutterDesktopResyncOutputStreams(); + } +} + +std::vector<std::string> GetCommandLineArguments() { + // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. + int argc; + wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); + if (argv == nullptr) { + return std::vector<std::string>(); + } + + std::vector<std::string> command_line_arguments; + + // Skip the first argument as it's the binary name. + for (int i = 1; i < argc; i++) { + command_line_arguments.push_back(Utf8FromUtf16(argv[i])); + } + + ::LocalFree(argv); + + return command_line_arguments; +} + +std::string Utf8FromUtf16(const wchar_t* utf16_string) { + if (utf16_string == nullptr) { + return std::string(); + } + int target_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + -1, nullptr, 0, nullptr, nullptr) + -1; // remove the trailing null character + int input_length = (int)wcslen(utf16_string); + std::string utf8_string; + if (target_length <= 0 || target_length > utf8_string.max_size()) { + return utf8_string; + } + utf8_string.resize(target_length); + int converted_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + input_length, utf8_string.data(), target_length, nullptr, nullptr); + if (converted_length == 0) { + return std::string(); + } + return utf8_string; +} diff --git a/example/windows/runner/utils.h b/example/windows/runner/utils.h new file mode 100644 index 00000000..3f0e05cb --- /dev/null +++ b/example/windows/runner/utils.h @@ -0,0 +1,19 @@ +#ifndef RUNNER_UTILS_H_ +#define RUNNER_UTILS_H_ + +#include <string> +#include <vector> + +// Creates a console for the process, and redirects stdout and stderr to +// it for both the runner and the Flutter library. +void CreateAndAttachConsole(); + +// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string +// encoded in UTF-8. Returns an empty std::string on failure. +std::string Utf8FromUtf16(const wchar_t* utf16_string); + +// Gets the command line arguments passed in as a std::vector<std::string>, +// encoded in UTF-8. Returns an empty std::vector<std::string> on failure. +std::vector<std::string> GetCommandLineArguments(); + +#endif // RUNNER_UTILS_H_ diff --git a/example/windows/runner/win32_window.cpp b/example/windows/runner/win32_window.cpp new file mode 100644 index 00000000..b5ba2a09 --- /dev/null +++ b/example/windows/runner/win32_window.cpp @@ -0,0 +1,288 @@ +#include "win32_window.h" + +#include <dwmapi.h> +#include <flutter_windows.h> + +#include "resource.h" + +namespace { + +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + +constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; + +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + +// The number of Win32Window objects that currently exist. +static int g_active_window_count = 0; + +using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); + +// Scale helper to convert logical scaler values to physical using passed in +// scale factor +int Scale(int source, double scale_factor) { + return static_cast<int>(source * scale_factor); +} + +// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. +// This API is only needed for PerMonitor V1 awareness mode. +void EnableFullDpiSupportIfAvailable(HWND hwnd) { + HMODULE user32_module = LoadLibraryA("User32.dll"); + if (!user32_module) { + return; + } + auto enable_non_client_dpi_scaling = + reinterpret_cast<EnableNonClientDpiScaling*>( + GetProcAddress(user32_module, "EnableNonClientDpiScaling")); + if (enable_non_client_dpi_scaling != nullptr) { + enable_non_client_dpi_scaling(hwnd); + } + FreeLibrary(user32_module); +} + +} // namespace + +// Manages the Win32Window's window class registration. +class WindowClassRegistrar { + public: + ~WindowClassRegistrar() = default; + + // Returns the singleton registrar instance. + static WindowClassRegistrar* GetInstance() { + if (!instance_) { + instance_ = new WindowClassRegistrar(); + } + return instance_; + } + + // Returns the name of the window class, registering the class if it hasn't + // previously been registered. + const wchar_t* GetWindowClass(); + + // Unregisters the window class. Should only be called if there are no + // instances of the window. + void UnregisterWindowClass(); + + private: + WindowClassRegistrar() = default; + + static WindowClassRegistrar* instance_; + + bool class_registered_ = false; +}; + +WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; + +const wchar_t* WindowClassRegistrar::GetWindowClass() { + if (!class_registered_) { + WNDCLASS window_class{}; + window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); + window_class.lpszClassName = kWindowClassName; + window_class.style = CS_HREDRAW | CS_VREDRAW; + window_class.cbClsExtra = 0; + window_class.cbWndExtra = 0; + window_class.hInstance = GetModuleHandle(nullptr); + window_class.hIcon = + LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); + window_class.hbrBackground = 0; + window_class.lpszMenuName = nullptr; + window_class.lpfnWndProc = Win32Window::WndProc; + RegisterClass(&window_class); + class_registered_ = true; + } + return kWindowClassName; +} + +void WindowClassRegistrar::UnregisterWindowClass() { + UnregisterClass(kWindowClassName, nullptr); + class_registered_ = false; +} + +Win32Window::Win32Window() { + ++g_active_window_count; +} + +Win32Window::~Win32Window() { + --g_active_window_count; + Destroy(); +} + +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { + Destroy(); + + const wchar_t* window_class = + WindowClassRegistrar::GetInstance()->GetWindowClass(); + + const POINT target_point = {static_cast<LONG>(origin.x), + static_cast<LONG>(origin.y)}; + HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); + UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); + double scale_factor = dpi / 96.0; + + HWND window = CreateWindow( + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, + Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), + Scale(size.width, scale_factor), Scale(size.height, scale_factor), + nullptr, nullptr, GetModuleHandle(nullptr), this); + + if (!window) { + return false; + } + + UpdateTheme(window); + + return OnCreate(); +} + +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + +// static +LRESULT CALLBACK Win32Window::WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + if (message == WM_NCCREATE) { + auto window_struct = reinterpret_cast<CREATESTRUCT*>(lparam); + SetWindowLongPtr(window, GWLP_USERDATA, + reinterpret_cast<LONG_PTR>(window_struct->lpCreateParams)); + + auto that = static_cast<Win32Window*>(window_struct->lpCreateParams); + EnableFullDpiSupportIfAvailable(window); + that->window_handle_ = window; + } else if (Win32Window* that = GetThisFromHandle(window)) { + return that->MessageHandler(window, message, wparam, lparam); + } + + return DefWindowProc(window, message, wparam, lparam); +} + +LRESULT +Win32Window::MessageHandler(HWND hwnd, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + switch (message) { + case WM_DESTROY: + window_handle_ = nullptr; + Destroy(); + if (quit_on_close_) { + PostQuitMessage(0); + } + return 0; + + case WM_DPICHANGED: { + auto newRectSize = reinterpret_cast<RECT*>(lparam); + LONG newWidth = newRectSize->right - newRectSize->left; + LONG newHeight = newRectSize->bottom - newRectSize->top; + + SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, + newHeight, SWP_NOZORDER | SWP_NOACTIVATE); + + return 0; + } + case WM_SIZE: { + RECT rect = GetClientArea(); + if (child_content_ != nullptr) { + // Size and position the child window. + MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, + rect.bottom - rect.top, TRUE); + } + return 0; + } + + case WM_ACTIVATE: + if (child_content_ != nullptr) { + SetFocus(child_content_); + } + return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; + } + + return DefWindowProc(window_handle_, message, wparam, lparam); +} + +void Win32Window::Destroy() { + OnDestroy(); + + if (window_handle_) { + DestroyWindow(window_handle_); + window_handle_ = nullptr; + } + if (g_active_window_count == 0) { + WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); + } +} + +Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { + return reinterpret_cast<Win32Window*>( + GetWindowLongPtr(window, GWLP_USERDATA)); +} + +void Win32Window::SetChildContent(HWND content) { + child_content_ = content; + SetParent(content, window_handle_); + RECT frame = GetClientArea(); + + MoveWindow(content, frame.left, frame.top, frame.right - frame.left, + frame.bottom - frame.top, true); + + SetFocus(child_content_); +} + +RECT Win32Window::GetClientArea() { + RECT frame; + GetClientRect(window_handle_, &frame); + return frame; +} + +HWND Win32Window::GetHandle() { + return window_handle_; +} + +void Win32Window::SetQuitOnClose(bool quit_on_close) { + quit_on_close_ = quit_on_close; +} + +bool Win32Window::OnCreate() { + // No-op; provided for subclasses. + return true; +} + +void Win32Window::OnDestroy() { + // No-op; provided for subclasses. +} + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/example/windows/runner/win32_window.h b/example/windows/runner/win32_window.h new file mode 100644 index 00000000..49b847f0 --- /dev/null +++ b/example/windows/runner/win32_window.h @@ -0,0 +1,102 @@ +#ifndef RUNNER_WIN32_WINDOW_H_ +#define RUNNER_WIN32_WINDOW_H_ + +#include <windows.h> + +#include <functional> +#include <memory> +#include <string> + +// A class abstraction for a high DPI-aware Win32 Window. Intended to be +// inherited from by classes that wish to specialize with custom +// rendering and input handling +class Win32Window { + public: + struct Point { + unsigned int x; + unsigned int y; + Point(unsigned int x, unsigned int y) : x(x), y(y) {} + }; + + struct Size { + unsigned int width; + unsigned int height; + Size(unsigned int width, unsigned int height) + : width(width), height(height) {} + }; + + Win32Window(); + virtual ~Win32Window(); + + // Creates a win32 window with |title| that is positioned and sized using + // |origin| and |size|. New windows are created on the default monitor. Window + // sizes are specified to the OS in physical pixels, hence to ensure a + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); + + // Release OS resources associated with window. + void Destroy(); + + // Inserts |content| into the window tree. + void SetChildContent(HWND content); + + // Returns the backing Window handle to enable clients to set icon and other + // window properties. Returns nullptr if the window has been destroyed. + HWND GetHandle(); + + // If true, closing this window will quit the application. + void SetQuitOnClose(bool quit_on_close); + + // Return a RECT representing the bounds of the current client area. + RECT GetClientArea(); + + protected: + // Processes and route salient window messages for mouse handling, + // size change and DPI. Delegates handling of these to member overloads that + // inheriting classes can handle. + virtual LRESULT MessageHandler(HWND window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Called when CreateAndShow is called, allowing subclass window-related + // setup. Subclasses should return false if setup fails. + virtual bool OnCreate(); + + // Called when Destroy is called. + virtual void OnDestroy(); + + private: + friend class WindowClassRegistrar; + + // OS callback called by message pump. Handles the WM_NCCREATE message which + // is passed when the non-client area is being created and enables automatic + // non-client DPI scaling so that the non-client area automatically + // responds to changes in DPI. All other messages are handled by + // MessageHandler. + static LRESULT CALLBACK WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Retrieves a class instance pointer for |window| + static Win32Window* GetThisFromHandle(HWND const window) noexcept; + + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + + bool quit_on_close_ = false; + + // window handle for top level window. + HWND window_handle_ = nullptr; + + // window handle for hosted content. + HWND child_content_ = nullptr; +}; + +#endif // RUNNER_WIN32_WINDOW_H_ diff --git a/lib/src/boringssl/lookup/lookup.dart b/lib/src/boringssl/lookup/lookup.dart index e12c04e7..ad45e040 100644 --- a/lib/src/boringssl/lookup/lookup.dart +++ b/lib/src/boringssl/lookup/lookup.dart @@ -29,9 +29,14 @@ export 'symbols.generated.dart' show Sym; /// Dynamically load `webcrypto_lookup_symbol` function. final Pointer<T> Function<T extends NativeType>(String symbolName) lookup = () { try { - final library = Platform.isAndroid || Platform.isLinux || Platform.isMacOS - ? DynamicLibrary.open('libwebcrypto.so') - : DynamicLibrary.executable(); + late DynamicLibrary library; + if (Platform.isAndroid || Platform.isLinux) { + library = DynamicLibrary.open('libwebcrypto.so'); + } else if (Platform.isWindows) { + library = DynamicLibrary.open('webcrypto.dll'); + } else { + library = DynamicLibrary.executable(); + } // Try to lookup the 'webcrypto_lookup_symbol' symbol. final webcrypto = WebCrypto(library); diff --git a/pubspec.yaml b/pubspec.yaml index 7c01e17e..22c2f07e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -53,7 +53,13 @@ flutter: fileName: src/flutter/webcrypto_plugin.dart ios: pluginClass: WebcryptoPlugin + sharedDarwinSource: true + macos: + pluginClass: WebcryptoPlugin + sharedDarwinSource: true linux: pluginClass: WebcryptoPlugin + windows: + pluginClass: WebcryptoPlugin topics: - crypto diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b66cb686..bb137fa3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -96,6 +96,38 @@ if(NOT DEFINED crypto_sources_${PLATFORM}_${ARCH}) set(crypto_sources_${PLATFORM}_${ARCH}) endif() +if(MSVC) + # Windows/MSVC option from CMakeLists.txt in BoringSSL + set(MSVC_DISABLED_WARNINGS_LIST + "C4100" # 'exarg' : unreferenced formal parameter + "C4127" # conditional expression is constant + "C4244" # 'function' : conversion from 'int' to 'uint8_t', + # possible loss of data + "C4267" # conversion from 'size_t' to 'int', possible loss of data + "C4706" # assignment within conditional expression + "C4141" + ) + string(REPLACE "C" " -wd" MSVC_DISABLED_WARNINGS_STR + ${MSVC_DISABLED_WARNINGS_LIST}) + set(CMAKE_C_FLAGS "-utf-8 -W4 -WX ${MSVC_DISABLED_WARNINGS_STR}") + set(CMAKE_CXX_FLAGS "-utf-8 -W4 -WX ${MSVC_DISABLED_WARNINGS_STR}") +endif() +if(WIN32) + # Windows/MSVC option from CMakeLists.txt in BoringSSL + # Use NASM on Windows. + enable_language(ASM_NASM) + set(OPENSSL_NASM TRUE) + set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -gcv8") + # On Windows, prefer cl over gcc if both are available. By default most of + # the CMake generators prefer gcc, even on Windows. + set(CMAKE_GENERATOR_CC cl) + add_definitions(-D_HAS_EXCEPTIONS=0) + add_definitions(-DWIN32_LEAN_AND_MEAN) + add_definitions(-DNOMINMAX) + # Allow use of fopen. + add_definitions(-D_CRT_SECURE_NO_WARNINGS) +endif() + add_library( webcrypto diff --git a/src/webcrypto.h b/src/webcrypto.h index bb1e7969..707a9a09 100644 --- a/src/webcrypto.h +++ b/src/webcrypto.h @@ -17,9 +17,13 @@ #include <stdint.h> // Macro for annotating all functions to be exported -#define WEBCRYPTO_EXPORT \ +#ifdef _MSC_VER +#define WEBCRYPTO_EXPORT __declspec(dllexport) +#else +#define WEBCRYPTO_EXPORT \ __attribute__((visibility("default"))) __attribute__((used)) +#endif // Function to lookup BoringSSL symbols based on index in the Sym enum. // See src/symbols.yaml for details. -WEBCRYPTO_EXPORT void* webcrypto_lookup_symbol(int32_t index); +WEBCRYPTO_EXPORT void* webcrypto_lookup_symbol(int32_t index); \ No newline at end of file diff --git a/tool/update-boringssl.py b/tool/update-boringssl.py index 6fa8c4ea..54eb5dda 100755 --- a/tool/update-boringssl.py +++ b/tool/update-boringssl.py @@ -35,7 +35,7 @@ def cleanup(): """ Remove boringssl sources and generated files """ paths = [ os.path.join(ROOT_PATH, 'third_party', 'boringssl'), - os.path.join(ROOT_PATH, 'ios', 'third_party', 'boringssl') + os.path.join(ROOT_PATH, 'darwin', 'third_party', 'boringssl') ] for p in paths: if os.path.exists(p): @@ -102,7 +102,7 @@ def git_clone(target): # `tool/update-boringssl.py` """ -FAKE_IOS_SOURCE_HEADER = """/* +FAKE_DARWIN_SOURCE_HEADER = """/* * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -211,21 +211,21 @@ def copySourceFiles(g, boringssl_clone): shutil.copy(src, dst) -def writeFakeIosSource(g): +def writeFakeDarwinSource(g): """ Write fake-source files that each #include "../..." the original source - file for ios/ + file for darwin/ """ for f in sorted(set(g.file_sets['crypto'])): - target = os.path.join(ROOT_PATH, 'ios', 'third_party', 'boringssl', f) + target = os.path.join(ROOT_PATH, 'darwin', 'third_party', 'boringssl', f) original = os.path.join(ROOT_PATH, 'third_party', 'boringssl', f) rel = os.path.relpath(original, os.path.dirname(target)) mkdirp(os.path.dirname(target)) contents = '' - contents += FAKE_IOS_SOURCE_HEADER + contents += FAKE_DARWIN_SOURCE_HEADER contents += '\n' contents += '#include "'+rel+'"\n' - writeFile(os.path.join('ios', 'third_party', 'boringssl', f), contents) + writeFile(os.path.join('darwin', 'third_party', 'boringssl', f), contents) def generate(boringssl_clone): @@ -247,11 +247,11 @@ def generate(boringssl_clone): # Copy source files into third_party/boringssl/ copySourceFiles(g, boringssl_clone) - # Write fake-source files for ios/ which use #include "../..." to include + # Write fake-source files for darwin/ which use #include "../..." to include # the original source file. This is necessary because webcrypto.podspec - # cannot reference sources not under the ios/ folder. + # cannot reference sources not under the darwin/ folder. # But the C-preprocessor can still include them :D - writeFakeIosSource(g) + writeFakeDarwinSource(g) # Add a README.md to the third_party/boringssl/ folder readmePath = os.path.join('third_party', 'boringssl', 'README.md') diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt new file mode 100644 index 00000000..8734426a --- /dev/null +++ b/windows/CMakeLists.txt @@ -0,0 +1,167 @@ +# The Flutter tooling requires that developers have a version of Visual Studio +# installed that includes CMake 3.14 or later. You should not increase this +# version, as doing so will cause the plugin to fail to compile for some +# customers of the plugin. +cmake_minimum_required(VERSION 3.14) + +# Project-level configuration. +set(PROJECT_NAME "webcrypto") +project(${PROJECT_NAME} LANGUAGES C CXX) + +# --- BoringSSL Config --- + +# BoringSSL needs NASM in windows to build assembly files +enable_language(ASM_NASM) + +# Set the BoringSSL root directory +set(BORINGSSL_ROOT ../third_party/boringssl/) + +# Import BoringSSL sources as generated by tool/update-boringssl.py +include( + ../third_party/boringssl/sources.cmake +) + +# Tradeoff performance for smaller binary size, see: +# https://boringssl.googlesource.com/boringssl/+/HEAD/BUILDING.md#binary-size +add_definitions(-DOPENSSL_SMALL) + +# Logic from CMakeLists.txt in BoringSSL +if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64") + set(ARCH "x86_64") +elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "amd64") + set(ARCH "x86_64") +elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64") + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(ARCH "x86_64") + else() + set(ARCH "x86") + endif() +elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86") + set(ARCH "x86") +elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386") + set(ARCH "x86") +elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i686") + set(ARCH "x86") +elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") + set(ARCH "aarch64") +elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm64") + set(ARCH "aarch64") +elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm64e") + set(ARCH "aarch64") +elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm*") + set(ARCH "arm") +elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ppc64le") + set(ARCH "ppc64le") +else() + set(ARCH "generic") +endif() + +set(PLATFORM "win") + +# If there is no assembly files disable ASM and set empty sources list +if(NOT DEFINED crypto_sources_${PLATFORM}_${ARCH}) + add_definitions(-DOPENSSL_NO_ASM) + set(crypto_sources_${PLATFORM}_${ARCH}) +endif() + +# ---- Windows/MSVC option from CMakeLists.txt in BoringSSL ----- + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS true) + +set(MSVC_DISABLED_WARNINGS_LIST + "C4100" # 'exarg' : unreferenced formal parameter + "C4127" # conditional expression is constant + "C4244" # 'function' : conversion from 'int' to 'uint8_t', + # possible loss of data + "C4267" # conversion from 'size_t' to 'int', possible loss of data + "C4706" # assignment within conditional expression + ) +string(REPLACE "C" " -wd" MSVC_DISABLED_WARNINGS_STR + ${MSVC_DISABLED_WARNINGS_LIST}) +set(CMAKE_C_FLAGS "-utf-8 -W4 -WX ${MSVC_DISABLED_WARNINGS_STR}") +set(CMAKE_CXX_FLAGS "-utf-8 -W4 -WX ${MSVC_DISABLED_WARNINGS_STR}") + +# On Windows, prefer cl over gcc if both are available. By default most of +# the CMake generators prefer gcc, even on Windows. +set(CMAKE_GENERATOR_CC cl) + +add_definitions(-D_HAS_EXCEPTIONS=0) +add_definitions(-DWIN32_LEAN_AND_MEAN) +add_definitions(-DNOMINMAX) +# Allow use of fopen. +add_definitions(-D_CRT_SECURE_NO_WARNINGS) + +add_library( + webcrypto + + # Build a shared library + SHARED + + # Source files + ../src/webcrypto.c + ../src/symbols.generated.c + ${crypto_sources} + ${crypto_sources_${PLATFORM}_${ARCH}} +) + +target_include_directories( + webcrypto + + PRIVATE + + ../third_party/boringssl/src/include/ +) + +set_target_properties( + webcrypto + + PROPERTIES + + C_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN 1 + LINKER_LANGUAGE C +) + +# --- Flutter Config --- + +# This value is used when generating builds using this plugin, so it must +# not be changed +set(PLUGIN_NAME "webcrypto_plugin") + +# Any new source files that you add to the plugin should be added here. +list(APPEND PLUGIN_SOURCES + "webcrypto_plugin.cpp" + "include/webcrypto/webcrypto_plugin.h" +) + +# Define the plugin library target. Its name must not be changed (see comment +# on PLUGIN_NAME above). +add_library(${PLUGIN_NAME} SHARED + ${PLUGIN_SOURCES} +) + +# Apply a standard set of build settings that are configured in the +# application-level CMakeLists.txt. This can be removed for plugins that want +# full control over build settings. +apply_standard_settings(${PLUGIN_NAME}) + +# Symbols are hidden by default to reduce the chance of accidental conflicts +# between plugins. This should not be removed; any symbols that should be +# exported should be explicitly exported with the FLUTTER_PLUGIN_EXPORT macro. +set_target_properties(${PLUGIN_NAME} PROPERTIES + CXX_VISIBILITY_PRESET hidden) +target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL) + +# Source include directories and library dependencies. Add any plugin-specific +# dependencies here. +target_include_directories(${PLUGIN_NAME} INTERFACE + "${CMAKE_CURRENT_SOURCE_DIR}/include") +target_link_libraries(${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin) + +# List of absolute paths to libraries that should be bundled with the plugin. +# This list could contain prebuilt libraries, or libraries created by an +# external build triggered from this build file. +set(webcrypto_bundled_libraries + "$<TARGET_FILE:webcrypto>" + PARENT_SCOPE +) diff --git a/windows/include/webcrypto/webcrypto_plugin.h b/windows/include/webcrypto/webcrypto_plugin.h new file mode 100644 index 00000000..e9a423dd --- /dev/null +++ b/windows/include/webcrypto/webcrypto_plugin.h @@ -0,0 +1,48 @@ +#ifndef FLUTTER_PLUGIN_WEBCRYPTO_PLUGIN_H_ +#define FLUTTER_PLUGIN_WEBCRYPTO_PLUGIN_H_ + +#include <flutter/method_channel.h> +#include <flutter/plugin_registrar_windows.h> + +#include <memory> + +#ifdef FLUTTER_PLUGIN_IMPL +#define FLUTTER_PLUGIN_EXPORT __declspec(dllexport) +#else +#define FLUTTER_PLUGIN_EXPORT __declspec(dllimport) +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + +FLUTTER_PLUGIN_EXPORT void WebcryptoPluginRegisterWithRegistrar( + FlutterDesktopPluginRegistrarRef registrar); + +#if defined(__cplusplus) +} // extern "C" +#endif + +namespace webcrypto { + +class WebcryptoPlugin : public flutter::Plugin { + public: + static void RegisterWithRegistrar(flutter::PluginRegistrarWindows *registrar); + + WebcryptoPlugin(); + + virtual ~WebcryptoPlugin(); + + // Disallow copy and assign. + WebcryptoPlugin(const WebcryptoPlugin&) = delete; + WebcryptoPlugin& operator=(const WebcryptoPlugin&) = delete; + + // Called when a method is called on this plugin's channel from Dart. + void HandleMethodCall( + const flutter::MethodCall<flutter::EncodableValue> &method_call, + std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>> result); +}; + +} // namespace webcrypto + +#endif // FLUTTER_PLUGIN_WEBCRYPTO_PLUGIN_H_ diff --git a/windows/webcrypto_plugin.cpp b/windows/webcrypto_plugin.cpp new file mode 100644 index 00000000..9c5b30eb --- /dev/null +++ b/windows/webcrypto_plugin.cpp @@ -0,0 +1,66 @@ +#include "include/webcrypto/webcrypto_plugin.h" + +// This must be included before many other Windows headers. +#include <windows.h> + +// For getPlatformVersion; remove unless needed for your plugin implementation. +#include <VersionHelpers.h> + +#include <flutter/method_channel.h> +#include <flutter/plugin_registrar_windows.h> +#include <flutter/standard_method_codec.h> + +#include <memory> +#include <sstream> + +namespace webcrypto { + +// static +void WebcryptoPlugin::RegisterWithRegistrar( + flutter::PluginRegistrarWindows *registrar) { + auto channel = + std::make_unique<flutter::MethodChannel<flutter::EncodableValue>>( + registrar->messenger(), "webcrypto", + &flutter::StandardMethodCodec::GetInstance()); + + auto plugin = std::make_unique<WebcryptoPlugin>(); + + channel->SetMethodCallHandler( + [plugin_pointer = plugin.get()](const auto &call, auto result) { + plugin_pointer->HandleMethodCall(call, std::move(result)); + }); + + registrar->AddPlugin(std::move(plugin)); +} + +WebcryptoPlugin::WebcryptoPlugin() {} + +WebcryptoPlugin::~WebcryptoPlugin() {} + +void WebcryptoPlugin::HandleMethodCall( + const flutter::MethodCall<flutter::EncodableValue> &method_call, + std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>> result) { + if (method_call.method_name().compare("getPlatformVersion") == 0) { + std::ostringstream version_stream; + version_stream << "Windows "; + if (IsWindows10OrGreater()) { + version_stream << "10+"; + } else if (IsWindows8OrGreater()) { + version_stream << "8"; + } else if (IsWindows7OrGreater()) { + version_stream << "7"; + } + result->Success(flutter::EncodableValue(version_stream.str())); + } else { + result->NotImplemented(); + } +} + +} // namespace webcrypto + +void WebcryptoPluginRegisterWithRegistrar( + FlutterDesktopPluginRegistrarRef registrar) { + webcrypto::WebcryptoPlugin::RegisterWithRegistrar( + flutter::PluginRegistrarManager::GetInstance() + ->GetRegistrar<flutter::PluginRegistrarWindows>(registrar)); +}