flutter/packages/flutter_tools/lib/src
Greg Spencer 21a32fdd0c
Fixes the project detection logic when creating new projects over existing directories. (#22744)
This all happened because I was trying to be a little too helpful...

Part of the job of the "create" command is to recreate missing pieces of existing projects, and now that the default has changed, I wanted to make it so that if someone had created a default flutter create project before, that they could run a default flutter create there again, and not have it trashed by using the new default template (application) over the old one (app).

This meant I had to detect what type of project it was. Unfortunately, in the past we didn't write anything in the .metadata file to identify the type of project, and since the goal was regenerating missing files, I can't count on anything existing, so it's just a heuristic match.

This simplifies the heuristics down to just detecting the difference between "app" and "application" projects, and only detect the other types if they're explicitly listed in the .metadata file (I changed the code in my original PR to add the project type to the .metadata file). People used to have to specify the type for those anyhow, so it shouldn't be a surprise to users.

So, the main difference in the new heuristics from my last attempt is that if you have a directory that has some other stuff it (like maybe a "plugin" project), then we'll recreate (pronounced "mess up") the project using the "application" template, but that was true before (except it would use the "app" template).

Fixes #22726
2018-10-05 15:49:53 -07:00
..
android Split Android license checks into their own subvalidator (#22446) 2018-10-05 08:45:16 -07:00
base apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00
commands Fixes the project detection logic when creating new projects over existing directories. (#22744) 2018-10-05 15:49:53 -07:00
dart Revert "Use mixin syntax for Flutter's super-mixins (#22435)" (#22748) 2018-10-05 15:09:38 -07:00
fuchsia apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00
intellij sort_constructors_first (#22575) 2018-10-04 07:28:07 +02:00
ios apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00
runner apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00
test apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00
tester apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00
vscode sort_constructors_first (#22575) 2018-10-04 07:28:07 +02:00
application_package.dart sort_constructors_first (#22575) 2018-10-04 07:28:07 +02:00
artifacts.dart sort_constructors_first (#22575) 2018-10-04 07:28:07 +02:00
asset.dart sort_constructors_first (#22575) 2018-10-04 07:28:07 +02:00
build_info.dart Implement build flow for hot updates on Android (#22391) 2018-09-28 13:58:37 -07:00
bundle.dart add missing type parameter on methods (#22096) 2018-10-01 21:29:08 +02:00
cache.dart apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00
compile.dart sort_constructors_first (#22575) 2018-10-04 07:28:07 +02:00
context_runner.dart Split Android license checks into their own subvalidator (#22446) 2018-10-05 08:45:16 -07:00
crash_reporting.dart apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00
dependency_checker.dart sort_constructors_first (#22575) 2018-10-04 07:28:07 +02:00
devfs.dart apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00
device.dart apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00
disabled_usage.dart apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00
doctor.dart Split Android license checks into their own subvalidator (#22446) 2018-10-05 08:45:16 -07:00
emulator.dart sort_constructors_first (#22575) 2018-10-04 07:28:07 +02:00
flutter_manifest.dart Rename module --> application in flutter create command. (#22565) 2018-10-04 13:03:20 -07:00
globals.dart Added more extensive ANSI color printing support on terminals. (#20958) 2018-09-19 15:22:43 -07:00
plugins.dart Rename module --> application in flutter create command. (#22565) 2018-10-04 13:03:20 -07:00
project.dart Rename module --> application in flutter create command. (#22565) 2018-10-04 13:03:20 -07:00
protocol_discovery.dart apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00
resident_runner.dart apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00
run_cold.dart apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00
run_hot.dart Do not continue a hot restart if _restartFromSources fails (#22645) 2018-10-05 13:48:41 -07:00
services.dart apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00
template.dart Unnecessary new (#20138) 2018-09-12 08:29:29 +02:00
tracing.dart apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00
usage.dart apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00
version.dart apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00
vmservice_record_replay.dart apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00
vmservice.dart apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00