{"id":18556387,"url":"https://github.com/splitties/gradle-dependencies-dsl","last_synced_at":"2025-04-10T00:31:10.804Z","repository":{"id":212738406,"uuid":"732191263","full_name":"Splitties/gradle-dependencies-dsl","owner":"Splitties","description":"More concise dependencies declaration for Gradle projects. Avoid repeating implementation, api, etc.","archived":false,"fork":false,"pushed_at":"2024-02-18T19:54:42.000Z","size":62,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-02-18T22:23:24.514Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Splitties.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-12-15T22:03:20.000Z","updated_at":"2024-01-02T14:20:33.000Z","dependencies_parsed_at":"2023-12-15T23:56:51.139Z","dependency_job_id":"45cf8a22-7742-4dd0-8d35-4bb36899b4e2","html_url":"https://github.com/Splitties/gradle-dependencies-dsl","commit_stats":null,"previous_names":["splitties/gradle-dependencies-dsl"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Splitties%2Fgradle-dependencies-dsl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Splitties%2Fgradle-dependencies-dsl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Splitties%2Fgradle-dependencies-dsl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Splitties%2Fgradle-dependencies-dsl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Splitties","download_url":"https://codeload.github.com/Splitties/gradle-dependencies-dsl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223418633,"owners_count":17142178,"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":[],"created_at":"2024-11-06T21:30:16.337Z","updated_at":"2024-11-06T21:30:17.368Z","avatar_url":"https://github.com/Splitties.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dependencies DSL for Gradle projects\n\nInstead of repeating `implementation` or `api` countless times in your Gradle build scripts,\nyou can use this DSL to write it just once per set of dependencies.\n\n## Before\n\n`api`, `implementation`, and `testImplementation` are repeated, adding unwanted noise.\n\n```kotlin\ndependencies {\n    api(\"com.example.whatever:what-you-need:x.x.x\")\n    api(libs.coolFramework) // From version catalog\n    api(KotlinX.coroutines) // From refreshVersions built-in dependency notations\n    implementation(libs.something) // From version catalog\n    implementation(libs.stuff) // From version catalog\n    implementation(\"com.example.whatever:yet-another-thing:x.x.x\")\n    implementation(\"com.example.whatever:your-favorite-library:x.x.x\")\n    implementation(\"com.example.whatever:utils-of-course:x.x.x\")\n    testImplementation(Kotlin.test.junit)\n    testImplementation(Testing.kotest.assertions.core)\n    testImplementation(KotlinX.coroutines.test)\n}\n```\n\n## After\n\nStraight to the dependency notations, minimal noise!\n\n```kotlin\ndependencies {\n    api {\n        \"com.example.whatever:what-you-need:x.x.x\"()\n        libs.coolFramework()\n        KotlinX.coroutines()\n    }\n    implementation {\n        libs.something()\n        libs.stuff()\n        \"com.example.whatever:yet-another-thing:x.x.x\"()\n        \"com.example.whatever:your-favorite-library:x.x.x\"()\n        \"com.example.whatever:utils-of-course:x.x.x\"()\n    }\n    testImplementation {\n        Kotlin.test.junit()\n        Testing.kotest.assertions.core()\n        KotlinX.coroutines.test()\n    }\n}\n```\n\n## Important\n\nDon't forget to add the parentheses to the dependency notations or it won't work!\n\n## Extra features\n\n### Arbitrary configurations support\n\nWe support custom or less-standard configurations as well:\n\n```kotlin\ndependencies {\n    this(\"anotherConfiguration\") {\n        libs.something()\n    }\n}\n```\n\n### Convenient exclude overload\n\nYou can put a plain dependency notation into exclude, which can be especially handy when using refreshVersions:\n\n```kotlin\nAndroidX.wear.remoteInteractions {\n    //TODO: Remove when https://issuetracker.google.com/issues/275580742 is fixed.\n    exclude(KotlinX.coroutines.guava)\n}\n```\n\n## How to add to your project\n\nGo in the `settings.gradle.kts` file, located at the root of your Gradle project.\n\nAdd the following line into the `plugins { … }` block (add one at the top of the file it there's none):\n\n```gradle.kts\nid(\"org.splitties.dependencies-dsl\") version \"0.2.0\"\n```\n\nIt can also work if you add it in the `build.gradle.kts` file of the module you want to try this DSL in.\n\n## License\n\nThis library is published under Apache License version 2.0 which you can see [here](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsplitties%2Fgradle-dependencies-dsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsplitties%2Fgradle-dependencies-dsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsplitties%2Fgradle-dependencies-dsl/lists"}