Skip to content
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

Add Swift and Kotlin templates #10259

Merged
merged 10 commits into from May 24, 2017

Conversation

mravn-google
Copy link
Contributor

Go modern with

flutter create --ios-language=swift --android-language=kotlin hello
flutter create --plugin --ios-language=swift --android-language=kotlin hello

Default languages are objc and java.

@mravn-google
Copy link
Contributor Author

Fixes #7312

Copy link
Contributor

@jakobr-google jakobr-google left a comment

Choose a reason for hiding this comment

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

Generally LGTM, but could we maybe keep all the files that are identical (icons, etc.) in a common directory?

So you'd have:

ios.tmpl/ -- files shared between Obj-C and Swift templates
ios-objc.tmpl/ -- Obj-C-specific files
ios-swift.tmpl/ -- Swift-specific files

And similar for Android. I think that should work with the current code, and we'd avoid having several copies of especially the binary files.

@mit-mit
Copy link
Member

mit-mit commented May 23, 2017

I wonder if we could abbreviate to just: --swift and --kotlin. I guess that wouldn't work if someday there way a single language that both iOS and Android supported, but I don't think that is super likely to happen...

@mravn-google
Copy link
Contributor Author

@jakobr-google Yes, good point.

@mit-mit There are some minor wrinkles with the simpler --swift and --kotlin approach:

  1. As you mention, --some-great-language may at some point become a supported language on more than one platform. Perhaps not very likely now, but we may have additional platforms too.
  2. We should probably allow --objc and --java flags as well to allow people to be explicit (e.g. when posting help) and to allow scripts and test code to handle all languages uniformly.
  3. Even if not, a third language option on one platform would require us to detect and fail on inconsistencies such as flutter create --kotlin --scala hello. This cross-option consistency condition is a bit awkward to document, and likely leads to duplicated information that must be updated consistently when the language landscape changes.

All minor objections of course (on the other hand, people need to write --android-language only once per project).

@mravn-google
Copy link
Contributor Author

We might also consider abbreviated forms of the long-hand options, e.g. -al kotlin -il swift.

@mit-mit
Copy link
Member

mit-mit commented May 23, 2017

We might also consider abbreviated forms of the long-hand options, e.g. -al kotlin -il swift.

Yes, that sounds like a great compromise!

@mravn-google
Copy link
Contributor Author

Oh, no. We are not allowed to have two-letter abbreviations.

@mravn-google
Copy link
Contributor Author

flutter create          -i swift -a kotlin hello
flutter create --plugin -i swift -a kotlin hello

Copy link
Member

@mit-mit mit-mit left a comment

Choose a reason for hiding this comment

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

Love it, thanks so much!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants