{"id":13609407,"url":"https://github.com/dropbox/focus","last_synced_at":"2025-04-12T20:31:54.905Z","repository":{"id":39990775,"uuid":"456633731","full_name":"dropbox/focus","owner":"dropbox","description":"A Gradle plugin that helps you speed up builds by excluding unnecessary modules.","archived":false,"fork":false,"pushed_at":"2024-10-17T18:59:51.000Z","size":204,"stargazers_count":386,"open_issues_count":6,"forks_count":22,"subscribers_count":16,"default_branch":"main","last_synced_at":"2024-12-17T01:03:33.027Z","etag":null,"topics":["android","build","build-performance","build-tool","gradle","gradle-plugin"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dropbox.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-07T18:46:45.000Z","updated_at":"2024-11-15T01:42:15.000Z","dependencies_parsed_at":"2024-01-16T23:31:04.413Z","dependency_job_id":"b040595e-3333-42cd-8988-2e86c98abd82","html_url":"https://github.com/dropbox/focus","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Ffocus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Ffocus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Ffocus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Ffocus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dropbox","download_url":"https://codeload.github.com/dropbox/focus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248629687,"owners_count":21136295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","build","build-performance","build-tool","gradle","gradle-plugin"],"created_at":"2024-08-01T19:01:34.661Z","updated_at":"2025-04-12T20:31:54.556Z","avatar_url":"https://github.com/dropbox.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"# 🧘 Focus\n\nA Gradle plugin that generates module-specific `settings.gradle` files, allowing you to focus on a specific feature or module without needing to sync the rest of your monorepo.\n\nThe Focus plugin evaluates your project setup and creates a unique `settings.gradle` file for the module you want to focus on, which only includes the dependencies required by that module.  It then creates a `.focus` file that references the currently focused module.\n\nWith these files in place only the modules that you need will be configured by Gradle when you sync your project.  Deleting the `.focus` file, which can be done using the `clearFocus` task, will revert to using the includes file to configure your entire project.\n\n### Setup\n\nApply the plugin in your `settings.gradle` file.\n\n```groovy\n// settings.gradle(.kts)\npluginManagement {\n  repositories {\n    mavenCentral()\n    gradlePluginPortal()\n  }\n}\n\nplugins {\n  id(\"com.dropbox.focus\") version \"0.4.0\"\n}\n```\n\nNote that the plugin is currently published to Maven Central, so you need to add it to the repositories list in the `pluginsManagement` block.\n\nMove all non-required `include` statements into `settings-all.gradle`. Projects that are always included can remain in your main `settings.gradle` file.\n\n```groovy\n// settings-all.gradle(.kts)\ninclude ':sample:app2'\ninclude ':sample:lib2c'\ninclude ':sample:lib-shared'\n\ninclude ':sample:moved'\nproject(':sample:moved').projectDir = new File(\"sample/lib-moved\")\n```\n\nOptionally configure the plugin if you'd like to use different settings files than the defaults:\n\n```groovy\n// settings.gradle\nfocus {\n  // The name of the settings file\n  allSettingsFileName = \"settings-all.gradle\" // Default\n  focusFileName = \".focus\"  // Default\n}\n```\n\n```kotlin\n// settings.gradle.kts\nconfigure\u003ccom.dropbox.focus.FocusExtension\u003e {\n  // The name of the settings file\n  allSettingsFileName.set(\"settings-all.gradle\") // Default\n  focusFileName.set(\".focus\") // Default\n}\n```\n\nWhether or not you configure a custom focus file, it should be added to your `.gitignore` file as it's meant for a specific developer's workflow.\n\n## Usage\n\nThe Focus plugin adds a few tasks for you to interact with in your Gradle builds. Using these tasks you can create module specific settings files that will be automatically used by Gradle to configure only the modules which are required.\n\nFor example, say you're currently working on the app module `:sample:app2` and only need to run that module and its dependencies. You can use the following flow to reduce the number of modules that are loaded and synced into your IDE to speed up development.\n\n```shell\n# When you start work on the app2 module, bring it into focus\n./gradlew :sample:app2:focus\n\n# Click the Sync Elephant to have your IDE reload the gradle config, and you'll only have\n# :sample:app2 and it's dependencies loaded by the IDE, allowing you to build and run the sample app\n# and it's tests without having to sync the rest of the project.\n\n# If you want to spend time in a specific dependency, you can bring that into focus and sync your\n# IDE for even more fine grained development\n./gradlew :sample:lib2b:focus\n\n# When you want to clear focus and get back to the entire project, simply use the clearFocus task.\n./gradlew clearFocus\n```\n\n## Tasks\n\n### focus\n\nA `focus` task is added to all subprojects, and allows you to focus on just that module.\n\n### createFocusSettings\n\nA `createFocusSettings` task is created for each subproject, and is responsible for finding a\nmodule's dependencies and creating a module-specific settings file. This is a dependency of the\n`focus` task and likely not necessary to call on its own.\n\n### clearFocus\n\nA `clearFocus` task is added to the root project, and allows you to remove any previously focused\nmodules.\n\n## License\n\n    Copyright (c) 2022 Dropbox, Inc.\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n        http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropbox%2Ffocus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdropbox%2Ffocus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropbox%2Ffocus/lists"}