{"id":22144875,"url":"https://github.com/hndrs/gradle-git-properties-plugin","last_synced_at":"2025-10-12T13:30:46.810Z","repository":{"id":168798969,"uuid":"643506214","full_name":"hndrs/gradle-git-properties-plugin","owner":"hndrs","description":"Gradle Git Properties Plugin with configuration-cache support","archived":false,"fork":false,"pushed_at":"2023-05-28T16:21:57.000Z","size":116,"stargazers_count":13,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-19T03:34:04.717Z","etag":null,"topics":["configuration-cache","git","gradle","gradle-build","gradle-cache","gradle-configurations","gradle-kotlin","gradle-plugin","kotlin","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hndrs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"publiccode":null,"codemeta":null}},"created_at":"2023-05-21T11:37:46.000Z","updated_at":"2024-10-07T07:41:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"62d7c9e2-0f2c-4ede-b86f-9284fa0d5a44","html_url":"https://github.com/hndrs/gradle-git-properties-plugin","commit_stats":null,"previous_names":["hndrs/gradle-git-properties-plugin"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hndrs%2Fgradle-git-properties-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hndrs%2Fgradle-git-properties-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hndrs%2Fgradle-git-properties-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hndrs%2Fgradle-git-properties-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hndrs","download_url":"https://codeload.github.com/hndrs/gradle-git-properties-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236220525,"owners_count":19114340,"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":["configuration-cache","git","gradle","gradle-build","gradle-cache","gradle-configurations","gradle-kotlin","gradle-plugin","kotlin","spring-boot"],"created_at":"2024-12-01T22:34:40.583Z","updated_at":"2025-10-12T13:30:41.515Z","avatar_url":"https://github.com/hndrs.png","language":"Kotlin","funding_links":["https://github.com/sponsors/marvinschramm"],"categories":[],"sub_categories":[],"readme":"[![Maven metadata URL](https://img.shields.io/maven-metadata/v?color=green\u0026label=GRADLE%20PLUGIN\u0026metadataUrl=https%3A%2F%2Fplugins.gradle.org%2Fm2%2Fio%2Fhndrs%2Fgit-properties%2Fio.hndrs.git-properties.gradle.plugin%2Fmaven-metadata.xml\u0026style=for-the-badge)](https://plugins.gradle.org/plugin/io.hndrs.git-properties)\n[![Coverage](https://img.shields.io/sonar/coverage/hndrs_gradle-git-properties-plugin?server=https%3A%2F%2Fsonarcloud.io\u0026style=for-the-badge)](https://sonarcloud.io/dashboard?id=hndrs_gradle-git-properties-plugin)\n[![Supported Java Version](https://img.shields.io/badge/Supported%20Java%20Version-17%2B-informational?style=for-the-badge)]()\n[![Sponsor](https://img.shields.io/static/v1?logo=GitHub\u0026label=Sponsor\u0026message=%E2%9D%A4\u0026color=ff69b4\u0026style=for-the-badge)](https://github.com/sponsors/marvinschramm)\n\n# Gradle Git Properties\n\nThis is a simple gradle plugin that can generate git properties via a `generateGitProperties` task.\nIf you ask yourself \"Why? there is already plugins out there that do this.\". You are right!\n\nThis plugin was build specifically with the purpose of supporting\ngradles [configuration-cache](https://docs.gradle.org/8.1.1/userguide/configuration_cache.html) feature.\nIf you don`t need this functionality, you might choose a more mature plugin.\n\n### Using the Plugin\n\nAdd the following dependency to your plugin block\n\n```kotlin\nplugins {\n    id(\"io.hndrs.git-properties\") version \"1.0.0\"\n}\n```\n\n### GenerateProperties Task\n\nThe Plugin registers a ```generateGitProperties``` task to the project.\nIf the project includes the Gradle-Java-Plugin the `generateGitProperties` task will be attached to the\n`classes` lifecycle task if the java plugin is present\n\n### Default Configuration\n\nWhen the task is not configured\n\n- it is assumed that a `.git` folder is present in the root of the project.\n- the build will fail when an error occurs during the properties generation unless the `--continue-on-error` option is\n  provided\n- the output file is `resources/main/git.properties`\n\nThe task can be configured the following way if the defaults are not applicable:\n\n```kotlin\nimport io.hndrs.gradle.plugin.git.properties.GenerateGitPropertiesTask\n\ntasks.withType(GenerateGitPropertiesTask::class.java) {\n    dotGitDirectory.set(File(\".git\"))\n    continueOnError.set(false)\n    output.set(File(\"resources/main/git.properties\"))\n}\n```\n\n\u003e File (build.gradle.kts)\n\n### Behaviour on CI environments\n\nAs you may know, CI environments handle the git repository differently and probably only checkout detached HEADs\nThis plugin handles the branch resolution for\n\n- Github Actions\n- Gitlab CI\n- Travis CI\n\nIf you are using a different CI service you can provide the branch name via the `branch-name` option\n\n```bash\n./gradlew generateGitProperties --branch-name=$CI_SPECIFIC_ENV\n```\n\n#### Available Properties\n\n```properties\ngit.branch=main\ngit.build.host=localHost\ngit.build.user.email=john.smith@gradlemail.com\ngit.build.user.name=John Smith\ngit.commit.id=e2f8a7bb72036e7a7a03ba243ca0414914cdfa82\ngit.commit.id.abbrev=e2f8a7b\ngit.commit.message.full=Merge pull request #1 from hndrs/prepare-initial-release\\n\\nPreparation of first release. Covers important cache test cases and cleans up code\ngit.commit.message.short=Merge pull request #1 from hndrs/prepare-initial-release\ngit.commit.signed=true\ngit.commit.time=2023-05-24T21:42:38Z\ngit.commit.user.email=john.smith@gradlemail.com\ngit.commit.user.name=John Smith\ngit.remote.origin.url=git@github.com:hndrs/gradle-git-properties-plugin.git\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhndrs%2Fgradle-git-properties-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhndrs%2Fgradle-git-properties-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhndrs%2Fgradle-git-properties-plugin/lists"}