From ebe6774ff4ffba24a0b9e75b3f52b280877f3e27 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Sat, 2 Mar 2024 12:29:28 +0530 Subject: [PATCH] Allow developers to customize their VSCode configuration For folks who're using the git integration from within VSCode, the top level directory needs to be open in VSCode for using git GUI from VSCode. However, for using the Run & debug configurations they need to open ente/mobile is opened in VSCode. As a solution - gitignore .vscode - provide sample VSCode configuration files is mobile/docs/vscode and auth/docs/vscode - mention it in the README (will update the auth README later, have to do a few more changes to it first) --- .gitignore | 4 ++ auth/.gitignore | 5 -- auth/.vscode/extensions.json | 9 ---- auth/.vscode/launch.json | 46 ------------------- auth/docs/vscode/extensions.json | 9 ++++ auth/docs/vscode/launch.json | 46 +++++++++++++++++++ auth/{.vscode => docs/vscode}/settings.json | 0 mobile/.gitignore | 6 +-- mobile/README.md | 4 ++ .../vscode/launch.json} | 39 ++++++++-------- .../vscode/settings.json} | 2 +- 11 files changed, 83 insertions(+), 87 deletions(-) delete mode 100644 auth/.vscode/extensions.json delete mode 100644 auth/.vscode/launch.json create mode 100644 auth/docs/vscode/extensions.json create mode 100644 auth/docs/vscode/launch.json rename auth/{.vscode => docs/vscode}/settings.json (100%) rename mobile/{.vscode/launch.json.example => docs/vscode/launch.json} (60%) rename mobile/{.vscode/settings.json.example => docs/vscode/settings.json} (96%) diff --git a/.gitignore b/.gitignore index e43b0f988..35ef93d42 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,5 @@ +# Let folks use their custom .vscode settings +.vscode + +# macOS .DS_Store diff --git a/auth/.gitignore b/auth/.gitignore index 23840740b..b909f8341 100644 --- a/auth/.gitignore +++ b/auth/.gitignore @@ -15,11 +15,6 @@ *.iws .idea/ -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -#.vscode/ - # Flutter/Dart/Pub related **/doc/api/ .dart_tool/ diff --git a/auth/.vscode/extensions.json b/auth/.vscode/extensions.json deleted file mode 100644 index 03e0c3b73..000000000 --- a/auth/.vscode/extensions.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=827846 - // for the documentation about the extensions.json format - "recommendations": [ - "dart-code.dart-code", - "dart-code.flutter", - "felixangelov.bloc" - ] -} diff --git a/auth/.vscode/launch.json b/auth/.vscode/launch.json deleted file mode 100644 index 1384f5dde..000000000 --- a/auth/.vscode/launch.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "name": "Local", - "request": "launch", - "type": "dart", - "flutterMode": "debug", - "program": "lib/main.dart", - "args": ["--dart-define", "endpoint=http://localhost:8080"] - }, - { - "name": "Android Dev", - "request": "launch", - "type": "dart", - "program": "lib/main.dart", - "args": [ - "--dart-define", - "endpoint=http://192.168.1.3:8080", - "--flavor", - "independent" - ] - }, - { - "name": "iOS Dev", - "request": "launch", - "type": "dart", - "program": "lib/main.dart", - "args": ["--dart-define", "endpoint=http://192.168.1.30:8080"] - }, - { - "name": "iOS Prod", - "request": "launch", - "type": "dart", - "program": "lib/main.dart", - "args": ["--target", "lib/main.dart"] - }, - { - "name": "Android Prod", - "request": "launch", - "type": "dart", - "program": "lib/main.dart", - "args": ["--target", "lib/main.dart", "--flavor", "independent"] - } - ] -} diff --git a/auth/docs/vscode/extensions.json b/auth/docs/vscode/extensions.json new file mode 100644 index 000000000..e8e851920 --- /dev/null +++ b/auth/docs/vscode/extensions.json @@ -0,0 +1,9 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "dart-code.dart-code", + "dart-code.flutter", + "felixangelov.bloc" + ] +} diff --git a/auth/docs/vscode/launch.json b/auth/docs/vscode/launch.json new file mode 100644 index 000000000..9ad997058 --- /dev/null +++ b/auth/docs/vscode/launch.json @@ -0,0 +1,46 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Auth Local", + "request": "launch", + "type": "dart", + "flutterMode": "debug", + "program": "lib/main.dart", + "args": ["--dart-define", "endpoint=http://localhost:8080"] + }, + { + "name": "Auth Android Dev", + "request": "launch", + "type": "dart", + "program": "lib/main.dart", + "args": [ + "--dart-define", + "endpoint=http://192.168.1.3:8080", + "--flavor", + "independent" + ] + }, + { + "name": "Auth iOS Dev", + "request": "launch", + "type": "dart", + "program": "lib/main.dart", + "args": ["--dart-define", "endpoint=http://192.168.1.30:8080"] + }, + { + "name": "Auth iOS Prod", + "request": "launch", + "type": "dart", + "program": "lib/main.dart", + "args": ["--target", "lib/main.dart"] + }, + { + "name": "Auth Android Prod", + "request": "launch", + "type": "dart", + "program": "lib/main.dart", + "args": ["--target", "lib/main.dart", "--flavor", "independent"] + } + ] +} diff --git a/auth/.vscode/settings.json b/auth/docs/vscode/settings.json similarity index 100% rename from auth/.vscode/settings.json rename to auth/docs/vscode/settings.json diff --git a/mobile/.gitignore b/mobile/.gitignore index 3a331414f..40821c9c1 100644 --- a/mobile/.gitignore +++ b/mobile/.gitignore @@ -15,10 +15,6 @@ *.iws .idea/ -#Visual Studio Code related -.vscode/launch.json -.vscode/settings.json - # Flutter/Dart/Pub related **/doc/api/ .dart_tool/ @@ -42,4 +38,4 @@ android/app/.settings/* fastlane/report.xml -TensorFlowLiteC.framework \ No newline at end of file +TensorFlowLiteC.framework diff --git a/mobile/README.md b/mobile/README.md index 8661baf41..a770d1d16 100644 --- a/mobile/README.md +++ b/mobile/README.md @@ -68,6 +68,10 @@ You can alternatively install the build from PlayStore or F-Droid. Some common issues and troubleshooting tips are in [docs/dev](docs/dev.md). +If you're using VSCode, you might find it useful to create a top level `.vscode` +(it will be gitignored) and add relevant sample configuration files from +[docs/vscode](docs/vscode). + ## 🏙️ Attributions City coordinates from [Simple Maps](https://simplemaps.com/data/world-cities) diff --git a/mobile/.vscode/launch.json.example b/mobile/docs/vscode/launch.json similarity index 60% rename from mobile/.vscode/launch.json.example rename to mobile/docs/vscode/launch.json index 1e6b9ae6f..437d6ac30 100644 --- a/mobile/.vscode/launch.json.example +++ b/mobile/docs/vscode/launch.json @@ -5,50 +5,47 @@ "version": "0.2.0", "configurations": [ { - "name": "Android Prod", + "name": "Photos Android Prod", "request": "launch", "type": "dart", "flutterMode": "debug", - "program": "lib/main.dart", - "args": [ - "--flavor", - "independent" - ] + "program": "mobile/lib/main.dart", + "args": ["--flavor", "independent"] }, { - "name": "Android Local", + "name": "Photos Android Local", "request": "launch", "type": "dart", "flutterMode": "debug", - "program": "lib/main.dart", + "program": "mobile/lib/main.dart", "args": [ "--flavor", "independent", "--dart-define", "endpoint=http://localhost:8080", "--dart-define", - "web-family=http://localhost:3003", + "web-family=http://localhost:3003" ] }, { - "name": "iOS Prod", + "name": "Photos iOS Prod", "request": "launch", "type": "dart", "flutterMode": "debug", - "program": "lib/main.dart" + "program": "mobile/lib/main.dart" }, { - "name": "iOS Local", + "name": "Photos iOS Local", "request": "launch", "type": "dart", "flutterMode": "debug", - "program": "lib/main.dart", - "args": [ - "--dart-define", - "endpoint=http://localhost:8080", - "--dart-define", - "web-family=http://localhost:3003" - ] - }, + "program": "mobile/lib/main.dart", + "args": [ + "--dart-define", + "endpoint=http://localhost:8080", + "--dart-define", + "web-family=http://localhost:3003" + ] + } ] -} \ No newline at end of file +} diff --git a/mobile/.vscode/settings.json.example b/mobile/docs/vscode/settings.json similarity index 96% rename from mobile/.vscode/settings.json.example rename to mobile/docs/vscode/settings.json index 54c04225f..b6a9a3c02 100644 --- a/mobile/.vscode/settings.json.example +++ b/mobile/docs/vscode/settings.json @@ -1,3 +1,3 @@ { "dart.flutterSdkPath": "thirdparty/flutter/bin" -} \ No newline at end of file +}