From f3d22048275cb17e8322beb275f03b43cf63e6c8 Mon Sep 17 00:00:00 2001 From: Gray Mackall <34871572+gmackall@users.noreply.github.com> Date: Tue, 7 Jan 2025 10:09:49 -0800 Subject: [PATCH] [Android] Add `.cxx` directories to app template `.gitignore` (#161069) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes (but I still need to write the draft of the blog section so don't autoclose github 🙏 ) https://github.com/flutter/flutter/issues/160372. -Module templates [already exclude the entire `.android` directory](https://github.com/flutter/flutter/blob/d9b7e5664604a55a3e900b0c619ee319065abb0e/packages/flutter_tools/templates/module/common/.gitignore.tmpl#L40). -Plugin templates [already exclude `.cxx`](https://github.com/flutter/flutter/blob/d9b7e5664604a55a3e900b0c619ee319065abb0e/packages/flutter_tools/templates/plugin_shared/android.tmpl/.gitignore). Modified the existing gitignores with ``` nl=$'\n' sed -i'' -e '/GeneratedPluginRegistrant.java/a\'$'\n''.cxx/'"\\${nl}"'' $(find . -path \*android/.gitignore) ``` (which was probably not the best way) Fun fact: apparently the `.gitignore` files (including the ones we copy to the template apps) aren't indexed for search (the `.gitignore.tmpl` are, but not the ones that we copy exactly [such as this one](https://github.com/flutter/flutter/blob/27ba2f279075a9a66b48ce78d94d2999b06d6e26/packages/flutter_tools/templates/app/android.tmpl/.gitignore)). ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md --------- Co-authored-by: Gray Mackall Co-authored-by: Reid Baker Co-authored-by: Greg Price --- dev/a11y_assessments/android/.gitignore | 1 + dev/integration_tests/android_verified_input/android/.gitignore | 1 + .../deferred_components_test/android/.gitignore | 1 + dev/integration_tests/native_driver_test/android/.gitignore | 1 + dev/integration_tests/non_nullable/android/.gitignore | 1 + dev/manual_tests/android/.gitignore | 1 + dev/tracing_tests/android/.gitignore | 1 + packages/flutter_tools/templates/app/android.tmpl/.gitignore | 1 + packages/flutter_tools/templates/plugin/android.tmpl/.gitignore | 1 + packages/integration_test/android/.gitignore | 1 + packages/integration_test/example/android/.gitignore | 1 + 11 files changed, 11 insertions(+) diff --git a/dev/a11y_assessments/android/.gitignore b/dev/a11y_assessments/android/.gitignore index 6f568019d3..37277cde06 100644 --- a/dev/a11y_assessments/android/.gitignore +++ b/dev/a11y_assessments/android/.gitignore @@ -5,6 +5,7 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java +.cxx/ # Remember to never publicly share your keystore. # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app diff --git a/dev/integration_tests/android_verified_input/android/.gitignore b/dev/integration_tests/android_verified_input/android/.gitignore index 6f568019d3..37277cde06 100644 --- a/dev/integration_tests/android_verified_input/android/.gitignore +++ b/dev/integration_tests/android_verified_input/android/.gitignore @@ -5,6 +5,7 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java +.cxx/ # Remember to never publicly share your keystore. # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app diff --git a/dev/integration_tests/deferred_components_test/android/.gitignore b/dev/integration_tests/deferred_components_test/android/.gitignore index de66602df3..4a7c61fda6 100644 --- a/dev/integration_tests/deferred_components_test/android/.gitignore +++ b/dev/integration_tests/deferred_components_test/android/.gitignore @@ -5,6 +5,7 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java +.cxx/ # This app uses a test key and should not be used in a production app. # key.properties diff --git a/dev/integration_tests/native_driver_test/android/.gitignore b/dev/integration_tests/native_driver_test/android/.gitignore index 55afd919c6..be3943c96d 100644 --- a/dev/integration_tests/native_driver_test/android/.gitignore +++ b/dev/integration_tests/native_driver_test/android/.gitignore @@ -5,6 +5,7 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java +.cxx/ # Remember to never publicly share your keystore. # See https://flutter.dev/to/reference-keystore diff --git a/dev/integration_tests/non_nullable/android/.gitignore b/dev/integration_tests/non_nullable/android/.gitignore index bc2100d8f7..e2701817f8 100644 --- a/dev/integration_tests/non_nullable/android/.gitignore +++ b/dev/integration_tests/non_nullable/android/.gitignore @@ -5,3 +5,4 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java +.cxx/ diff --git a/dev/manual_tests/android/.gitignore b/dev/manual_tests/android/.gitignore index 6f568019d3..37277cde06 100644 --- a/dev/manual_tests/android/.gitignore +++ b/dev/manual_tests/android/.gitignore @@ -5,6 +5,7 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java +.cxx/ # Remember to never publicly share your keystore. # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app diff --git a/dev/tracing_tests/android/.gitignore b/dev/tracing_tests/android/.gitignore index 6f568019d3..37277cde06 100644 --- a/dev/tracing_tests/android/.gitignore +++ b/dev/tracing_tests/android/.gitignore @@ -5,6 +5,7 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java +.cxx/ # Remember to never publicly share your keystore. # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app diff --git a/packages/flutter_tools/templates/app/android.tmpl/.gitignore b/packages/flutter_tools/templates/app/android.tmpl/.gitignore index 55afd919c6..be3943c96d 100644 --- a/packages/flutter_tools/templates/app/android.tmpl/.gitignore +++ b/packages/flutter_tools/templates/app/android.tmpl/.gitignore @@ -5,6 +5,7 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java +.cxx/ # Remember to never publicly share your keystore. # See https://flutter.dev/to/reference-keystore diff --git a/packages/flutter_tools/templates/plugin/android.tmpl/.gitignore b/packages/flutter_tools/templates/plugin/android.tmpl/.gitignore index c6cbe562a4..0edc5ba028 100644 --- a/packages/flutter_tools/templates/plugin/android.tmpl/.gitignore +++ b/packages/flutter_tools/templates/plugin/android.tmpl/.gitignore @@ -6,3 +6,4 @@ .DS_Store /build /captures +.cxx/ diff --git a/packages/integration_test/android/.gitignore b/packages/integration_test/android/.gitignore index c6cbe562a4..0edc5ba028 100644 --- a/packages/integration_test/android/.gitignore +++ b/packages/integration_test/android/.gitignore @@ -6,3 +6,4 @@ .DS_Store /build /captures +.cxx/ diff --git a/packages/integration_test/example/android/.gitignore b/packages/integration_test/example/android/.gitignore index 8e599af9f2..7596838c8c 100644 --- a/packages/integration_test/example/android/.gitignore +++ b/packages/integration_test/example/android/.gitignore @@ -5,6 +5,7 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java +.cxx/ # Remember to never publicly share your keystore. # See https://flutter.dev/to/reference-keystore