Commit graph

72 commits

Author SHA1 Message Date
stuartmorgan 57fcee28c7
Allow platform variants for Windows plugins (#82816)
Windows plugins are designed to share implementations between Win32 and
UWP, but not all plugins will support both. This adds a new
'supportedVariants' key to Windows plugins that allows specifying
'win32' and/or 'uwp' (and potentially others in the future in case that
becomes necessary).

Plugins without any supported variants will be assumed to be Win32 for
backward compatibility.

This will allow compiling Windows projects that use Win32-only Windows
plugins (which is currently all of them) in UWP mode. The plugins will
of course throw missing implementation exceptions at runtime, but tehy
won't prevent being able to build as they currently do.

Fixes https://github.com/flutter/flutter/issues/82815
2021-05-26 16:20:21 -07:00
Chris Bracken e364e30c90
[tool] Prefer installing multi-arch Win32 binaries (#82668)
Depending on the user's build configuration, we may output
multi-architecture or single-architecture binaries. Prefer to install
the multi-architecture binary if built, otherwise fall back to the
single-architecture binary.
2021-05-16 19:40:00 -07:00
Chris Bracken 7c5857d3b0
[tool] Improve Windows install process (#82659)
This eliminates the use of the Install.ps1 script during Windows app
installation and instead uses uwptool install. Install.ps1 was the
slowest part of app install, and had resource contention issues that
frequently caused it to fail.
2021-05-16 17:21:18 -07:00
Chris Bracken 14546bfad1
Support uninstall, install status query for UWP (#82481)
Adds UwpTool.install and UwpTool.uninstall methods. Refactors the
PowerShell-based install code to move the powershell-related bits out of
the Device class and into UwpTool so that when we swap out the
PowerShell-based install for the uwptool-based install, it's transparent
to the WindowsUWPDevice class.

Adds implementations for:
* WindowsUWPDevice.isAppInstalled
* WindowsUWPDevice.uninstallApp

Refactors:
* WindowsUWPDevice.installApp
2021-05-13 16:15:09 -07:00
Chris Bracken 53c2f7086b
[flutter_tools] support flutter run -d winuwp (#82373)
Allow flutter run to work end-to-end with a UWP device.

Uses win32/ffi for the actual launch of the application, injected via
the native API class. This is structured to avoid a g3 dependency.

Install and amuid require powershell scripts for now.

Actually connecting to the observatory requires running a command in an
elevated prompt. Instructions are presented to the user if a terminal is
attached.

This is a rebased version of https://github.com/flutter/flutter/pull/79684
by @jonahwilliams, updated to remove `NativeApi` and replace is with calls
to `uwptool`.

Part of https://github.com/flutter/flutter/issues/82085
2021-05-12 20:45:30 -07:00
xster ff2dde2c7f
Reland double gzip wrapping NOTICES to reduce on-disk installed space (#80897) 2021-04-26 22:35:45 -07:00
Emmanuel Garcia b0a63c4ffe
Reland the Dart plugin registry (#79669) 2021-04-23 15:34:04 -07:00
Jonah Williams 82cfa25a64
[flutter_tools] fix asset directory paths for UWP (#80984) 2021-04-22 13:35:45 -07:00
Jenn Magder a99fba01f1
Move FakeOperatingSystemUtils from context.dart to fakes.dart (#80916) 2021-04-22 10:44:02 -07:00
Jonah Williams 8663aea5e4
[flutter_tools] run UWP builds ahead of cmake (#80879) 2021-04-22 10:14:37 -07:00
Jonah Williams 5526dcc24b
[flutter_tools] generate install manifest for UWP builds (#80803) 2021-04-20 22:34:02 -07:00
Jenn Magder 56c0002c47
Adopt FakeProcessManager.empty (#80480) 2021-04-15 14:19:02 -07:00
Jenn Magder d40cc5af8f
Migrate flutter_tool plugins.dart to null safety (#80304) 2021-04-13 13:52:58 -07:00
Jonah Williams d24469374b
[flutter_tools] symlink win32 plugins as UWP plugins (#80242) 2021-04-12 16:54:10 -07:00
Jenn Magder 436ca01e14
Migrate features_tests and other tool tests to null safety (#80168) 2021-04-12 12:35:02 -07:00
Jonah Williams c5fdb82de1
[flutter_tools] treat win32 plugins as uwp plugins (#80131) 2021-04-09 13:59:20 -07:00
Jenn Magder 0f03af0101
Migrate visual_studio_test (#80088) 2021-04-08 19:14:27 -07:00
Jenn Magder ec14cef060
Migrate more tool unit tests to null safety (#80002) 2021-04-08 15:18:52 -07:00
Jenn Magder 79f1689f6a
Migrate doctor_validator to null safety (#79682) 2021-04-05 11:54:54 -07:00
Jonah Williams 3bec9c2a57
[flutter_tools] allow winuwp build to setup generated Cmake (#79676) 2021-04-02 22:44:02 -07:00
Chris Bracken 3e7e06512c
Correct misspellings throughout the codebase (#79500) 2021-04-01 10:04:03 -07:00
Jenn Magder f712fecde2
Migrate visual_studio to null safety (#78942) 2021-03-25 10:09:16 -07:00
Jonah Williams acda272cf2
[flutter_tools] add tool feature/scaffold for UWP (#77399) 2021-03-08 08:09:04 -08:00
Jonah Williams 2951363dc8
[flutter_tools] switch FakeCache to cache.test and NoopUsage to TestUsage (#76802) 2021-02-26 11:13:32 -08:00
Jenn Magder 6fec8b3679
Remove mockito from windows_device_test (#76355) 2021-02-18 19:26:02 -08:00
Jenn Magder d3c8a0bd25
Remove mocks from visual_studio_test (#76260) 2021-02-17 19:40:51 -08:00
Jonah Williams 74bd7b6f6d
[flutter_tools] opt all flutter tool libraries and tests out of null safety. (#74832)
* opt out the flutter tool

* oops EOF

* fix import

* Update tool_backend.dart

* Update daemon_client.dart

* fix more
2021-01-27 15:17:53 -08:00
Jonah Williams ddb8177018
[flutter_tools] remove globals from desktop configuration (#67146)
Refactors the desktop devices and workflow to remove unnecessary usage of global variables. This should make it easier to test and continue enhancing the desktop functionality of the tooling

#47161
2020-10-02 21:52:53 -07:00
Jenn Magder e8fbb43aac
Replace MockFile with memory file system files (#66941) 2020-09-29 17:50:33 -07:00
ekibun 719268b43a
add different workload & add -products * to vswhere calls to check both Visual Studio IDE and standalone Build Tools. (#64251) 2020-08-31 09:33:04 -07:00
stuartmorgan 4b12050112
Switch Windows to CMake (#60629)
* First pass at CMake files; untested

* First pass of adding CMake generation logic on Windows

* Misc fixes

* Get bundling working, start incoprorating CMake build into tool

* Fix debug, exe name.

* Add resources

* Move cmake.dart

* Rip out all the vcxproj/solution plumbing

* Fix plugin cmake generation

* Build with cmake rather than calling VS directly

* Adjust Windows plugin template to match standard header directory structure

* Pass config selection when building

* Partially fix multi-config handling

* Rev template version

* Share the CMake generation instead of splitting it out

* VS build/run cycle works, with slightly awkward requirement to always build all

* Update manifest

* Plugin template fixes

* Minor adjustments

* Build install as part of build command, instead of separately

* Test cleanup

* Update Linux test for adjusted generated CMake approach

* Plugin test typo fix

* Add missing stub file for project test

* Add a constant for VS generator
2020-07-06 12:59:16 -07:00
James D. Lin cf8fbc363a
[flutter tools] Revert desktop device name changes and print the category instead (#60395) 2020-06-30 11:28:02 -07:00
Jonah Williams 14992c5951
Revert "[flutter_tools] separate target platform, host platform, and architecutre (#60119)" (#60147)
This reverts commit 30d97d89e0.
2020-06-23 17:19:29 -07:00
Jonah Williams 30d97d89e0
[flutter_tools] separate target platform, host platform, and architecutre (#60119)
separate target platform, host platform, and architecture
2020-06-23 13:51:17 -07:00
James D. Lin bdbe6774a3
[flutter tools] Change the desktop device names and IDs (#58812)
In google3, the Linux device is always available, and it has confused
people who run the Flutter doctor and see
"• Linux • Linux • linux-x64 • Linux" listed.

Rename the Linux device name to "Linux desktop" and the device ID to
be "linux". Make similar changes to the Windows and macOS
devices for consistency.  This is also  consistent with the web
devices.

The device ID change shouldn't be break -d usage since that does a
case-insensitive prefix match.
2020-06-18 15:30:00 -07:00
stuartmorgan e85655c48e
Specify encoding for vswhere output (#59607)
On Windows, Process.run assumes the output uses the system codepage by default. This allows specifying it in our wrapper, and sets the encoding for vswhere to UTF-8 since we're passing a flag that forces it to use UTF-8 output.

Fixes #53515
2020-06-18 14:00:46 -07:00
Jonah Williams 4f88ed1d3c
[flutter_tools] only restrict devices based on arch + buildMode, not emulator status (#58887)
instead of restricting profile/release mode based on whether the tool thinks the device is an emulator, restrict based on the device target architecture and the requested build mode. Notably, this enables release mode on x86_64 Android emulators, but not x86 emulators since we do not support that as an AOT target.

This does not add release mode support for simulators, since this requires us to build and upload artifacts for simulator/x86_64
2020-06-08 11:20:15 -07:00
stuartmorgan 94b7ff241e
Don't require a specific Windows 10 SDK (#58713)
Current versions of the Windows desktop build files don't require a specific Windows 10 SDK version, but doctor still checks for one since vswhere doesn't allow for flexible queries. This has been a common source of issues for people setting up on Windows for the first time, because the current VS installer by default only includes a newer version of the SDK than what doctor is looking for.

This removes the vswhere SDK check, and instead uses a manual check for SDKs. Since this uses undocumented (although fairly widely used, so relatively unlikely to change) registry information, the check is non-fatal, so that builds can progress even if the SDK isn't found by doctor; in practice, it's very unlikely that someone would install the C++ Windows development workload but remove the selected-by-default SDK from the install.

Now that all requirements are default, the instructions when missing VS have been simplified so that they no longer list individual components, and instead just say to include default items.

Fixes #50487
2020-06-04 18:53:00 -07:00
Jonah Williams b19b744bb7
[flutter_tools] check for Runner.sln when parsing for plugins (#57392)
Throw a toolExit if the windows plugin logic runs on an invalid windows project. Update the supported project check to validate the existence of a Runner.sln file
2020-05-18 09:24:51 -07:00
Zachary Anderson 6f0ed5e142
[flutter_tools] Restore base/platform.dart (#56410) 2020-05-06 08:15:39 -07:00
James D. Lin 566c1d1124
flutter_tools: Prefer using .of() over .from() when possible (#55250)
Prefer using `.of()` (which is statically type-checked) over
`.from()` (which is dynamically type-checked) when possible.
2020-04-21 22:09:50 -07:00
Jenn Magder 2f216ceee5
Add timeout flag to devices command, pipe through discovery (#51678) 2020-03-16 14:15:00 -07:00
Jonah Williams ea3563ea4d
[flutter_tools] update visual studio and validator to remove globals, update test cases (#51680)
Updates VisualStudio and VisualStudioValidator to use constructors instead of global injection. Updates VisualStudio test cases to prefer FakeProcessManager
Updates build_windows test to work without injected VisualStudio
2020-03-10 16:49:23 -07:00
stuartmorgan f9c118b6b2
Exit for missing Windows plugin projects (#51838)
Exit, rather than crash, if a Windows plugin is missing its project.

Fixes #51743
2020-03-03 22:43:42 +01:00
stuartmorgan 22c807773a
Automatically add plugin projects to Windows .sln (#51246)
Adds utility code for managing list of plugin projects within a solution file, updating them as the plugins change.

This is a prototype of an approach to solution-level portion of Windows plugin tooling; it may not be what the final plugin handling on Windows uses, but it makes things much better in the short term, and gives us a baseline to evaluate other possible solution management systems against.

Part of #32719
2020-02-25 14:16:27 -08:00
stuartmorgan f4177a6dde
Generate a Property Sheet for Windows plugins (#50740)
Generates a Property Sheet for Windows builds containing link and include path
information for any included plugins. This allows automating part of the process
of integrating plugins into the build that is currently manual.

To support this change, refactored msbuild_utils into a PropertySheet class so that
it can be used to make different property sheets.
2020-02-13 12:53:28 -08:00
Alexandre Ardhuin f15c887c63
change quote to avoid escapes (#50368) 2020-02-11 20:58:27 +01:00
stuartmorgan 1be332eb8b Require Visual Studio 2019 for Windows (#48844) 2020-01-15 08:43:03 -08:00
Jonah Williams ee7a37f1d3
[flutter_tools] Ensure that global variables are easily identifiable (#47398) 2020-01-06 11:04:20 -08:00
Ian Hickson 449f4a6673
License update (#45373)
* Update project.pbxproj files to say Flutter rather than Chromium

Also, the templates now have an empty organization so that we don't cause people to give their apps a Flutter copyright.

* Update the copyright notice checker to require a standard notice on all files

* Update copyrights on Dart files. (This was a mechanical commit.)

* Fix weird license headers on Dart files that deviate from our conventions; relicense Shrine.

Some were already marked "The Flutter Authors", not clear why. Their
dates have been normalized. Some were missing the blank line after the
license. Some were randomly different in trivial ways for no apparent
reason (e.g. missing the trailing period).

* Clean up the copyrights in non-Dart files. (Manual edits.)

Also, make sure templates don't have copyrights.

* Fix some more ORGANIZATIONNAMEs
2019-11-27 15:04:02 -08:00