-
Notifications
You must be signed in to change notification settings - Fork 4.1k
feat(functions): add Cloud Functions support for Windows desktop #18471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
akshaynexus
wants to merge
7
commits into
firebase:main
Choose a base branch
from
akshaynexus:add-windows-cloud-functions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9dffa83
feat(functions,windows): implement Cloud Functions for Windows desktop
akshaynexus 4bb1b36
refactor(functions,windows): drop local Functions instance cache
akshaynexus 513838b
docs: mark Cloud Functions as supported (dev-only) on Windows
akshaynexus 79079cc
perf(functions,windows): wake the deadline thread early on completion
akshaynexus 2062242
fix(functions,windows): invoke reply callbacks outside the state mute…
akshaynexus 5c7adae
fix(core,windows): add firebase_functions to FIREBASE_RELEASE_PATH_LIBS
akshaynexus 36bc7e0
fix(ci,windows): build functions before running emulator and format D…
akshaynexus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
packages/cloud_functions/cloud_functions/windows/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| # The Flutter tooling requires that developers have a version of Visual Studio | ||
| # installed that includes CMake 3.14 or later. You should not increase this | ||
| # version, as doing so will cause the plugin to fail to compile for some | ||
| # customers of the plugin. | ||
| cmake_minimum_required(VERSION 3.14) | ||
|
|
||
| # Project-level configuration. | ||
| set(PROJECT_NAME "cloud_functions") | ||
| project(${PROJECT_NAME} LANGUAGES CXX) | ||
|
|
||
| # This value is used when generating builds using this plugin, so it must | ||
| # not be changed | ||
| set(PLUGIN_NAME "cloud_functions_plugin") | ||
|
|
||
| # Any new source files that you add to the plugin should be added here. | ||
| list(APPEND PLUGIN_SOURCES | ||
| "cloud_functions_plugin.cpp" | ||
| "cloud_functions_plugin.h" | ||
| "messages.g.cpp" | ||
| "messages.g.h" | ||
| ) | ||
|
|
||
| # Read version from pubspec.yaml | ||
| file(STRINGS "../pubspec.yaml" pubspec_content) | ||
| foreach(line ${pubspec_content}) | ||
| string(FIND ${line} "version: " has_version) | ||
|
|
||
| if("${has_version}" STREQUAL "0") | ||
| string(FIND ${line} ": " version_start_pos) | ||
| math(EXPR version_start_pos "${version_start_pos} + 2") | ||
| string(LENGTH ${line} version_end_pos) | ||
| math(EXPR len "${version_end_pos} - ${version_start_pos}") | ||
| string(SUBSTRING ${line} ${version_start_pos} ${len} PLUGIN_VERSION) | ||
| break() | ||
| endif() | ||
| endforeach(line) | ||
|
|
||
| configure_file(plugin_version.h.in ${CMAKE_BINARY_DIR}/generated/cloud_functions/plugin_version.h) | ||
| include_directories(${CMAKE_BINARY_DIR}/generated/) | ||
|
|
||
| # Define the plugin library target. Its name must not be changed (see comment | ||
| # on PLUGIN_NAME above). | ||
| add_library(${PLUGIN_NAME} STATIC | ||
| "include/cloud_functions/cloud_functions_plugin_c_api.h" | ||
| "cloud_functions_plugin_c_api.cpp" | ||
| ${PLUGIN_SOURCES} | ||
| ${CMAKE_BINARY_DIR}/generated/cloud_functions/plugin_version.h | ||
| ) | ||
|
|
||
| # Apply a standard set of build settings that are configured in the | ||
| # application-level CMakeLists.txt. This can be removed for plugins that want | ||
| # full control over build settings. | ||
| apply_standard_settings(${PLUGIN_NAME}) | ||
|
|
||
| # Symbols are hidden by default to reduce the chance of accidental conflicts | ||
| # between plugins. This should not be removed; any symbols that should be | ||
| # exported should be explicitly exported with the FLUTTER_PLUGIN_EXPORT macro. | ||
| set_target_properties(${PLUGIN_NAME} PROPERTIES | ||
| CXX_VISIBILITY_PRESET hidden) | ||
| target_compile_definitions(${PLUGIN_NAME} PUBLIC FLUTTER_PLUGIN_IMPL) | ||
| # Enable firebase-cpp-sdk's platform logging api. | ||
| target_compile_definitions(${PLUGIN_NAME} PRIVATE -DINTERNAL_EXPERIMENTAL=1) | ||
|
|
||
| # Source include directories and library dependencies. Add any plugin-specific | ||
| # dependencies here. | ||
| set(MSVC_RUNTIME_MODE MD) | ||
| set(firebase_libs firebase_core_plugin firebase_functions) | ||
| target_link_libraries(${PLUGIN_NAME} PRIVATE "${firebase_libs}") | ||
|
|
||
| target_include_directories(${PLUGIN_NAME} INTERFACE | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/include") | ||
| target_link_libraries(${PLUGIN_NAME} PUBLIC flutter flutter_wrapper_plugin) | ||
|
|
||
| # List of absolute paths to libraries that should be bundled with the plugin. | ||
| # This list could contain prebuilt libraries, or libraries created by an | ||
| # external build triggered from this build file. | ||
| set(cloud_functions_bundled_libraries | ||
| "" | ||
| PARENT_SCOPE | ||
| ) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.