From bc8cc850524fb957372cf0444aef232b9703e104 Mon Sep 17 00:00:00 2001 From: Brett Morgan Date: Tue, 2 Aug 2022 19:39:19 +1000 Subject: [PATCH] `desktop_photo_search` Rebuild script (#1356) --- desktop_photo_search/codelab_rebuild.yaml | 115 ++++++++++++++++++ desktop_photo_search/fluent_ui/.metadata | 32 ++++- .../fluent_ui/linux/CMakeLists.txt | 36 ++++-- .../fluent_ui/linux/flutter/CMakeLists.txt | 1 + .../fluent_ui/linux/my_application.cc | 4 +- .../macos/Runner.xcodeproj/project.pbxproj | 78 ++++++------ .../xcshareddata/xcschemes/Runner.xcscheme | 8 +- .../fluent_ui/macos/Runner/AppDelegate.swift | 4 - .../macos/Runner/Configs/AppInfo.xcconfig | 4 +- .../macos/Runner/MainFlutterWindow.swift | 4 - .../fluent_ui/windows/CMakeLists.txt | 20 +-- .../fluent_ui/windows/flutter/CMakeLists.txt | 1 + .../fluent_ui/windows/runner/CMakeLists.txt | 15 +++ .../fluent_ui/windows/runner/Runner.rc | 4 +- .../fluent_ui/windows/runner/main.cpp | 2 +- .../fluent_ui/windows/runner/utils.cpp | 6 +- desktop_photo_search/material/.metadata | 32 ++++- .../material/linux/CMakeLists.txt | 36 ++++-- .../material/linux/flutter/CMakeLists.txt | 1 + .../material/linux/my_application.cc | 4 +- .../macos/Runner.xcodeproj/project.pbxproj | 76 ++++++------ .../xcshareddata/xcschemes/Runner.xcscheme | 8 +- .../material/macos/Runner/AppDelegate.swift | 4 - .../macos/Runner/Configs/AppInfo.xcconfig | 4 +- .../macos/Runner/MainFlutterWindow.swift | 4 - .../material/windows/CMakeLists.txt | 20 +-- .../material/windows/flutter/CMakeLists.txt | 1 + .../material/windows/runner/CMakeLists.txt | 15 +++ .../material/windows/runner/Runner.rc | 4 +- .../material/windows/runner/main.cpp | 2 +- .../material/windows/runner/utils.cpp | 6 +- 31 files changed, 396 insertions(+), 155 deletions(-) create mode 100644 desktop_photo_search/codelab_rebuild.yaml diff --git a/desktop_photo_search/codelab_rebuild.yaml b/desktop_photo_search/codelab_rebuild.yaml new file mode 100644 index 000000000..9a5673056 --- /dev/null +++ b/desktop_photo_search/codelab_rebuild.yaml @@ -0,0 +1,115 @@ +# Run with tooling from https://github.com/flutter/codelabs/tree/main/tooling/codelab_rebuild +name: Desktop Photo Search rebuild script +steps: + - name: Remove fluent_ui runners + path: fluent_ui + rmdirs: + - macos + - linux + - windows + - name: Flutter recreate + path: fluent_ui + flutter: create --platforms windows,linux,macos --project-name desktop_photo_search . + - name: Replace fluent_ui/macos/Runner/DebugProfile.entitlements + path: fluent_ui/macos/Runner/DebugProfile.entitlements + replace-contents: + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.files.user-selected.read-write + + com.apple.security.network.client + + com.apple.security.network.server + + + + - name: Patch fluent_ui/macos/Runner/Release.entitlements + path: fluent_ui/macos/Runner/Release.entitlements + replace-contents: + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-write + + com.apple.security.network.client + + + + - name: Flutter build macOS + path: fluent_ui + flutter: build macos + - name: Remove material runners + path: material + rmdirs: + - macos + - linux + - windows + - name: Flutter recreate + path: material + flutter: create --platforms windows,linux,macos --project-name desktop_photo_search . + - name: Replace material/macos/Runner/DebugProfile.entitlements + path: material/macos/Runner/DebugProfile.entitlements + replace-contents: + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.files.user-selected.read-write + + com.apple.security.network.client + + com.apple.security.network.server + + + + - name: Replace material/macos/Runner/Release.entitlements + path: material/macos/Runner/Release.entitlements + replace-contents: + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-write + + com.apple.security.network.client + + + + - name: Patch material/macos/Runner/Base.lproj/MainMenu.xib + path: material/macos/Runner/Base.lproj/MainMenu.xib + patch-u: + --- b/desktop_photo_search/material/macos/Runner/Base.lproj/MainMenu.xib + +++ a/desktop_photo_search/material/macos/Runner/Base.lproj/MainMenu.xib + @@ -330,10 +330,11 @@ + + + + - + - + + + + + + + + - + + + + + + - name: Flutter build macOS + path: material + flutter: build macos diff --git a/desktop_photo_search/fluent_ui/.metadata b/desktop_photo_search/fluent_ui/.metadata index 356d05d6d..d1551205d 100644 --- a/desktop_photo_search/fluent_ui/.metadata +++ b/desktop_photo_search/fluent_ui/.metadata @@ -1,10 +1,36 @@ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # -# This file should be version controlled and should not be manually edited. +# This file should be version controlled. version: - revision: fdd0af78bbda27e1084ec859b27765d927cbe27e - channel: beta + revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + channel: stable project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + - platform: linux + create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + - platform: macos + create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + - platform: windows + create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/desktop_photo_search/fluent_ui/linux/CMakeLists.txt b/desktop_photo_search/fluent_ui/linux/CMakeLists.txt index ec2a7ab66..84c0f3239 100644 --- a/desktop_photo_search/fluent_ui/linux/CMakeLists.txt +++ b/desktop_photo_search/fluent_ui/linux/CMakeLists.txt @@ -1,11 +1,19 @@ +# Project-level configuration. cmake_minimum_required(VERSION 3.10) project(runner 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 "desktop_photo_search") +# The unique GTK application identifier for this application. See: +# https://wiki.gnome.org/HowDoI/ChooseApplicationID set(APPLICATION_ID "com.example.desktop_photo_search") +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. cmake_policy(SET CMP0063 NEW) +# Load bundled libraries from the lib/ directory relative to the binary. set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") # Root filesystem for cross-building. @@ -18,7 +26,7 @@ if(FLUTTER_TARGET_PLATFORM_SYSROOT) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) endif() -# Configure build options. +# Define build configuration options. if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Flutter build mode" FORCE) @@ -27,6 +35,10 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) endif() # 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_14) target_compile_options(${TARGET} PRIVATE -Wall -Werror) @@ -34,9 +46,8 @@ function(APPLY_STANDARD_SETTINGS TARGET) target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") endfunction() -set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") - # Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") add_subdirectory(${FLUTTER_MANAGED_DIR}) # System-level dependencies. @@ -45,16 +56,27 @@ pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") -# Application build +# Define the application target. To change its name, change BINARY_NAME above, +# 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} "main.cc" "my_application.cc" "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" ) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. apply_standard_settings(${BINARY_NAME}) + +# Add dependency libraries. Add any application-specific dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter) target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) + +# Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) + # Only the install-generated bundle's copy of the executable will launch # correctly, since the resources must in the right relative locations. To avoid # people trying to run the unbundled copy, put it in a subdirectory instead of @@ -94,11 +116,11 @@ install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR} install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) -if(PLUGIN_BUNDLED_LIBRARIES) - install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" +foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) + install(FILES "${bundled_library}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) -endif() +endforeach(bundled_library) # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. diff --git a/desktop_photo_search/fluent_ui/linux/flutter/CMakeLists.txt b/desktop_photo_search/fluent_ui/linux/flutter/CMakeLists.txt index 33fd5801e..d5bd01648 100644 --- a/desktop_photo_search/fluent_ui/linux/flutter/CMakeLists.txt +++ b/desktop_photo_search/fluent_ui/linux/flutter/CMakeLists.txt @@ -1,3 +1,4 @@ +# This file controls Flutter-level build steps. It should not be edited. cmake_minimum_required(VERSION 3.10) set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") diff --git a/desktop_photo_search/fluent_ui/linux/my_application.cc b/desktop_photo_search/fluent_ui/linux/my_application.cc index 92ee84310..1bc867faf 100644 --- a/desktop_photo_search/fluent_ui/linux/my_application.cc +++ b/desktop_photo_search/fluent_ui/linux/my_application.cc @@ -40,11 +40,11 @@ static void my_application_activate(GApplication* application) { if (use_header_bar) { GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); gtk_widget_show(GTK_WIDGET(header_bar)); - gtk_header_bar_set_title(header_bar, "Desktop Photo Search"); + gtk_header_bar_set_title(header_bar, "desktop_photo_search"); gtk_header_bar_set_show_close_button(header_bar, TRUE); gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); } else { - gtk_window_set_title(window, "Desktop Photo Search"); + gtk_window_set_title(window, "desktop_photo_search"); } gtk_window_set_default_size(window, 1280, 720); diff --git a/desktop_photo_search/fluent_ui/macos/Runner.xcodeproj/project.pbxproj b/desktop_photo_search/fluent_ui/macos/Runner.xcodeproj/project.pbxproj index 4f5b4346e..441bf6d1e 100644 --- a/desktop_photo_search/fluent_ui/macos/Runner.xcodeproj/project.pbxproj +++ b/desktop_photo_search/fluent_ui/macos/Runner.xcodeproj/project.pbxproj @@ -21,12 +21,12 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 1466779606FB1CE825B1465E /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B02A6160A24E69A8234C4643 /* Pods_Runner.framework */; }; 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 */; }; - 6D537A3FDA594DC5503EA037 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C50174A22B22BED5DB30AB67 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -55,7 +55,7 @@ /* Begin PBXFileReference section */ 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* fluent_ui.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = fluent_ui.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10ED2044A3C60003C045 /* desktop_photo_search.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = desktop_photo_search.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; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -67,12 +67,12 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 5C3662BCAB0C08E8294CC9B1 /* 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 = ""; }; + 6FF7B7AC09DE996CDF6C9D16 /* 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 = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; - A8F75D32B4F5056CAC9235F5 /* 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 = ""; }; - C40FEF4F88D6CC7B2242F051 /* 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 = ""; }; - C50174A22B22BED5DB30AB67 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - C86753C161891598F592CA15 /* 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 = ""; }; + B02A6160A24E69A8234C4643 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D60EBD7F6771E871580DEFD5 /* 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 = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -80,24 +80,13 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6D537A3FDA594DC5503EA037 /* Pods_Runner.framework in Frameworks */, + 1466779606FB1CE825B1465E /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 3093EE7BB096B666F4EA245D /* Pods */ = { - isa = PBXGroup; - children = ( - C86753C161891598F592CA15 /* Pods-Runner.debug.xcconfig */, - C40FEF4F88D6CC7B2242F051 /* Pods-Runner.release.xcconfig */, - A8F75D32B4F5056CAC9235F5 /* Pods-Runner.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; 33BA886A226E78AF003329D5 /* Configs */ = { isa = PBXGroup; children = ( @@ -116,14 +105,14 @@ 33CEB47122A05771004F2AC0 /* Flutter */, 33CC10EE2044A3C60003C045 /* Products */, D73912EC22F37F3D000D13A0 /* Frameworks */, - 3093EE7BB096B666F4EA245D /* Pods */, + 8152A8839F3CF1237999FBE4 /* Pods */, ); sourceTree = ""; }; 33CC10EE2044A3C60003C045 /* Products */ = { isa = PBXGroup; children = ( - 33CC10ED2044A3C60003C045 /* fluent_ui.app */, + 33CC10ED2044A3C60003C045 /* desktop_photo_search.app */, ); name = Products; sourceTree = ""; @@ -163,10 +152,21 @@ path = Runner; sourceTree = ""; }; + 8152A8839F3CF1237999FBE4 /* Pods */ = { + isa = PBXGroup; + children = ( + 6FF7B7AC09DE996CDF6C9D16 /* Pods-Runner.debug.xcconfig */, + 5C3662BCAB0C08E8294CC9B1 /* Pods-Runner.release.xcconfig */, + D60EBD7F6771E871580DEFD5 /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; D73912EC22F37F3D000D13A0 /* Frameworks */ = { isa = PBXGroup; children = ( - C50174A22B22BED5DB30AB67 /* Pods_Runner.framework */, + B02A6160A24E69A8234C4643 /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -178,13 +178,13 @@ isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - C6FB9C29B68E6DEF8529C06C /* [CP] Check Pods Manifest.lock */, + 44D97A05ED9D4C9B23C08AF7 /* [CP] Check Pods Manifest.lock */, 33CC10E92044A3C60003C045 /* Sources */, 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - A4BDB29A994AF8CE17785608 /* [CP] Embed Pods Frameworks */, + F932AB53040AFFE507EC30EE /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -193,7 +193,7 @@ ); name = Runner; productName = Runner; - productReference = 33CC10ED2044A3C60003C045 /* fluent_ui.app */; + productReference = 33CC10ED2044A3C60003C045 /* desktop_photo_search.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -291,43 +291,43 @@ shellPath = /bin/sh; shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; - A4BDB29A994AF8CE17785608 /* [CP] Embed Pods Frameworks */ = { + 44D97A05ED9D4C9B23C08AF7 /* [CP] Check Pods Manifest.lock */ = { 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"; + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + 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; }; - C6FB9C29B68E6DEF8529C06C /* [CP] Check Pods Manifest.lock */ = { + F932AB53040AFFE507EC30EE /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); 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"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/desktop_photo_search/fluent_ui/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/desktop_photo_search/fluent_ui/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index dd5781da5..22a9bd6f2 100644 --- a/desktop_photo_search/fluent_ui/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/desktop_photo_search/fluent_ui/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -15,7 +15,7 @@ @@ -31,7 +31,7 @@ @@ -54,7 +54,7 @@ @@ -71,7 +71,7 @@ diff --git a/desktop_photo_search/fluent_ui/macos/Runner/AppDelegate.swift b/desktop_photo_search/fluent_ui/macos/Runner/AppDelegate.swift index 5f372dd3a..d53ef6437 100644 --- a/desktop_photo_search/fluent_ui/macos/Runner/AppDelegate.swift +++ b/desktop_photo_search/fluent_ui/macos/Runner/AppDelegate.swift @@ -1,7 +1,3 @@ -// Copyright 2019 The Flutter team. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - import Cocoa import FlutterMacOS diff --git a/desktop_photo_search/fluent_ui/macos/Runner/Configs/AppInfo.xcconfig b/desktop_photo_search/fluent_ui/macos/Runner/Configs/AppInfo.xcconfig index 5eb9d254a..da89cc702 100644 --- a/desktop_photo_search/fluent_ui/macos/Runner/Configs/AppInfo.xcconfig +++ b/desktop_photo_search/fluent_ui/macos/Runner/Configs/AppInfo.xcconfig @@ -5,10 +5,10 @@ // 'flutter create' template. // The application's name. By default this is also the title of the Flutter window. -PRODUCT_NAME = Photo Search +PRODUCT_NAME = desktop_photo_search // The application's bundle identifier PRODUCT_BUNDLE_IDENTIFIER = com.example.desktopPhotoSearch // The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2020 com.example. All rights reserved. +PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved. diff --git a/desktop_photo_search/fluent_ui/macos/Runner/MainFlutterWindow.swift b/desktop_photo_search/fluent_ui/macos/Runner/MainFlutterWindow.swift index e1cf22cb7..2722837ec 100644 --- a/desktop_photo_search/fluent_ui/macos/Runner/MainFlutterWindow.swift +++ b/desktop_photo_search/fluent_ui/macos/Runner/MainFlutterWindow.swift @@ -1,7 +1,3 @@ -// Copyright 2019 The Flutter team. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - import Cocoa import FlutterMacOS diff --git a/desktop_photo_search/fluent_ui/windows/CMakeLists.txt b/desktop_photo_search/fluent_ui/windows/CMakeLists.txt index 3adb3c6ad..2b0413165 100644 --- a/desktop_photo_search/fluent_ui/windows/CMakeLists.txt +++ b/desktop_photo_search/fluent_ui/windows/CMakeLists.txt @@ -1,13 +1,16 @@ +# Project-level configuration. cmake_minimum_required(VERSION 3.14) project(desktop_photo_search 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 "desktop_photo_search") +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. cmake_policy(SET CMP0063 NEW) -set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") - -# Configure build options. +# Define build configuration option. get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(IS_MULTICONFIG) set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" @@ -20,7 +23,7 @@ else() "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}") @@ -30,6 +33,10 @@ set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 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") @@ -38,12 +45,11 @@ function(APPLY_STANDARD_SETTINGS TARGET) target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") endfunction() -set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") - # Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") add_subdirectory(${FLUTTER_MANAGED_DIR}) -# Application build +# Application build; see runner/CMakeLists.txt. add_subdirectory("runner") # Generated plugin build rules, which manage building the plugins and adding diff --git a/desktop_photo_search/fluent_ui/windows/flutter/CMakeLists.txt b/desktop_photo_search/fluent_ui/windows/flutter/CMakeLists.txt index b2e4bd8d6..930d2071a 100644 --- a/desktop_photo_search/fluent_ui/windows/flutter/CMakeLists.txt +++ b/desktop_photo_search/fluent_ui/windows/flutter/CMakeLists.txt @@ -1,3 +1,4 @@ +# 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") diff --git a/desktop_photo_search/fluent_ui/windows/runner/CMakeLists.txt b/desktop_photo_search/fluent_ui/windows/runner/CMakeLists.txt index de2d8916b..b9e550fba 100644 --- a/desktop_photo_search/fluent_ui/windows/runner/CMakeLists.txt +++ b/desktop_photo_search/fluent_ui/windows/runner/CMakeLists.txt @@ -1,6 +1,11 @@ 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" @@ -10,8 +15,18 @@ add_executable(${BINARY_NAME} WIN32 "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}) + +# 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_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/desktop_photo_search/fluent_ui/windows/runner/Runner.rc b/desktop_photo_search/fluent_ui/windows/runner/Runner.rc index 8e5b48869..84c721722 100644 --- a/desktop_photo_search/fluent_ui/windows/runner/Runner.rc +++ b/desktop_photo_search/fluent_ui/windows/runner/Runner.rc @@ -90,10 +90,10 @@ BEGIN BLOCK "040904e4" BEGIN VALUE "CompanyName", "com.example" "\0" - VALUE "FileDescription", "A Photo Search sample app." "\0" + VALUE "FileDescription", "desktop_photo_search" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "desktop_photo_search" "\0" - VALUE "LegalCopyright", "Copyright (C) 2020 com.example. All rights reserved." "\0" + VALUE "LegalCopyright", "Copyright (C) 2022 com.example. All rights reserved." "\0" VALUE "OriginalFilename", "desktop_photo_search.exe" "\0" VALUE "ProductName", "desktop_photo_search" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" diff --git a/desktop_photo_search/fluent_ui/windows/runner/main.cpp b/desktop_photo_search/fluent_ui/windows/runner/main.cpp index a20675a4f..f25ead05b 100644 --- a/desktop_photo_search/fluent_ui/windows/runner/main.cpp +++ b/desktop_photo_search/fluent_ui/windows/runner/main.cpp @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - if (!window.CreateAndShow(L"Photo Search", origin, size)) { + if (!window.CreateAndShow(L"desktop_photo_search", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); diff --git a/desktop_photo_search/fluent_ui/windows/runner/utils.cpp b/desktop_photo_search/fluent_ui/windows/runner/utils.cpp index d19bdbbcc..f5bf9fa0f 100644 --- a/desktop_photo_search/fluent_ui/windows/runner/utils.cpp +++ b/desktop_photo_search/fluent_ui/windows/runner/utils.cpp @@ -48,10 +48,10 @@ std::string Utf8FromUtf16(const wchar_t* utf16_string) { int target_length = ::WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, -1, nullptr, 0, nullptr, nullptr); - if (target_length == 0) { - return std::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, diff --git a/desktop_photo_search/material/.metadata b/desktop_photo_search/material/.metadata index 356d05d6d..d1551205d 100644 --- a/desktop_photo_search/material/.metadata +++ b/desktop_photo_search/material/.metadata @@ -1,10 +1,36 @@ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # -# This file should be version controlled and should not be manually edited. +# This file should be version controlled. version: - revision: fdd0af78bbda27e1084ec859b27765d927cbe27e - channel: beta + revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + channel: stable project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + - platform: linux + create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + - platform: macos + create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + - platform: windows + create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/desktop_photo_search/material/linux/CMakeLists.txt b/desktop_photo_search/material/linux/CMakeLists.txt index ec2a7ab66..84c0f3239 100644 --- a/desktop_photo_search/material/linux/CMakeLists.txt +++ b/desktop_photo_search/material/linux/CMakeLists.txt @@ -1,11 +1,19 @@ +# Project-level configuration. cmake_minimum_required(VERSION 3.10) project(runner 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 "desktop_photo_search") +# The unique GTK application identifier for this application. See: +# https://wiki.gnome.org/HowDoI/ChooseApplicationID set(APPLICATION_ID "com.example.desktop_photo_search") +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. cmake_policy(SET CMP0063 NEW) +# Load bundled libraries from the lib/ directory relative to the binary. set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") # Root filesystem for cross-building. @@ -18,7 +26,7 @@ if(FLUTTER_TARGET_PLATFORM_SYSROOT) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) endif() -# Configure build options. +# Define build configuration options. if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Flutter build mode" FORCE) @@ -27,6 +35,10 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) endif() # 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_14) target_compile_options(${TARGET} PRIVATE -Wall -Werror) @@ -34,9 +46,8 @@ function(APPLY_STANDARD_SETTINGS TARGET) target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") endfunction() -set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") - # Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") add_subdirectory(${FLUTTER_MANAGED_DIR}) # System-level dependencies. @@ -45,16 +56,27 @@ pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") -# Application build +# Define the application target. To change its name, change BINARY_NAME above, +# 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} "main.cc" "my_application.cc" "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" ) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. apply_standard_settings(${BINARY_NAME}) + +# Add dependency libraries. Add any application-specific dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter) target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) + +# Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) + # Only the install-generated bundle's copy of the executable will launch # correctly, since the resources must in the right relative locations. To avoid # people trying to run the unbundled copy, put it in a subdirectory instead of @@ -94,11 +116,11 @@ install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR} install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) -if(PLUGIN_BUNDLED_LIBRARIES) - install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" +foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) + install(FILES "${bundled_library}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) -endif() +endforeach(bundled_library) # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. diff --git a/desktop_photo_search/material/linux/flutter/CMakeLists.txt b/desktop_photo_search/material/linux/flutter/CMakeLists.txt index 33fd5801e..d5bd01648 100644 --- a/desktop_photo_search/material/linux/flutter/CMakeLists.txt +++ b/desktop_photo_search/material/linux/flutter/CMakeLists.txt @@ -1,3 +1,4 @@ +# This file controls Flutter-level build steps. It should not be edited. cmake_minimum_required(VERSION 3.10) set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") diff --git a/desktop_photo_search/material/linux/my_application.cc b/desktop_photo_search/material/linux/my_application.cc index 92ee84310..1bc867faf 100644 --- a/desktop_photo_search/material/linux/my_application.cc +++ b/desktop_photo_search/material/linux/my_application.cc @@ -40,11 +40,11 @@ static void my_application_activate(GApplication* application) { if (use_header_bar) { GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); gtk_widget_show(GTK_WIDGET(header_bar)); - gtk_header_bar_set_title(header_bar, "Desktop Photo Search"); + gtk_header_bar_set_title(header_bar, "desktop_photo_search"); gtk_header_bar_set_show_close_button(header_bar, TRUE); gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); } else { - gtk_window_set_title(window, "Desktop Photo Search"); + gtk_window_set_title(window, "desktop_photo_search"); } gtk_window_set_default_size(window, 1280, 720); diff --git a/desktop_photo_search/material/macos/Runner.xcodeproj/project.pbxproj b/desktop_photo_search/material/macos/Runner.xcodeproj/project.pbxproj index cb1674700..c6fc79112 100644 --- a/desktop_photo_search/material/macos/Runner.xcodeproj/project.pbxproj +++ b/desktop_photo_search/material/macos/Runner.xcodeproj/project.pbxproj @@ -26,7 +26,7 @@ 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 */; }; - 6002899F6E18B7FFE0C9EB82 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B467EF3E00BE38B76A068558 /* Pods_Runner.framework */; }; + AE9E1B8A00943278FA4ACC03 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5A1C010444168881F90C76A7 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -67,12 +67,12 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; - 7681488724F671F9825CB4FD /* 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 = ""; }; + 474DA1185735E1A2A8E435DF /* 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 = ""; }; + 5A1C010444168881F90C76A7 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; - 8A4814596EAB9B7ADDF3E8A0 /* 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 = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; - B467EF3E00BE38B76A068558 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - EE4F864883849F01384DDDFB /* 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 = ""; }; + CC5B605A81EF7B6ABDCD0FEE /* 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 = ""; }; + ECF60CEB98EC4BC59BD9AD53 /* 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 = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -80,7 +80,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6002899F6E18B7FFE0C9EB82 /* Pods_Runner.framework in Frameworks */, + AE9E1B8A00943278FA4ACC03 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -105,7 +105,7 @@ 33CEB47122A05771004F2AC0 /* Flutter */, 33CC10EE2044A3C60003C045 /* Products */, D73912EC22F37F3D000D13A0 /* Frameworks */, - F1C6C7A5568EB45EC3403989 /* Pods */, + E509AF1F032CA0C2DF5184B1 /* Pods */, ); sourceTree = ""; }; @@ -155,17 +155,17 @@ D73912EC22F37F3D000D13A0 /* Frameworks */ = { isa = PBXGroup; children = ( - B467EF3E00BE38B76A068558 /* Pods_Runner.framework */, + 5A1C010444168881F90C76A7 /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; }; - F1C6C7A5568EB45EC3403989 /* Pods */ = { + E509AF1F032CA0C2DF5184B1 /* Pods */ = { isa = PBXGroup; children = ( - EE4F864883849F01384DDDFB /* Pods-Runner.debug.xcconfig */, - 7681488724F671F9825CB4FD /* Pods-Runner.release.xcconfig */, - 8A4814596EAB9B7ADDF3E8A0 /* Pods-Runner.profile.xcconfig */, + CC5B605A81EF7B6ABDCD0FEE /* Pods-Runner.debug.xcconfig */, + 474DA1185735E1A2A8E435DF /* Pods-Runner.release.xcconfig */, + ECF60CEB98EC4BC59BD9AD53 /* Pods-Runner.profile.xcconfig */, ); name = Pods; path = Pods; @@ -178,13 +178,13 @@ isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 1CBBE64A6575E8A816E9F646 /* [CP] Check Pods Manifest.lock */, + C1324E32219C85A3F295EDBA /* [CP] Check Pods Manifest.lock */, 33CC10E92044A3C60003C045 /* Sources */, 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - 27E561F948E8861BA7C18B11 /* [CP] Embed Pods Frameworks */, + C7CCB047D7C8715D61D5AFF7 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -254,7 +254,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 1CBBE64A6575E8A816E9F646 /* [CP] Check Pods Manifest.lock */ = { + 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -262,38 +262,36 @@ 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; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; }; - 27E561F948E8861BA7C18B11 /* [CP] Embed Pods Frameworks */ = { + 33CC111E2044C6BF0003C045 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, ); - name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; - 3399D490228B24CF009A79C7 /* ShellScript */ = { + C1324E32219C85A3F295EDBA /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -301,34 +299,36 @@ 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 = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + 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; }; - 33CC111E2044C6BF0003C045 /* ShellScript */ = { + C7CCB047D7C8715D61D5AFF7 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - Flutter/ephemeral/FlutterInputs.xcfilelist, - ); - inputPaths = ( - Flutter/ephemeral/tripwire, + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - Flutter/ephemeral/FlutterOutputs.xcfilelist, - ); - outputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/desktop_photo_search/material/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/desktop_photo_search/material/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index dd5781da5..22a9bd6f2 100644 --- a/desktop_photo_search/material/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/desktop_photo_search/material/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -15,7 +15,7 @@ @@ -31,7 +31,7 @@ @@ -54,7 +54,7 @@ @@ -71,7 +71,7 @@ diff --git a/desktop_photo_search/material/macos/Runner/AppDelegate.swift b/desktop_photo_search/material/macos/Runner/AppDelegate.swift index 5f372dd3a..d53ef6437 100644 --- a/desktop_photo_search/material/macos/Runner/AppDelegate.swift +++ b/desktop_photo_search/material/macos/Runner/AppDelegate.swift @@ -1,7 +1,3 @@ -// Copyright 2019 The Flutter team. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - import Cocoa import FlutterMacOS diff --git a/desktop_photo_search/material/macos/Runner/Configs/AppInfo.xcconfig b/desktop_photo_search/material/macos/Runner/Configs/AppInfo.xcconfig index 5eb9d254a..da89cc702 100644 --- a/desktop_photo_search/material/macos/Runner/Configs/AppInfo.xcconfig +++ b/desktop_photo_search/material/macos/Runner/Configs/AppInfo.xcconfig @@ -5,10 +5,10 @@ // 'flutter create' template. // The application's name. By default this is also the title of the Flutter window. -PRODUCT_NAME = Photo Search +PRODUCT_NAME = desktop_photo_search // The application's bundle identifier PRODUCT_BUNDLE_IDENTIFIER = com.example.desktopPhotoSearch // The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2020 com.example. All rights reserved. +PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved. diff --git a/desktop_photo_search/material/macos/Runner/MainFlutterWindow.swift b/desktop_photo_search/material/macos/Runner/MainFlutterWindow.swift index e1cf22cb7..2722837ec 100644 --- a/desktop_photo_search/material/macos/Runner/MainFlutterWindow.swift +++ b/desktop_photo_search/material/macos/Runner/MainFlutterWindow.swift @@ -1,7 +1,3 @@ -// Copyright 2019 The Flutter team. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - import Cocoa import FlutterMacOS diff --git a/desktop_photo_search/material/windows/CMakeLists.txt b/desktop_photo_search/material/windows/CMakeLists.txt index 3adb3c6ad..2b0413165 100644 --- a/desktop_photo_search/material/windows/CMakeLists.txt +++ b/desktop_photo_search/material/windows/CMakeLists.txt @@ -1,13 +1,16 @@ +# Project-level configuration. cmake_minimum_required(VERSION 3.14) project(desktop_photo_search 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 "desktop_photo_search") +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. cmake_policy(SET CMP0063 NEW) -set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") - -# Configure build options. +# Define build configuration option. get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(IS_MULTICONFIG) set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" @@ -20,7 +23,7 @@ else() "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}") @@ -30,6 +33,10 @@ set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 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") @@ -38,12 +45,11 @@ function(APPLY_STANDARD_SETTINGS TARGET) target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") endfunction() -set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") - # Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") add_subdirectory(${FLUTTER_MANAGED_DIR}) -# Application build +# Application build; see runner/CMakeLists.txt. add_subdirectory("runner") # Generated plugin build rules, which manage building the plugins and adding diff --git a/desktop_photo_search/material/windows/flutter/CMakeLists.txt b/desktop_photo_search/material/windows/flutter/CMakeLists.txt index b2e4bd8d6..930d2071a 100644 --- a/desktop_photo_search/material/windows/flutter/CMakeLists.txt +++ b/desktop_photo_search/material/windows/flutter/CMakeLists.txt @@ -1,3 +1,4 @@ +# 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") diff --git a/desktop_photo_search/material/windows/runner/CMakeLists.txt b/desktop_photo_search/material/windows/runner/CMakeLists.txt index de2d8916b..b9e550fba 100644 --- a/desktop_photo_search/material/windows/runner/CMakeLists.txt +++ b/desktop_photo_search/material/windows/runner/CMakeLists.txt @@ -1,6 +1,11 @@ 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" @@ -10,8 +15,18 @@ add_executable(${BINARY_NAME} WIN32 "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}) + +# 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_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/desktop_photo_search/material/windows/runner/Runner.rc b/desktop_photo_search/material/windows/runner/Runner.rc index 8e5b48869..84c721722 100644 --- a/desktop_photo_search/material/windows/runner/Runner.rc +++ b/desktop_photo_search/material/windows/runner/Runner.rc @@ -90,10 +90,10 @@ BEGIN BLOCK "040904e4" BEGIN VALUE "CompanyName", "com.example" "\0" - VALUE "FileDescription", "A Photo Search sample app." "\0" + VALUE "FileDescription", "desktop_photo_search" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "desktop_photo_search" "\0" - VALUE "LegalCopyright", "Copyright (C) 2020 com.example. All rights reserved." "\0" + VALUE "LegalCopyright", "Copyright (C) 2022 com.example. All rights reserved." "\0" VALUE "OriginalFilename", "desktop_photo_search.exe" "\0" VALUE "ProductName", "desktop_photo_search" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" diff --git a/desktop_photo_search/material/windows/runner/main.cpp b/desktop_photo_search/material/windows/runner/main.cpp index a20675a4f..f25ead05b 100644 --- a/desktop_photo_search/material/windows/runner/main.cpp +++ b/desktop_photo_search/material/windows/runner/main.cpp @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - if (!window.CreateAndShow(L"Photo Search", origin, size)) { + if (!window.CreateAndShow(L"desktop_photo_search", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); diff --git a/desktop_photo_search/material/windows/runner/utils.cpp b/desktop_photo_search/material/windows/runner/utils.cpp index d19bdbbcc..f5bf9fa0f 100644 --- a/desktop_photo_search/material/windows/runner/utils.cpp +++ b/desktop_photo_search/material/windows/runner/utils.cpp @@ -48,10 +48,10 @@ std::string Utf8FromUtf16(const wchar_t* utf16_string) { int target_length = ::WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, -1, nullptr, 0, nullptr, nullptr); - if (target_length == 0) { - return std::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,