From 677d874df6ee9b52ce3bc3c3f29c92f3f6d242fb Mon Sep 17 00:00:00 2001 From: Rody Davis Date: Wed, 8 May 2019 11:43:42 -0400 Subject: [PATCH] Adding Support for Desktop --- lib/main.dart | 21 +- linux/.gitignore | 1 + linux/Makefile | 143 +++++ linux/flutter_embedder_example.cc | 74 +++ macos/.gitignore | 4 + macos/AppDelegate.swift | 25 + .../AppIcon.appiconset/Contents.json | 58 +++ macos/Base.lproj/MainMenu.xib | 359 +++++++++++++ macos/ExampleWindow.swift | 35 ++ macos/Flutter/Debug.xcconfig | 1 + macos/Flutter/Release.xcconfig | 1 + macos/Info.plist | 32 ++ macos/PluginRegistrant.h | 19 + macos/PluginRegistrant.m | 27 + macos/Runner-Bridging-Header.h | 16 + macos/Runner.xcodeproj/project.pbxproj | 490 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcshareddata/xcschemes/Runner.xcscheme | 101 ++++ macos/name_output.sh | 40 ++ pubspec.yaml | 4 +- windows/.gitignore | 332 ++++++++++++ windows/Runner.sln | 25 + windows/Runner.vcxproj | 159 ++++++ windows/Runner.vcxproj.filters | 34 ++ windows/build.bat | 61 +++ windows/find_vcvars.dart | 35 ++ windows/flutter_embedder_example.cpp | 75 +++ windows/generate_props.dart | 58 +++ windows/name_output.bat | 38 ++ windows/scripts/bundle_assets_and_deps.bat | 44 ++ windows/scripts/prepare_dependencies.bat | 35 ++ 32 files changed, 2358 insertions(+), 4 deletions(-) create mode 100755 linux/.gitignore create mode 100755 linux/Makefile create mode 100755 linux/flutter_embedder_example.cc create mode 100755 macos/.gitignore create mode 100755 macos/AppDelegate.swift create mode 100755 macos/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100755 macos/Base.lproj/MainMenu.xib create mode 100755 macos/ExampleWindow.swift create mode 100755 macos/Flutter/Debug.xcconfig create mode 100755 macos/Flutter/Release.xcconfig create mode 100755 macos/Info.plist create mode 100755 macos/PluginRegistrant.h create mode 100755 macos/PluginRegistrant.m create mode 100755 macos/Runner-Bridging-Header.h create mode 100755 macos/Runner.xcodeproj/project.pbxproj create mode 100755 macos/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100755 macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100755 macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme create mode 100755 macos/name_output.sh create mode 100755 windows/.gitignore create mode 100755 windows/Runner.sln create mode 100755 windows/Runner.vcxproj create mode 100755 windows/Runner.vcxproj.filters create mode 100755 windows/build.bat create mode 100755 windows/find_vcvars.dart create mode 100755 windows/flutter_embedder_example.cpp create mode 100755 windows/generate_props.dart create mode 100755 windows/name_output.bat create mode 100755 windows/scripts/bundle_assets_and_deps.bat create mode 100755 windows/scripts/prepare_dependencies.bat diff --git a/lib/main.dart b/lib/main.dart index 1995eec..04f1d0f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,8 @@ import 'dart:async'; +import 'dart:io'; import 'dart:ui' as ui; - +import 'package:flutter/foundation.dart' + show debugDefaultTargetPlatformOverride; import 'package:dev_rpg/src/about_screen.dart'; import 'package:dev_rpg/src/code_chomper/code_chomper.dart'; import 'package:dev_rpg/src/game_screen.dart'; @@ -22,10 +24,25 @@ void main() { // Don't prune the Flare cache, keep loaded Flare files warm and ready // to be re-displayed. FlareCache.doesPrune = false; - + _setTargetPlatformForDesktop(); runApp(MyApp()); } +/// If the current platform is desktop, override the default platform to +/// a supported platform (iOS for macOS, Android for Linux and Windows). +/// Otherwise, do nothing. +void _setTargetPlatformForDesktop() { + TargetPlatform targetPlatform; + if (Platform.isMacOS) { + targetPlatform = TargetPlatform.iOS; + } else if (Platform.isLinux || Platform.isWindows) { + targetPlatform = TargetPlatform.android; + } + if (targetPlatform != null) { + debugDefaultTargetPlatformOverride = targetPlatform; + } +} + class MyApp extends StatefulWidget { @override _MyAppState createState() => _MyAppState(); diff --git a/linux/.gitignore b/linux/.gitignore new file mode 100755 index 0000000..ce85570 --- /dev/null +++ b/linux/.gitignore @@ -0,0 +1 @@ +.generated_flutter_root diff --git a/linux/Makefile b/linux/Makefile new file mode 100755 index 0000000..2cbe159 --- /dev/null +++ b/linux/Makefile @@ -0,0 +1,143 @@ +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Example-specific variables. +# To modify this Makefile for a different application, these are the values +# that are mostly likely to need to be changed. + +# Executable name. +BINARY_NAME=flutter_desktop_example +# The C++ code for the embedder application. +SOURCES=flutter_embedder_example.cc + + +# Default build type. For a release build, set BUILD=release. +# Currently this only sets NDEBUG, which is used to control the flags passed +# to the Flutter engine in the example shell, and not the complation settings +# (e.g., optimization level) of the C++ code. +BUILD=debug + +# Dependency locations +FLUTTER_APP_DIR=$(CURDIR)/.. +FLUTTER_APP_BUILD_DIR=$(FLUTTER_APP_DIR)/build +FLUTTER_ROOT:=$(shell cat $(CURDIR)/.generated_flutter_root) +FLUTTER_ARTIFACT_CACHE_DIR=$(FLUTTER_ROOT)/bin/cache/artifacts/engine/linux-x64 + +OUT_DIR=$(FLUTTER_APP_BUILD_DIR)/linux +CACHE_DIR=$(OUT_DIR)/cache +FLUTTER_LIBRARY_COPY_DIR=$(CACHE_DIR)/flutter_library + +FLUTTER_LIB_NAME=flutter_linux +FLUTTER_LIB=$(FLUTTER_LIBRARY_COPY_DIR)/lib$(FLUTTER_LIB_NAME).so + +# Tools +FLUTTER_BIN=$(FLUTTER_ROOT)/bin/flutter + +# Resources +ICU_DATA_NAME=icudtl.dat +ICU_DATA_SOURCE=$(FLUTTER_ARTIFACT_CACHE_DIR)/$(ICU_DATA_NAME) +FLUTTER_ASSETS_NAME=flutter_assets +FLUTTER_ASSETS_SOURCE=$(FLUTTER_APP_BUILD_DIR)/$(FLUTTER_ASSETS_NAME) + +# Bundle structure +BUNDLE_OUT_DIR=$(OUT_DIR)/$(BUILD) +BUNDLE_DATA_DIR=$(BUNDLE_OUT_DIR)/data +BUNDLE_LIB_DIR=$(BUNDLE_OUT_DIR)/lib + +BIN_OUT=$(BUNDLE_OUT_DIR)/$(BINARY_NAME) +ICU_DATA_OUT=$(BUNDLE_DATA_DIR)/$(ICU_DATA_NAME) +FLUTTER_LIB_OUT=$(BUNDLE_LIB_DIR)/$(notdir $(FLUTTER_LIB)) + +# Add relevant code from the wrapper library, which is intended to be statically +# built into the client. +WRAPPER_ROOT=$(FLUTTER_LIBRARY_COPY_DIR)/cpp_client_wrapper +WRAPPER_SOURCES= \ + $(WRAPPER_ROOT)/flutter_window_controller.cc \ + $(WRAPPER_ROOT)/plugin_registrar.cc \ + $(WRAPPER_ROOT)/engine_method_result.cc +SOURCES+=$(WRAPPER_SOURCES) + +# Headers +WRAPPER_INCLUDE_DIR=$(WRAPPER_ROOT)/include +INCLUDE_DIRS=$(FLUTTER_LIBRARY_COPY_DIR) $(WRAPPER_INCLUDE_DIR) + +# The stamp file created by copy_flutter_files. +FLUTTER_COPY_STAMP_FILE=$(FLUTTER_LIBRARY_COPY_DIR)/.last_copied_flutter_version +# The Flutter engine version file. +FLUTTER_ENGINE_VERSION_FILE=$(FLUTTER_ROOT)/bin/internal/engine.version + +# Build settings +CXX=g++ -std=c++14 +CXXFLAGS.release=-DNDEBUG +CXXFLAGS=-Wall -Werror $(CXXFLAGS.$(BUILD)) +CPPFLAGS=$(patsubst %,-I%,$(INCLUDE_DIRS)) +LDFLAGS=-L$(BUNDLE_LIB_DIR) \ + -l$(FLUTTER_LIB_NAME) \ + -Wl,-rpath=\$$ORIGIN/lib + +# Targets + +.PHONY: all +all: $(BIN_OUT) bundle + +.PHONY: bundle +bundle: $(ICU_DATA_OUT) $(FLUTTER_LIB_OUT) bundleflutterassets + +$(BIN_OUT): $(SOURCES) $(FLUTTER_LIB_OUT) + mkdir -p $(@D) + $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(SOURCES) $(LDFLAGS) -o $@ + +$(WRAPPER_SOURCES) $(FLUTTER_LIB) $(ICU_DATA_SOURCE): $(FLUTTER_COPY_STAMP_FILE) + +# When the Flutter engine version changes, the local copy of engine artifacts +# needs to be updated. +$(FLUTTER_COPY_STAMP_FILE): $(FLUTTER_ENGINE_VERSION_FILE) + $(FLUTTER_BIN) precache --linux --no-android --no-ios + rm -rf $(FLUTTER_LIBRARY_COPY_DIR) + mkdir -p $(FLUTTER_LIBRARY_COPY_DIR) + cp $(FLUTTER_ARTIFACT_CACHE_DIR)/*.h $(FLUTTER_LIBRARY_COPY_DIR)/ + cp $(FLUTTER_ARTIFACT_CACHE_DIR)/*.so $(FLUTTER_LIBRARY_COPY_DIR)/ + cp -r $(FLUTTER_ARTIFACT_CACHE_DIR)/cpp_client_wrapper \ + $(FLUTTER_LIBRARY_COPY_DIR)/ + touch $(FLUTTER_COPY_STAMP_FILE) + +$(FLUTTER_LIB_OUT): $(FLUTTER_LIB) + mkdir -p $(BUNDLE_LIB_DIR) + cp $(FLUTTER_LIB) $(BUNDLE_LIB_DIR) + +$(ICU_DATA_OUT): $(ICU_DATA_SOURCE) + mkdir -p $(dir $(ICU_DATA_OUT)) + cp $(ICU_DATA_SOURCE) $(ICU_DATA_OUT) + +# Fully re-copy the assets directory on each build to avoid having to keep a +# comprehensive list of all asset files here, which would be fragile to changes +# in the Flutter example (e.g., adding a new font to pubspec.yaml would require +# changes here). +.PHONY: bundleflutterassets +bundleflutterassets: $(FLUTTER_ASSETS_SOURCE) + mkdir -p $(BUNDLE_DATA_DIR) + rsync -rpu --delete $(FLUTTER_ASSETS_SOURCE) $(BUNDLE_DATA_DIR) + +# PHONY since the Makefile doesn't have all the dependency information necessary +# to know if 'build bundle' needs to be re-run. +.PHONY: $(FLUTTER_ASSETS_SOURCE) +$(FLUTTER_ASSETS_SOURCE): + cd $(FLUTTER_APP_DIR); \ + $(FLUTTER_BIN) build bundle $(FLUTTER_BUNDLE_FLAGS) + +.PHONY: clean +clean: + rm -rf $(OUT_DIR); \ + cd $(FLUTTER_APP_DIR); \ + $(FLUTTER_BIN) clean diff --git a/linux/flutter_embedder_example.cc b/linux/flutter_embedder_example.cc new file mode 100755 index 0000000..1272af3 --- /dev/null +++ b/linux/flutter_embedder_example.cc @@ -0,0 +1,74 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#include +#include + +#include +#include +#include +#include + +#include + +namespace { + +// Returns the path of the directory containing this executable, or an empty +// string if the directory cannot be found. +std::string GetExecutableDirectory() { + char buffer[PATH_MAX + 1]; + ssize_t length = readlink("/proc/self/exe", buffer, sizeof(buffer)); + if (length > PATH_MAX) { + std::cerr << "Couldn't locate executable" << std::endl; + return ""; + } + std::string executable_path(buffer, length); + size_t last_separator_position = executable_path.find_last_of('/'); + if (last_separator_position == std::string::npos) { + std::cerr << "Unabled to find parent directory of " << executable_path + << std::endl; + return ""; + } + return executable_path.substr(0, last_separator_position); +} + +} // namespace + +int main(int argc, char **argv) { + // Resources are located relative to the executable. + std::string base_directory = GetExecutableDirectory(); + if (base_directory.empty()) { + base_directory = "."; + } + std::string data_directory = base_directory + "/data"; + std::string assets_path = data_directory + "/flutter_assets"; + std::string icu_data_path = data_directory + "/icudtl.dat"; + + // Arguments for the Flutter Engine. + std::vector arguments; +#ifdef NDEBUG + arguments.push_back("--disable-dart-asserts"); +#endif + + flutter::FlutterWindowController flutter_controller(icu_data_path); + + // Start the engine. + if (!flutter_controller.CreateWindow(800, 600, "Flutter Desktop Example", + assets_path, arguments)) { + return EXIT_FAILURE; + } + + // Run until the window is closed. + flutter_controller.RunEventLoop(); + return EXIT_SUCCESS; +} diff --git a/macos/.gitignore b/macos/.gitignore new file mode 100755 index 0000000..b283ed7 --- /dev/null +++ b/macos/.gitignore @@ -0,0 +1,4 @@ +xcuserdata + +# Generated by flutter run and flutter build +Generated.xcconfig diff --git a/macos/AppDelegate.swift b/macos/AppDelegate.swift new file mode 100755 index 0000000..bdcc151 --- /dev/null +++ b/macos/AppDelegate.swift @@ -0,0 +1,25 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import Cocoa + +@NSApplicationMain +class AppDelegate: NSObject, NSApplicationDelegate { + @IBOutlet weak var window: NSWindow! + + func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } +} + diff --git a/macos/Assets.xcassets/AppIcon.appiconset/Contents.json b/macos/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..2db2b1c --- /dev/null +++ b/macos/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/macos/Base.lproj/MainMenu.xib b/macos/Base.lproj/MainMenu.xib new file mode 100755 index 0000000..16c2848 --- /dev/null +++ b/macos/Base.lproj/MainMenu.xib @@ -0,0 +1,359 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macos/ExampleWindow.swift b/macos/ExampleWindow.swift new file mode 100755 index 0000000..99210d3 --- /dev/null +++ b/macos/ExampleWindow.swift @@ -0,0 +1,35 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import Cocoa + +class ExampleWindow: NSWindow { + @IBOutlet weak var flutterViewController: FLEViewController! + + override func awakeFromNib() { + PluginRegistrant.register(with: flutterViewController) + + let assets = NSURL.fileURL(withPath: "flutter_assets", relativeTo: Bundle.main.resourceURL) + var arguments: [String] = []; +#if !DEBUG + arguments.append("--disable-dart-asserts"); +#endif + flutterViewController.launchEngine( + withAssetsPath: assets, + commandLineArguments: arguments) + + super.awakeFromNib() + } +} + diff --git a/macos/Flutter/Debug.xcconfig b/macos/Flutter/Debug.xcconfig new file mode 100755 index 0000000..592ceee --- /dev/null +++ b/macos/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/macos/Flutter/Release.xcconfig b/macos/Flutter/Release.xcconfig new file mode 100755 index 0000000..592ceee --- /dev/null +++ b/macos/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/macos/Info.plist b/macos/Info.plist new file mode 100755 index 0000000..515b4ac --- /dev/null +++ b/macos/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + Copyright © 2018 Google LLC. All rights reserved. + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/macos/PluginRegistrant.h b/macos/PluginRegistrant.h new file mode 100755 index 0000000..11447af --- /dev/null +++ b/macos/PluginRegistrant.h @@ -0,0 +1,19 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import + +@interface PluginRegistrant : NSObject ++ (void)registerWithRegistry:(NSObject*)registry; +@end diff --git a/macos/PluginRegistrant.m b/macos/PluginRegistrant.m new file mode 100755 index 0000000..9cbe3e1 --- /dev/null +++ b/macos/PluginRegistrant.m @@ -0,0 +1,27 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This serves the same purpose as GeneratedPluginRegistrant in an iOS +// Flutter project. However, since there is no tooling support for plugins +// yet, adding a new plugin requires manually adding plugin registration. + +#import "PluginRegistrant.h" + +@implementation PluginRegistrant + ++ (void)registerWithRegistry:(NSObject*)registry { + // Add your plugin regitration here. +} + +@end diff --git a/macos/Runner-Bridging-Header.h b/macos/Runner-Bridging-Header.h new file mode 100755 index 0000000..cef4884 --- /dev/null +++ b/macos/Runner-Bridging-Header.h @@ -0,0 +1,16 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import +#import "PluginRegistrant.h" diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj new file mode 100755 index 0000000..ae75a3d --- /dev/null +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,490 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Build Flutter Bundle */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Build Flutter Bundle" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + 33D1A0EC22148486006C7A3E /* PBXTargetDependency */, + ); + name = "Build Flutter Bundle"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 33A2DE652267798600914F77 /* PluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 33A2DE642267798600914F77 /* PluginRegistrant.m */; }; + 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 /* ExampleWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* ExampleWindow.swift */; }; + 33CC112F204626C80003C045 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC112C20461AD40003C045 /* flutter_assets */; }; + 33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; }; + 33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 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 = ( + 33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */, + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 33A2DE632267798600914F77 /* PluginRegistrant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginRegistrant.h; sourceTree = ""; }; + 33A2DE642267798600914F77 /* PluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PluginRegistrant.m; sourceTree = ""; }; + 33BA886B226E7BE8003329D5 /* Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* Flutter Desktop Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Flutter Desktop Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* ExampleWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleWindow.swift; sourceTree = ""; }; + 33CC11162044C3600003C045 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 33CC112C20461AD40003C045 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = ../build/flutter_assets; sourceTree = ""; }; + 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FlutterMacOS.framework; path = ../flutter_framework/FlutterMacOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 33BA886B226E7BE8003329D5 /* Generated.xcconfig */, + ); + name = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* ExampleWindow.swift */, + 33A2DE632267798600914F77 /* PluginRegistrant.h */, + 33A2DE642267798600914F77 /* PluginRegistrant.m */, + 33CC11162044C3600003C045 /* Runner-Bridging-Header.h */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + 33D1A10222148A83006C7A3E /* Frameworks */, + 33CC10EE2044A3C60003C045 /* Products */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* Flutter Desktop Example.app */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + 33CC112C20461AD40003C045 /* flutter_assets */, + ); + name = Resources; + sourceTree = ""; + }; + 33D1A10222148A83006C7A3E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + ); + buildRules = ( + ); + dependencies = ( + 33D1A0EA2214847F006C7A3E /* PBXTargetDependency */, + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = "Flutter Desktop Example"; + productReference = 33CC10ED2044A3C60003C045 /* Flutter Desktop Example.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 0930; + ORGANIZATIONNAME = "Google LLC"; + TargetAttributes = { + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 0920; + ProvisioningStyle = Manual; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 33CC111A2044C6BA0003C045 /* Build Flutter Bundle */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + 33CC112F204626C80003C045 /* flutter_assets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_build_flutter_assets.sh\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* ExampleWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 33A2DE652267798600914F77 /* PluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Build Flutter Bundle */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 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_COMMA = 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_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.13; + 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_COMMA = 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_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = 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_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.13; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Manual; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = ""; + FRAMEWORK_SEARCH_PATHS = $SYMROOT/flutter_framework; + INFOPLIST_FILE = Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.google.FlutterEmbedderMacExample.FlutterDesktopExample; + PRODUCT_NAME = "Flutter Desktop Example"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OBJC_BRIDGING_HEADER = "Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Manual; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = ""; + FRAMEWORK_SEARCH_PATHS = $SYMROOT/flutter_framework; + INFOPLIST_FILE = Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.google.FlutterEmbedderMacExample.FlutterDesktopExample; + PRODUCT_NAME = "Flutter Desktop Example"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OBJC_BRIDGING_HEADER = "Runner-Bridging-Header.h"; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 33D1A0E622148440006C7A3E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33D1A0E722148440006C7A3E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Build Flutter Bundle" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33D1A0E522148440006C7A3E /* Build configuration list for PBXAggregateTarget "Copy Flutter Framework" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33D1A0E622148440006C7A3E /* Debug */, + 33D1A0E722148440006C7A3E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/macos/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/macos/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100755 index 0000000..764c74b --- /dev/null +++ b/macos/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100755 index 0000000..18d9810 --- /dev/null +++ b/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100755 index 0000000..57774f0 --- /dev/null +++ b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macos/name_output.sh b/macos/name_output.sh new file mode 100755 index 0000000..6f8e620 --- /dev/null +++ b/macos/name_output.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +# +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This script outputs the path to the app bundle that is created by +# build.sh for the given configuration ("debug" or "release"). +# +# Having this file in this location, with this name, enables the current +# experimental 'flutter run' support for desktop. + +# Arguments +readonly flutter_config="$1" + +# Directories +readonly base_dir="$(dirname "$0")" +readonly flutter_app_dir="${base_dir}/.." +# This must match the paths in build.sh. +readonly products_dir="${flutter_app_dir}/build/macos/Build/Products" + +# Xcode configuration +readonly app_name="Flutter Desktop Example" +if [[ "${flutter_config}" == "release" ]]; then + readonly build_config="Release" +else + readonly build_config="Debug" +fi + +echo "${products_dir}/${build_config}/${app_name}.app" diff --git a/pubspec.yaml b/pubspec.yaml index 2f3c5a3..087d0a9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,8 +13,8 @@ environment: # For Google I/O we are being very specific about pinning to specific branch revision. # This is flutter commit hash b593f5167bce84fb3cad5c258477bf3abc1b14eb, tagged # as Flutter version 1.5.4. - #sdk: ">=2.3.0-dev.0.1 <3.0.0" - sdk: "2.3.0-dev.0.1.flutter-cf4444b803" + sdk: ">=2.3.0-dev.0.1 <3.0.0" + # sdk: "2.3.0-dev.0.1.flutter-cf4444b803" dependencies: flutter: diff --git a/windows/.gitignore b/windows/.gitignore new file mode 100755 index 0000000..96ca22c --- /dev/null +++ b/windows/.gitignore @@ -0,0 +1,332 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# Local additions, not from the link above +Generated.props + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ diff --git a/windows/Runner.sln b/windows/Runner.sln new file mode 100755 index 0000000..16c6bf6 --- /dev/null +++ b/windows/Runner.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27703.2026 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Runner", "Runner.vcxproj", "{5A827760-CF8B-408A-99A3-B6C0AD2271E7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Debug|x64.ActiveCfg = Debug|x64 + {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Debug|x64.Build.0 = Debug|x64 + {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Release|x64.ActiveCfg = Release|x64 + {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6C8A8041-10D8-4BEB-B73D-C02BCE62120B} + EndGlobalSection +EndGlobal diff --git a/windows/Runner.vcxproj b/windows/Runner.vcxproj new file mode 100755 index 0000000..492bfbf --- /dev/null +++ b/windows/Runner.vcxproj @@ -0,0 +1,159 @@ + + + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {5A827760-CF8B-408A-99A3-B6C0AD2271E7} + GLFWExample + 10.0.17134.0 + + + + Application + true + v141 + MultiByte + + + Application + false + v141 + true + MultiByte + + + + + + + + + + + + + + + + + $(ProjectDir)..\build\windows\$(Platform)\$(Configuration)\$(ProjectName)\ + $(ProjectDir)..\build\windows\intermediates\$(Platform)\$(Configuration)\$(ProjectName)\ + $(IntDir)flutter_library\;$(IntDir)flutter_library\cpp_client_wrapper\include\;$(IncludePath) + $(IntDir)flutter_library;$(LibraryPath) + Flutter Desktop Example + + + $(ProjectDir)..\build\windows\$(Platform)\$(Configuration)\$(ProjectName)\ + $(ProjectDir)..\build\windows\intermediates\$(Platform)\$(Configuration)\$(ProjectName)\ + $(IntDir)flutter_library\;$(IntDir)flutter_library\cpp_client_wrapper\include\;$(IncludePath) + $(IntDir)flutter_library;$(LibraryPath) + Flutter Desktop Example + + + + Level3 + Disabled + true + true + + + _MBCS;%(PreprocessorDefinitions) + + + flutter_windows.dll.lib;opengl32.lib;%(AdditionalDependencies) + + + $(ProjectDir)scripts\prepare_dependencies "$(IntDir)" + Sync and build dependencies + + + + + + + + + + + + + + + + + $(ProjectDir)scripts\bundle_assets_and_deps "$(IntDir)flutter_library\" "$(OutputPath)" + + + Bundling dependencies + Dummy_Run_Always + + + + + + + Level3 + MaxSpeed + true + true + true + true + + + _MBCS;%(PreprocessorDefinitions) + + + true + true + flutter_windows.dll.lib;opengl32.lib;%(AdditionalDependencies) + + + $(ProjectDir)scripts\prepare_dependencies "$(IntDir)" + Sync and build dependencies + + + + + + + + + + + + + + + + + $(ProjectDir)scripts\bundle_assets_and_deps "$(IntDir)flutter_library\" "$(OutputPath)" + + + Bundling dependencies + Dummy_Run_Always + + + + + + + + + + + + + + + $(SolutionDir) + + diff --git a/windows/Runner.vcxproj.filters b/windows/Runner.vcxproj.filters new file mode 100755 index 0000000..5a93715 --- /dev/null +++ b/windows/Runner.vcxproj.filters @@ -0,0 +1,34 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {2761a4b5-57b2-4d50-a677-d20ddc17a7f1} + + + + + Source Files + + + Source Files\Client Wrapper + + + Source Files\Client Wrapper + + + Source Files\Client Wrapper + + + diff --git a/windows/build.bat b/windows/build.bat new file mode 100755 index 0000000..a667491 --- /dev/null +++ b/windows/build.bat @@ -0,0 +1,61 @@ +:: Copyright 2019 Google LLC +:: +:: Licensed under the Apache License, Version 2.0 (the "License"); +:: you may not use this file except in compliance with the License. +:: You may obtain a copy of the License at +:: +:: http://www.apache.org/licenses/LICENSE-2.0 +:: +:: Unless required by applicable law or agreed to in writing, software +:: distributed under the License is distributed on an "AS IS" BASIS, +:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +:: See the License for the specific language governing permissions and +:: limitations under the License. + +:: This script does a Windows build using msbuild. +:: +:: Having this file in this location, with this name, enables the current +:: experimental 'flutter build' support for desktop. + +@echo off +SETLOCAL ENABLEDELAYEDEXPANSION + +set FLUTTER_ROOT=%1 +set FLUTTER_CONFIG=%2 +set TRACK_WIDGET_CREATION=%3 + +set SOLUTION_NAME=Runner + +set BASE_DIR=%~dp0 +set FLUTTER_APP_DIR=%BASE_DIR%..\ +set PRODUCTS_DIR=%FLUTTER_APP_DIR%build\windows\x86\ + +if "%FLUTTER_CONFIG%"=="release" ( + set BUILD_CONFIG=Release +) else ( + set BUILD_CONFIG=Debug +) + +if "%TRACK_WIDGET_CREATION%"=="track-widget-creation" ( + set EXTRA_BUNDLE_FLAGS=--track-widget-creation +) + +set DART_BIN_DIR=%FLUTTER_ROOT%\bin\cache\dart-sdk\bin\ + +:: Write build settings to Generated.props +call "%DART_BIN_DIR%dart" "%BASE_DIR%generate_props.dart" "%BASE_DIR%Generated.props" "%FLUTTER_ROOT%" "%EXTRA_BUNDLE_FLAGS%" + +:: Attempt to locate and run vcvars64.bat +for /f "delims=" %%i in ('%DART_BIN_DIR%dart %BASE_DIR%.\find_vcvars.dart') do set VCVARS_PATH=%%i +if "%VCVARS_PATH%" == "" ( + echo ####################################################################### + echo # Warning: Unable to find vcvars64.bat. Proceeding anyway; if it fails, + echo # run vcvars64.bat manually in this console then try again. + echo ####################################################################### +) else ( + call "%VCVARS_PATH%" + if %errorlevel% neq 0 exit /b %errorlevel% +) + +:: Build the project. +msbuild "%BASE_DIR%%SOLUTION_NAME%.sln" /p:Configuration=%BUILD_CONFIG% diff --git a/windows/find_vcvars.dart b/windows/find_vcvars.dart new file mode 100755 index 0000000..375651e --- /dev/null +++ b/windows/find_vcvars.dart @@ -0,0 +1,35 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This script attempts to find vcvars64.bat, and if successful outputs its +// path and returns 0. Otherwise, it prints nothing and returns 1. +import 'dart:io'; + +int main() { + final programDir = Platform.environment['PROGRAMFILES(X86)']; + final pathPrefix = '$programDir\\Microsoft Visual Studio'; + const pathSuffix = 'VC\\Auxiliary\\Build\\vcvars64.bat'; + final years = ['2017', '2019']; + final flavors = ['Community', 'Professional', 'Enterprise', 'Preview']; + for (final year in years) { + for (final flavor in flavors) { + final testPath = '$pathPrefix\\$year\\$flavor\\$pathSuffix'; + if (File(testPath).existsSync()) { + print(testPath); + return 0; + } + } + } + return 1; +} diff --git a/windows/flutter_embedder_example.cpp b/windows/flutter_embedder_example.cpp new file mode 100755 index 0000000..9d62357 --- /dev/null +++ b/windows/flutter_embedder_example.cpp @@ -0,0 +1,75 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include + +#include "flutter/flutter_window_controller.h" + +// Include windows.h last, to minimize potential conflicts. The CreateWindow +// macro needs to be undefined because it prevents calling +// FlutterWindowController's method. +#include +#undef CreateWindow + +namespace { + +// Returns the path of the directory containing this executable, or an empty +// string if the directory cannot be found. +std::string GetExecutableDirectory() { + char buffer[MAX_PATH]; + if (GetModuleFileName(nullptr, buffer, MAX_PATH) == 0) { + std::cerr << "Couldn't locate executable" << std::endl; + return ""; + } + std::string executable_path(buffer); + size_t last_separator_position = executable_path.find_last_of('\\'); + if (last_separator_position == std::string::npos) { + std::cerr << "Unabled to find parent directory of " << executable_path + << std::endl; + return ""; + } + return executable_path.substr(0, last_separator_position); +} + +} // namespace + +int main(int argc, char **argv) { + // Resources are located relative to the executable. + std::string base_directory = GetExecutableDirectory(); + if (base_directory.empty()) { + base_directory = "."; + } + std::string data_directory = base_directory + "\\data"; + std::string assets_path = data_directory + "\\flutter_assets"; + std::string icu_data_path = data_directory + "\\icudtl.dat"; + + // Arguments for the Flutter Engine. + std::vector arguments; +#ifndef _DEBUG + arguments.push_back("--disable-dart-asserts"); +#endif + flutter::FlutterWindowController flutter_controller(icu_data_path); + + // Start the engine. + if (!flutter_controller.CreateWindow(800, 600, "Flutter Desktop Example", + assets_path, arguments)) { + return EXIT_FAILURE; + } + + // Run until the window is closed. + flutter_controller.RunEventLoop(); + return EXIT_SUCCESS; +} diff --git a/windows/generate_props.dart b/windows/generate_props.dart new file mode 100755 index 0000000..5a91894 --- /dev/null +++ b/windows/generate_props.dart @@ -0,0 +1,58 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This script creates a generated .props file containing various user +// macros needed by the Visual Studio build, adding all of them to the +// build environment for use in build scripts. +import 'dart:io'; + +void main(List arguments) { + final outputPath = arguments[0]; + final settings = { + 'FLUTTER_ROOT': arguments[1], + 'EXTRA_BUNDLE_FLAGS': arguments[2], + }; + + File(outputPath).writeAsStringSync(''' + + + +${getUserMacrosContent(settings)} + + + + +${getItemGroupContent(settings)} + +'''); +} + +String getUserMacrosContent(Map settings) { + final macroList = StringBuffer(); + for (final setting in settings.entries) { + macroList.writeln(' <${setting.key}>${setting.value}'); + } + return macroList.toString(); +} + +String getItemGroupContent(Map settings) { + final macroList = StringBuffer(); + for (final name in settings.keys) { + macroList.writeln(''' + \$($name) + true + '''); + } + return macroList.toString(); +} diff --git a/windows/name_output.bat b/windows/name_output.bat new file mode 100755 index 0000000..b5812e3 --- /dev/null +++ b/windows/name_output.bat @@ -0,0 +1,38 @@ +:: Copyright 2019 Google LLC +:: +:: Licensed under the Apache License, Version 2.0 (the "License"); +:: you may not use this file except in compliance with the License. +:: You may obtain a copy of the License at +:: +:: http://www.apache.org/licenses/LICENSE-2.0 +:: +:: Unless required by applicable law or agreed to in writing, software +:: distributed under the License is distributed on an "AS IS" BASIS, +:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +:: See the License for the specific language governing permissions and +:: limitations under the License. + +:: This script outputs the path to the executable that is created by +:: build.bat for the given configuration ("debug" or "release"). +:: +:: Having this file in this location, with this name, enables the current +:: experimental 'flutter run' support for desktop. +@echo off +SETLOCAL ENABLEDELAYEDEXPANSION + +set FLUTTER_CONFIG=%1 + +set PROJECT_NAME=Runner +set EXE_NAME=Flutter Desktop Example + +set BASE_DIR=%~dp0 +set FLUTTER_APP_DIR=%BASE_DIR%..\ +set PRODUCTS_DIR=%FLUTTER_APP_DIR%build\windows\x64\ + +if "%FLUTTER_CONFIG%"=="release" ( + set BUILD_CONFIG=Release +) else ( + set BUILD_CONFIG=Debug +) + +echo %PRODUCTS_DIR%%BUILD_CONFIG%\%PROJECT_NAME%\%EXE_NAME%.exe diff --git a/windows/scripts/bundle_assets_and_deps.bat b/windows/scripts/bundle_assets_and_deps.bat new file mode 100755 index 0000000..cbf0552 --- /dev/null +++ b/windows/scripts/bundle_assets_and_deps.bat @@ -0,0 +1,44 @@ +:: Copyright 2018 Google LLC +:: +:: Licensed under the Apache License, Version 2.0 (the "License"); +:: you may not use this file except in compliance with the License. +:: You may obtain a copy of the License at +:: +:: http://www.apache.org/licenses/LICENSE-2.0 +:: +:: Unless required by applicable law or agreed to in writing, software +:: distributed under the License is distributed on an "AS IS" BASIS, +:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +:: See the License for the specific language governing permissions and +:: limitations under the License. +@echo off + +set FLUTTER_APP_DIR=%~dp0..\.. +set ICU_DATA_SOURCE=%FLUTTER_ROOT%\bin\cache\artifacts\engine\windows-x64\icudtl.dat +set ASSET_DIR_NAME=flutter_assets + +set FLUTTER_LIBRARY_DIR=%~1 +set BUNDLE_DIR=%~2 +set DATA_DIR=%BUNDLE_DIR%data +set TARGET_ASSET_DIR=%DATA_DIR%\%ASSET_DIR_NAME% + +if not exist "%DATA_DIR%" call mkdir "%DATA_DIR%" +if %errorlevel% neq 0 exit /b %errorlevel% + +:: Build the Flutter assets. +cd "%FLUTTER_APP_DIR%" +call %FLUTTER_ROOT%\bin\flutter build bundle %EXTRA_BUNDLE_FLAGS% +if %errorlevel% neq 0 exit /b %errorlevel% +:: Copy them to the data directory. +if exist "%TARGET_ASSET_DIR%" call rmdir /s /q "%TARGET_ASSET_DIR%" +if %errorlevel% neq 0 exit /b %errorlevel% +call xcopy /s /e /i /q "%FLUTTER_APP_DIR%\build\%ASSET_DIR_NAME%" "%TARGET_ASSET_DIR%" +if %errorlevel% neq 0 exit /b %errorlevel% + +:: Copy the icudtl.dat file from the Flutter tree to the data directory. +call xcopy /y /d /q "%ICU_DATA_SOURCE%" "%DATA_DIR%" +if %errorlevel% neq 0 exit /b %errorlevel% + +:: Copy the Flutter DLL to the target location. +call xcopy /y /d /q "%FLUTTER_LIBRARY_DIR%flutter_windows.dll" "%BUNDLE_DIR%" +if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/windows/scripts/prepare_dependencies.bat b/windows/scripts/prepare_dependencies.bat new file mode 100755 index 0000000..1419c6c --- /dev/null +++ b/windows/scripts/prepare_dependencies.bat @@ -0,0 +1,35 @@ +:: Copyright 2018 Google LLC +:: +:: Licensed under the Apache License, Version 2.0 (the "License"); +:: you may not use this file except in compliance with the License. +:: You may obtain a copy of the License at +:: +:: http://www.apache.org/licenses/LICENSE-2.0 +:: +:: Unless required by applicable law or agreed to in writing, software +:: distributed under the License is distributed on an "AS IS" BASIS, +:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +:: See the License for the specific language governing permissions and +:: limitations under the License. +@echo off + +set INTERMEDIATE_DIR=%~1 +set LOCAL_COPY_DIR=%INTERMEDIATE_DIR%flutter_library\ +set FLUTTER_CACHE_DIR=%FLUTTER_ROOT%\bin\cache\artifacts\engine\windows-x64\ + +:: Sync the Flutter library, removing previous copies to ensure +:: that stale files don't stay in the copy. +call %FLUTTER_ROOT%\bin\flutter precache --windows --no-android --no-ios +if %errorlevel% neq 0 exit /b %errorlevel% +echo rmdir /s /q "%LOCAL_COPY_DIR%" +rmdir /s /q "%LOCAL_COPY_DIR%" +echo mkdir "%LOCAL_COPY_DIR%" +mkdir "%LOCAL_COPY_DIR%" +if %errorlevel% neq 0 exit /b %errorlevel% + +xcopy /q /i "%FLUTTER_CACHE_DIR%"flutter_windows.* "%LOCAL_COPY_DIR%" +if %errorlevel% neq 0 exit /b %errorlevel% +xcopy /q /i "%FLUTTER_CACHE_DIR%"flutter_*.h "%LOCAL_COPY_DIR%" +if %errorlevel% neq 0 exit /b %errorlevel% +xcopy /q /i /s "%FLUTTER_CACHE_DIR%"cpp_client_wrapper "%LOCAL_COPY_DIR%"cpp_client_wrapper +if %errorlevel% neq 0 exit /b %errorlevel%