{"id":13428734,"url":"https://github.com/rock3r/deep-clean","last_synced_at":"2025-04-13T00:46:16.400Z","repository":{"id":48838765,"uuid":"136323126","full_name":"rock3r/deep-clean","owner":"rock3r","description":"When Gradle or the IDE let you down, just --nuke all them caches","archived":false,"fork":false,"pushed_at":"2022-09-30T15:06:52.000Z","size":72,"stargazers_count":942,"open_issues_count":3,"forks_count":42,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-13T00:46:11.986Z","etag":null,"topics":["android","androidstudio","gradle","idea","kotlin","kotlin-script","script"],"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/rock3r.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["rock3r"]}},"created_at":"2018-06-06T12:06:34.000Z","updated_at":"2025-03-30T01:38:47.000Z","dependencies_parsed_at":"2023-01-18T20:45:18.722Z","dependency_job_id":null,"html_url":"https://github.com/rock3r/deep-clean","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rock3r%2Fdeep-clean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rock3r%2Fdeep-clean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rock3r%2Fdeep-clean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rock3r%2Fdeep-clean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rock3r","download_url":"https://codeload.github.com/rock3r/deep-clean/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650432,"owners_count":21139672,"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","androidstudio","gradle","idea","kotlin","kotlin-script","script"],"created_at":"2024-07-31T01:01:03.777Z","updated_at":"2025-04-13T00:46:16.380Z","avatar_url":"https://github.com/rock3r.png","language":"Kotlin","funding_links":["https://github.com/sponsors/rock3r"],"categories":["Libraries"],"sub_categories":[],"readme":"# deep-clean\nA Kotlin script that nukes all build caches from Gradle/Android projects.\nUseful when Gradle or the IDE let you down 💔\n\n![deep-clean in action](https://user-images.githubusercontent.com/153802/41173653-ab0ae36c-6b4f-11e8-8f98-8dba4340add7.png)\n\n🎩 h/t to [@Takhion](https://github.com/Takhion) for the original idea, and to\n[@holgerbrandl](https://github.com/holgerbrandl) for KScript.\n\nThe script has been tested on macOS 🍎, but it is completely untested on\nLinux 🐧 and Windows 🖥️. KScript may not work at all on Windows!\n\n⚠️There may be [major issues](https://github.com/rock3r/deep-clean/issues/4) on Windows/Linux when using `-n`,\nplease let me know if you encounter any such issue!\n\n**USE AT YOUR OWN RISK IN ANY CASE!**\n\n## Running the script\n\n`deep-clean` requires three components to be on your `PATH`:\n * [`kotlinc`](https://kotlinlang.org/docs/tutorials/command-line.html)\n * [`kscript`](https://github.com/holgerbrandl/kscript)\n * [`mvn`](https://maven.apache.org/)\n\nIf you **have all three commands** on your `PATH`, then you can simply download\nand execute the script:\n\n```bash\n$ cd /your/project/root.folder\n$ [kscript] deep-clean.kts [options]\n```\n\n\u003eNote: on macOS and Linux the script does not need `kscript` to be invoked, because\n\u003eit has a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)). On Windows, you\n\u003ewill need to explicitly specify you want to use `kscript` to run it.\n\nWhere the options are:\n\n```\n-b --backup           Renames files and folders instead of deleting them. Implies\n                      --verbose.\n-d --dry-run          Don't delete anything. Useful for testing. Implies --verbose.\n-i --ide-files        This also deletes IDEA/Android Studio project files (*.iml).\n                      If used in conjunction with --nuke it will also delete the\n                      .idea folder in the current directory.\n-p --ide-preferences  ⚠️  THIS IS DANGEROUS SHIT ⚠️  Will wipe your IDE settings!\n                      This deletes the GLOBAL IDEA/Android Studio preferences.\n                      This option requires the --nuke option to be active too, since\n                      it touches global system state.\n--not-recursive       Don't recursively search sub-folders of this folder for matches.\n                      The default behaviour is to look for matches in sub-directories,\n                      since things like 'build' folders and '.iml' files are not all\n                      found at the top level of a project directory structure. This\n                      flag is useful if you know you have matches you want to keep,\n                      e.g., if your code contains a package with a name like 'build'.\n                      This option severely limits the effectiveness of the deep clean.\n-n --nuke             ⚠️  THIS IS DANGEROUS SHIT ⚠️  Super-deep clean\n                      This includes clearing out global folders, including:\n                       * the global Gradle cache\n                       * the global Maven artefacts\n                       * the wrapper-downloaded Gradle distros\n                       * the Gradle daemon data (logs, locks, etc.)\n                       * the Android build cache\n                      Nukes the entire thing from orbit — it's the only way to be sure.\n-v --verbose          Print detailed information about all commands.\n```\n\nFor this script to work, you need to have `kotlin`, `kscript` and `maven` on your `PATH`.\nIf you **DON'T have all three commands** on your `PATH`, then read on to the next\nsection to install them.\n\n## Installing the script dependencies\n\nTo make the script run, we'll first need to install all the required dependencies.\nAll dependencies are available on [SDKMan!](https://sdkman.io/) (Windows, Linux, macOS).\n**Note that KScript support for Windows is not officially available yet**.\n\n```bash\n$ sdk install kotlin\n$ sdk install maven\n$ sdk install kscript\n```\n\n## Licence\n\n```\nCopyright 2022 Sebastiano Poggi\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n\nFor more information please refer to the [`LICENSE`](LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frock3r%2Fdeep-clean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frock3r%2Fdeep-clean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frock3r%2Fdeep-clean/lists"}