Commit Graph

143 Commits

Author SHA1 Message Date
Greg Spencer
6b8ceb9472
Make the create command call pub get online instead of offline. (#13505)
We thought it would be OK to call the create command offline-only, but it turns out that isn't a great idea because not all of the create template dependencies are cached by running flutter_tool.

This PR makes it go online by default when running pub get after creating a project, and adds an "--offline" flag to the create command so that offline users can use it offline if their cache is warm.
2017-12-11 21:21:41 -08:00
Greg Spencer
aedee0df3d
Make create command use pub in offline mode. (#13462)
In order to allow offline usage of the create command we need to be able to tell pub not to try and contact the server to see if new versions are available. Since all the versions that create could want are pinned, it shouldn't need to check for new versions.
2017-12-08 15:32:10 -08:00
Kevin Moore
64feb95ada
Revert "(cleanup) standardize on shouldRunPub and usesPubOptions() in commands (#13427)" (#13430)
This reverts commit 9315a79b11.

There is an unfortunate interaction with verifyThenRunCommand
2017-12-07 14:29:12 -08:00
Kevin Moore
9315a79b11
(cleanup) standardize on shouldRunPub and usesPubOptions() in commands (#13427) 2017-12-07 13:31:32 -08:00
Kevin Moore
13a6d40f90
flutter_tools: ensure the context value passed to pub is consistent (#13366)
Adds a class `PubContext` with a fixed set of allowed values
Make it clear these values should not be changed casually

Fixed one inconsistency already: update_packages vs update_pkgs
Provide more information for verify calls
Eliminate `ctx_` prefix.
2017-12-06 08:10:56 -08:00
Kevin Moore
c25608d83b
Provide more information in PUB_ENVIRONMENT for pub get/upgrade (#13307)
* Provide more information in PUB_ENVIRONMENT for `pub get/upgrade`

Should help diagnose and fix https://github.com/dart-lang/pub-dartlang-dart/issues/636
2017-12-01 16:20:06 -08:00
Phil Quitslund
a4bc470fa5
Tweak access to linter internals in package validation. (#13297)
A more future-proof approach to accessing internal package name lint rule description details.

See: https://github.com/dart-lang/linter/issues/654
2017-12-01 10:54:24 -08:00
Alexander Aprelev
4447c0aaf3 Add --preview-dart-2 option support for ios builds (#13251) 2017-11-29 18:11:34 -08:00
xster
c17099f474
Leave a version tag when creating project (#12846)
* Leave a version tag when creating project

* Generalize .version to .metadata
2017-11-03 10:07:57 -07:00
Yegor
89a4a1384c unpin linter version, skip the broken 0.1.37 version (#12737) 2017-10-26 12:39:07 -07:00
Yegor
7f0d4f4caa Revert "fix --force-upgrade script; upgrade to the latest package versions (#12700)" (#12729)
This reverts commit 5b3575006e.
2017-10-25 17:08:08 -07:00
Yegor
5b3575006e fix --force-upgrade script; upgrade to the latest package versions (#12700)
* fix updrade script; upgrade to the latest package versions

* exclude special dependencies from transitive closure

* fix stack trace handling in flutter_test due to stack_trace change

* change type on _emptyStackTrace
2017-10-25 16:12:43 -07:00
Alexandre Ardhuin
1fce14a31c enable lint prefer_single_quotes (#12665) 2017-10-22 18:11:36 +02:00
stevemessick
b9f20dc335 Print "package" instead of "plugin" when creating a package. (#12387) 2017-10-03 16:06:33 -07:00
Ian Hickson
efb45ea788 Trivial nit fixes (#12285) 2017-09-27 16:13:48 -07:00
gspencergoog
267514346a Remove legacy --plugin option from flutter create (#12020)
Removed the legacy --plugin option from flutter create.  Fixes #11815.
2017-09-11 10:01:07 -07:00
Michael Thomsen
41378e2032 Break long line in flutter create help output (#11756) 2017-08-23 13:13:26 -07:00
Jakob Andersen
5d0d6126a1 Add --template=<type> option to create command. (#11105)
Allows the user to specify the kind of project to create. The default is 'app'. Other choices are 'plugin' (the old '--plugin' behavior), and 'package'.

A Flutter 'package' is a Dart package that depends on Flutter, but does not contain native code.

Fixes #10377.
2017-08-23 13:29:31 +02:00
Mikkel Nygaard Ravn
9496e6dfa7 Support for app flavors in flutter tooling, #11676 retake (#11734) 2017-08-23 10:55:35 +02:00
Mikkel Nygaard Ravn
7c3a45dc6e Revert "Support for app flavors in flutter tooling (#11676)" (#11729)
This reverts commit 8d07d3f652.
2017-08-22 12:24:29 +02:00
Mikkel Nygaard Ravn
8d07d3f652 Support for app flavors in flutter tooling (#11676) 2017-08-22 10:38:23 +02:00
Mikkel Nygaard Ravn
c5999c74c0 Add gradle wrapper to project template (#10928) 2017-06-26 12:47:43 +02:00
Ian Hickson
0f1a703a6b More documentation (#10589) 2017-06-08 17:13:03 -07:00
Todd Volkert
078b380d51 Remove underscores from Android identifier during flutter create (#10506)
Fixes #10077
2017-06-05 11:25:46 -07:00
Mikkel Nygaard Ravn
251d83a4b5 Add org option to flutter create (#10290) 2017-05-24 16:19:16 +02:00
Mikkel Nygaard Ravn
10f6483003 Add Swift and Kotlin templates (#10259) 2017-05-24 08:22:50 +02:00
Michael Goderbauer
fdbb1fbbc7 Add a note about how to edit platform code in IDE to flutter create --plugin (#10189) 2017-05-18 18:18:51 -07:00
Michael Goderbauer
ca4d7211b0 Enforce valid package names on flutter create (#9854)
* Enforce valid package names on flutter create

Fixes #9564

* refactor

* fix other tests
2017-05-08 14:08:59 -07:00
Michael Goderbauer
6337a0553c Don't crash on flutter create . on Windows (#9850)
* Don't crash on `flutter create .`

Fixes #9828

* review comments
2017-05-05 15:47:13 -07:00
Jakob Andersen
6b54137a15 Improve Android builds. (#9801)
Eagerly generate local.properties, and always update the flutter.sdk
setting in it, in case FLUTTER_ROOT has changed.

Fixes #8365.
Fixes #9716 - at least the specific issue reported. My Android Studio
still complains about Gradle versions - it ships with v3.2, but requires
v3.3...

Add a 'generate dependencies' task to the Gradle build, which checks if
the snapshot dependencies file exists, and runs an extra build before
the actual FlutterTask if it doesn't. This makes the first build slower,
but sub-sequent builds (without source changes) much faster.

Fixes #9717.
2017-05-05 14:53:51 +02:00
xster
837f101056 Let (almost) all flutter create CocoaPods references be dynamically generated later (#9791)
* Remove all initial cocoapod traces from flutter create except Podfile

* Make updateXcodeGeneratedProperties parameters named

* review notes
2017-05-04 12:26:58 -07:00
Brian Slesinsky
cc3b91479c flutter create: don't use relative paths in IDEA config files (#9414)
When invoked from the command line, relative paths aren't typically
used, but they are when invoked from within IDEA and prevents
IDEA from reading the files.

Also, remove flutterPackagesDirectory since it's not used
2017-04-16 13:58:08 -07:00
Brian Slesinsky
5cb9097965 flutter create: enable Java support in IDEA (#9335)
Generates an android.iml file and a package-level library for flutter.jar.

Does not set up an Android SDK in IDEA; this isn't possible with a
template-based approach. But IDEA shows a clear warning, so the
user can fix this by setting the SDK.

(When creating a Flutter project from within IDEA, we can fix this up
afterwards in the plugin.)
2017-04-14 10:12:48 -07:00
Jakob Andersen
7ffa82aaf0 Inject plugin registration. (#9216)
Added a PluginRegistry to the new project template. The registry files will be automatically updated at build time to register the native plugins.

Fixes #7814.
2017-04-10 15:44:19 +02:00
Jakob Andersen
f34f8a3197 Add template for plugin projects. (#9076)
Plugin projects are created by running `flutter create --plugin <name>`.

An example app is also created in the plugin project, using the normal 'create' template, which has been modified to allow for conditional plugin code.

Modified the android package name to match package naming conventions (all lower-case, and must match the directory name).
2017-03-30 12:39:21 +02:00
Chris Bracken
7a09316cd0 Declare locals final where not reassigned (flutter_tools) (#8570) 2017-03-03 17:50:46 -08:00
Chris Bracken
43650e93f4 Emit additional Xcode settings in flutter create (#8125)
On flutter run, we update ios/Flutter/Generated.xcconfig with various
Flutter-specific settings required by xcode_backend.sh during a build
from Xcode. These settings need to be present at the time the project is
loaded since Xcode doesn't pick up live updates to these files.

Without these settings, Xcode fails to locate xcode_backend.sh itself,
causing the build to fail until the Xcode project has been closed and
re-opened. This also prevents Xcode's project updater from 'helpfully'
suggesting to clean up and delete the Generated.xcconfig file.
2017-02-14 09:56:57 -08:00
Michael Goderbauer
5e54fd54d9 Ban package:path from Flutter Tools (#8119) 2017-02-13 17:45:50 -08:00
Todd Volkert
8bb270342e Update flutter_tools to use package:file throughout (#7385)
This removes direct file access from within flutter_tools
in favor of using `package:file` via a `FileSystem` that's
accessed via the `ApplicationContext`.

This lays the groundwork for us to be able to easily swap
out the underlying file system when running Flutter tools,
which will be used to provide a record/replay file system,
analogous to what we have for process invocations.
2017-01-06 16:51:44 -08:00
John McCutchan
0b737ac57b Remove default AppContext and cleanup globals (#6999) 2016-11-29 07:54:20 -08:00
Dan Rubel
34e466f1fd Refactor flutter command exit code - part 3 of 3 (#6838)
* Remove the workaround that pinned args to v0.13.6
This reverts most of the changes in commit 6331b6c8b5
* throw exception if exit code is not an integer
* rework command infrastructure to throw ToolExit when non-zero exitCode
* convert commands to return Future<Null>
* cleanup remaining commands to use throwToolExit for non-zero exit code
* remove isUnusual exception message
* add type annotations for updated args package
2016-11-14 14:21:30 -05:00
Dan Rubel
cccd917ac2 Refactor flutter command exit code - part 1 (#6803)
* convert flutter commands to use ToolExit for non-zero exit code
* add convenience method throwToolExit
* print ToolExit message iff not null
2016-11-11 10:42:09 -05:00
Adam Barth
67f591000f Mentions flutter packages get rather than pub get (#6625)
Fixes #6417
2016-11-01 13:27:06 -07:00
Adam Barth
030f623a84 Prevent flutter create from running inside SDK (#6587)
Fixes #6480
2016-10-28 20:29:19 -07:00
Dan Rubel
949e27ae8f improve flutter create error message (#6525) 2016-10-26 19:11:55 +01:00
Devon Carew
f1d70fcdd3 create intellij metadata from flutter create (#6429) 2016-10-20 12:03:38 -07:00
Ian Hickson
71e05ff8f2 Clarify output of flutter create (#6305)
Previously it implied that you had to always say lib/main.dart in the "flutter run" command.
2016-10-13 21:21:59 -04:00
Dan Rubel
cd65b7902c switch to package:mustache (#6273) 2016-10-11 17:44:12 -04:00
Devon Carew
95fa9e3c55 Less chatty (#6213)
* make flutter create less chatty

* output generated file count; mention lib/main.dart
2016-10-05 08:26:17 -07:00
Dan Rubel
1821238279 Refactor flutter command execution (#5892)
* refactor _run to runCmd

* replace requiresProjectRoot getter with call to commandValidator

* replace requiresDevice getter with call to findTargetDevice

* trace command requires a debug connection, not a device

* inline androidOnly getter

* rename command methods to verifyTheRunCmd and runCmd

* move common verification into BuildSubCommand

* rename deviceForCommand to device

* rename methods to verifyThenRunCommand and runCommand
2016-09-16 09:13:35 -04:00
Dan Rubel
023b7de11f show device list in flutter doctor output (#5697)
* show device list in flutter doctor output
fixes https://github.com/flutter/flutter/issues/5625
2016-09-01 17:55:16 -04:00
Devon Carew
4962656b1d remove old command aliases (#4103) 2016-05-23 12:06:49 -07:00
Jason Simmons
32846de9f8 Remove ArtifactStore and move flutterRoot into Cache (#3883) 2016-05-12 15:54:35 -07:00
Todd Volkert
43c0c52225 Fix regexp that strips invalid characters from the Uniform Type Identifier
Fixes #3835
2016-05-10 13:08:29 -07:00
Devon Carew
adac927501 add google analytics to flutter_tools (#3523)
* add google analytics

* send in the run target type

* track device type targets

* use the real GA code

* review comments

* rev to usage 2.0

* rev to 2.2.0 of usage; add tests

* review comments
2016-04-26 16:25:11 -07:00
Devon Carew
80fabfd3dd allow flutter create to re-gen over an existing project (#3419)
* allow flutter create to re-gen over an existing project

* add a regression test
2016-04-19 19:30:49 -07:00
stevemessick
8847b86681 Add validity checks to create (#3215)
* Add validity checks to create

* Adjust indent
2016-04-08 20:37:50 -07:00
Adam Barth
412ce9d295 Add flutter precache (#3207)
This command explicitly populates the flutter tool's cache of binary artifacts.
Also, teach `flutter create` to update the cache in case its the first command
that a user runs.
2016-04-08 08:51:44 -07:00
Ian Hickson
a7016062bc Improve flutter create help text. 2016-03-20 20:06:30 -07:00
Hixie
797e27edd3 Add @override annotations to flutter framework 2016-03-14 14:02:26 -07:00
Ian Hickson
bedd8e9131 Merge pull request #2650 from Hixie/always_always_specify_types
Even more types
2016-03-14 10:44:05 -07:00
Devon Carew
d0afabc358 change the description of the drive command 2016-03-14 09:48:02 -07:00
Ian Hickson
d745e20853 Even more types 2016-03-14 09:41:54 -07:00
Devon Carew
93b31a41df fix flutter create 2016-03-04 18:56:26 -08:00
Devon Carew
c1caa26989 fix a mac test 2016-03-04 13:10:51 -08:00
Devon Carew
4c569195f1 clean the project names used for flutter create 2016-03-02 12:36:37 -08:00
Devon Carew
ebf1ecc5bd valdate project names in create 2016-03-01 11:03:59 -08:00
Devon Carew
4860e63f44 Merge pull request #2153 from devoncarew/add_android_icon
add an android icon to the starter app
2016-02-25 00:40:49 -08:00
Devon Carew
5ee1cba149 fix a regression in the android manifest 2016-02-24 23:40:00 -08:00
Devon Carew
f57afa762f add an android icon to the starter app 2016-02-24 23:12:33 -08:00
Devon Carew
bc8e560779 run flutter doctor as part of create 2016-02-24 19:07:19 -08:00
Chinmay Garde
038367ad24 Remove all inline templates and provide a way to specify templates as resources 2016-02-24 11:33:07 -08:00
Collin Jackson
8ab9a8fe03 Remove redundant Material from project created by flutter create 2016-02-23 11:29:55 -08:00
yjbanov
278630e688 "flutter create" can generate a basic driver test
"flutter create" adds option `--with-driver-test` that adds
dependencies to `flutter_driver` in `pubspec.yaml` and creates
a basic driver test runnable via `flutter drive
--target=test_driver/e2e.dart`

"flutter drive" new options:

- `--keep-app-running` tells the driver to not stop the app after tests
  are done
- `--use-existing-app` tells the driver to not start a new app but use
  an already running instance
2016-02-22 17:10:31 -08:00
Adam Barth
ec0ec75b26 Improve the style in the starter app
Fixes #2011
2016-02-20 15:48:55 -08:00
Chinmay Garde
5658640128 Fix lint errors 2016-02-19 13:34:16 -08:00
Chinmay Garde
f6a2477dce Always generate legal UTIs for project identifiers. 2016-02-19 12:30:18 -08:00
Devon Carew
0da7463ef0 make the '-o' option in create optional 2016-02-18 14:33:59 -08:00
Devon Carew
d5a6fceee5 add a summary option to the doctor class 2016-02-17 09:33:45 -08:00
Chinmay Garde
c2f5044099 Refactor: Rename initialize_xcode.dart to setup_xcodeproj.dart 2016-02-16 15:35:59 -08:00
Chinmay Garde
5cebf70da4 flutter start initializes the Xcode project if the user has not already done so. 2016-02-16 15:18:47 -08:00
Adam Barth
cf8116368d flutter run should run pub get automatically
This removes a step that can cause trouble.

Fixes #1904
2016-02-16 11:16:34 -08:00
Devon Carew
b7b06c2a27 fixes found when running through the getting started process 2016-02-15 14:06:23 -08:00
Devon Carew
8baf7694cb update gitignore and analysis_options 2016-02-12 13:13:05 -08:00
Adam Barth
2a1b0f6c22 Merge pull request #1793 from abarth/version_code
Add versionCode and versionName to default Android manifest
2016-02-11 20:11:35 -08:00
Adam Barth
0ae17bc3b3 Add versionCode and versionName to default Android manifest
These are required to upload to the store.

Fixes #1006
2016-02-11 19:43:39 -08:00
Devon Carew
de8d11e714 rename the apk/ directory to android/ 2016-02-11 13:28:24 -08:00
Devon Carew
2dbceafbc6 introduce globals scoped to the app's context 2016-02-09 22:03:13 -08:00
Devon Carew
427bc1e392 ignore derived resources in ios/build 2016-02-09 15:41:45 -08:00
Collin Jackson
9ec12824aa Make flutter create generate a manifest that is similar to SkyShell.apk, fixes #1587 2016-02-08 11:11:25 -08:00
Devon Carew
a4b0c3d584 make the output from create more terse 2016-01-28 15:18:25 -08:00
Devon Carew
d7fbf5302d use status(), error(), and trace() for logging
rename to printTrace(), printStatus(), and printError()
2016-01-28 12:44:17 -08:00
Devon Carew
76d069f9c0 rename the init command to create 2016-01-27 14:37:29 -08:00