Skip to content

Update the flutter create -t plugin document to reflect changes related to --platforms#4344

Merged
sfshaza2 merged 3 commits intoflutter:masterfrom
cyanglaz:patch-5
Jul 21, 2020
Merged

Update the flutter create -t plugin document to reflect changes related to --platforms#4344
sfshaza2 merged 3 commits intoflutter:masterfrom
cyanglaz:patch-5

Conversation

@cyanglaz
Copy link
Contributor

@cyanglaz cyanglaz commented Jul 15, 2020

Update the document to reflect changes in flutter/flutter#59507

Fixes flutter/flutter#61405

Update the document to reflect changes in flutter/flutter#59507
@googlebot googlebot added the cla: yes Contributor has signed the Contributor License Agreement label Jul 15, 2020
@cyanglaz cyanglaz requested review from jmagman and sfshaza2 July 15, 2020 17:42
Copy link
Contributor

@sfshaza2 sfshaza2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few things.

To create a plugin package, use the `--template=plugin`
flag with `flutter create`.

Starting from flutter 1.20.0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

=> As of Flutter 1.20.0, use...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Starting from flutter 1.20.0:
Use the `--platforms` option to specify all the platforms that the plugin
supports. Available platforms are: android, ios, web, linux, macos and windos.
If no platforms are specified, a plugin project supports no platforms will be created.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

=> If no platforms are specified, the resulting project doesn't support any platforms.

Really? This seems like a bug. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Haha, it is intended. We don't want the user to accidentally create a plugin project supporting platforms that they don't want to support. We wanted to make it more explicit.

```
```terminal
$ flutter create --template=plugin -a java hello
$ flutter create --template=plugin --platforms=android,ios -a java hello
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, ALL of these examples use Android and iOS. Could we mix it up a bit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By reading the paragraph above, I thought these examples are to teach users to choose programming languages for android and iOS. So in that case, we should only use Android and iOS here.
However, we can add some examples to the above paragraph that explains the --platforms flag. Those examples can have different platforms just to explain the flag. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Yeah, that's what I get for just looking at the trees, not the forest.


### Add support to new platforms in an existing plugin project

To support new platforms in an existing plugin project, run `flutter create` with
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

=> To add support for specific platforms to an existing ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor Author

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmagman @sfshaza2 Thanks for the quick review, I updated the PR per your comments. PTAL.

To create a plugin package, use the `--template=plugin`
flag with `flutter create`.

Starting from flutter 1.20.0:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Starting from flutter 1.20.0:
Use the `--platforms` option to specify all the platforms that the plugin
supports. Available platforms are: android, ios, web, linux, macos and windos.
If no platforms are specified, a plugin project supports no platforms will be created.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Haha, it is intended. We don't want the user to accidentally create a plugin project supporting platforms that they don't want to support. We wanted to make it more explicit.

```
```terminal
$ flutter create --template=plugin -a java hello
$ flutter create --template=plugin --platforms=android,ios -a java hello
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By reading the paragraph above, I thought these examples are to teach users to choose programming languages for android and iOS. So in that case, we should only use Android and iOS here.
However, we can add some examples to the above paragraph that explains the --platforms flag. Those examples can have different platforms just to explain the flag. WDYT?


### Add support to new platforms in an existing plugin project

To support new platforms in an existing plugin project, run `flutter create` with
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nit once @sfshaza2 is happy.

supports. Available platforms are: android, ios, web, linux, macos and windos.
If no platforms are specified, a plugin project supports no platforms will be created.
As of Flutter 1.20.0, Use the `--platforms=` option followed by a comma separated list to
specify the platforms that the plugin supports. Available platforms are: android, ios, web, linux, macos, and windows.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we put the platforms in ticks so people know they are exact strings?
android, ios, web, linux, macos, and windows.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

@sfshaza2 sfshaza2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

```
```terminal
$ flutter create --org com.example --template=plugin -a java hello
$ flutter create --org com.example --template=plugin --platforms=android,ios -a java hello
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just making sure. It's -a java hello but -i objc hello?

```
```terminal
$ flutter create --template=plugin -a java hello
$ flutter create --template=plugin --platforms=android,ios -a java hello
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Yeah, that's what I get for just looking at the trees, not the forest.

@sfshaza2 sfshaza2 merged commit 5f5f475 into flutter:master Jul 21, 2020
filiph pushed a commit to filiph/website that referenced this pull request Feb 22, 2021
…ated to `--platforms` (flutter#4344)

* Update developing-packages.md

Update the document to reflect changes in flutter/flutter#59507

* Update developing-packages.md

Review

* Update developing-packages.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Contributor has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The plug-in project does not have an Android directory

4 participants