Open navaronbracke opened 2 months ago
Question: I'm not sure if the **/ glob pattern is for add-to-app use cases?
This is very much possible. Try out flutter create hello_world --template=module
and then take a look at the .android
and .ios
directory.
This might be a legitimate issue report—it would be nice to make sure the logic behind splitting things up into different .gitignore
s is consistent. However, I'm guessing the risk/reward ratio of fixing this is not very good. cc @jmagman and @reidbaker in case they have differing opinions.
I think the risk in new project creation is low but so is the priority. I would leave this open and marked as a p3.
It would probably take someone sitting down and doing an audit, organizing it, and maybe adding some comments at the top describing what should go where. We could consider reorganizing for just newly created projects, or doing a more complete, but potentially risky, project migration like https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/migrations/swift_package_manager_gitignore_migration.dart
I would leave this open and marked as a p3.
I agree, reopening.
Use case
Users creating a new Flutter project that want to benefit from the starting gitignore.
Proposal
Currently when creating a new Flutter project, most of the Android & iOS specific things are split off into their own gitignores in the Android & iOS directories.
However, this isn't the case for all the rules.
For iOS, we still define
**/ios/Flutter/.last_build_id
in the root gitignore at https://github.com/flutter/flutter/blob/master/packages/flutter_tools/templates/app_shared/.gitignore.tmpl#L28For Android, we still define
at the bottom of the same template.
We should probably move these gitignore lines into their Android / iOS specific counterparts.
Steps to reproduce:
flutter create sample
cd sample && cat .gitignore
ios
andandroid
folders are still present in rules in that fileQuestion: I'm not sure if the
**/
glob pattern is for add-to-app use cases?Flutter Doctor
```console [✓] Flutter (Channel stable, 3.24.1, on macOS 14.6.1 23G93 darwin-x64, locale en-BE) • Flutter version 3.24.1 on channel stable at /Users/navaronbracke/Documents/flutter • Upstream repository git@github.com:navaronbracke/flutter.git • FLUTTER_GIT_URL = git@github.com:navaronbracke/flutter.git • Framework revision 5874a72aa4 (6 days ago), 2024-08-20 16:46:00 -0500 • Engine revision c9b9d5780d • Dart version 3.5.1 • DevTools version 2.37.2 [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/navaronbracke/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • ANDROID_HOME = /Users/navaronbracke/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.4) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15F31d • CocoaPods version 1.15.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2023.3) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160) [✓] VS Code (version 1.92.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.94.0 [✓] Connected device (2 available) • macOS (desktop) • macos • darwin-x64 • macOS 14.6.1 23G93 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 128.0.6613.85 [✓] Network resources • All expected network resources are available. • No issues found! ```