{"id":18696534,"url":"https://github.com/offrange/git-semver-gradle-plugin","last_synced_at":"2026-02-14T17:31:08.389Z","repository":{"id":241507161,"uuid":"805398300","full_name":"OffRange/git-semver-gradle-plugin","owner":"OffRange","description":"A Gradle plugin that automatically versions your project based on Git tags, following the Semantic Versioning 2.0 specification.","archived":false,"fork":false,"pushed_at":"2024-08-13T10:36:41.000Z","size":137,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"0.2.x","last_synced_at":"2025-09-08T04:45:21.186Z","etag":null,"topics":["gradle","gradle-plugin","semantic-versioning","semver","versioning-plugin"],"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/OffRange.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,"publiccode":null,"codemeta":null}},"created_at":"2024-05-24T13:41:24.000Z","updated_at":"2024-09-02T02:42:59.000Z","dependencies_parsed_at":"2024-05-28T20:41:29.341Z","dependency_job_id":"0955290b-c10b-44c8-b605-566721109361","html_url":"https://github.com/OffRange/git-semver-gradle-plugin","commit_stats":null,"previous_names":["offrange/git-semver-gradle-plugin"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/OffRange/git-semver-gradle-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OffRange%2Fgit-semver-gradle-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OffRange%2Fgit-semver-gradle-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OffRange%2Fgit-semver-gradle-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OffRange%2Fgit-semver-gradle-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OffRange","download_url":"https://codeload.github.com/OffRange/git-semver-gradle-plugin/tar.gz/refs/heads/0.2.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OffRange%2Fgit-semver-gradle-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29450874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["gradle","gradle-plugin","semantic-versioning","semver","versioning-plugin"],"created_at":"2024-11-07T11:19:22.655Z","updated_at":"2026-02-14T17:31:08.371Z","avatar_url":"https://github.com/OffRange.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git Semantic Versioning Gradle Plugin\n\nThis Gradle plugin leverages Git to manage project versioning, adhering to semantic versioning principles. It provides\nseveral customization options, especially useful for development and debugging purposes.\n\n## Getting Started\n\nAdd the plugin to your `build.gradle.kts` file:\n\n```kotlin\nplugins {\n    id(\"io.github.offrange.git-semantic-versioning\")\n}\n```\n\n## Usage\n\n### Development Version Customizations\n\n\u003e [!NOTE]\n\u003e Customization options like `defaultIncrement` and `channel` are intended for development versions where no Git tag has\n\u003e been set yet. These customizations help in displaying the correct version during development and debugging.\n\n\u003e [!NOTE]\n\u003e An active Git tag on the latest commit will always override these custom modifications.\n\n#### Pre-Release Channels\n\nFor instance, if you've published a beta version `1.0.0-beta.1` and are working on a release candidate, set the channel\nto `Channel.RC` to ensure the version updates to `1.0.0-rc\u003c+build-metadata\u003e`.\n\n```kotlin\nversioning {\n    channel = Channel.RC\n}\n```\n\n#### Incrementing Version Parts\n\nIf the release channel of the last version (determined by the latest git tag) and the `channel` property of the\nextension is `Channel.STABLE` , or if the release channel of the last version\nis newer than the release channel defined in the extension, the version is incremented by a strategy defined by\nthe `defaultIncrement` property\n\n```kotlin\nversioning {\n    defaultIncrement = Inc.MINOR\n}\n```\n\n#### Incrementing Version Parts\n\nThe `defaultIncrement` property is used to define which part of the version should be incremented under certain\nconditions. Specifically, this property comes into play when:\n\n1. The current git tag indicates that the project's version is stable, and there has been at least one commit since this\n   tag. If the `channel` property is also set to `Channel.STABLE`, it implies that a new version is required.\n   The `defaultIncrement` property will determine which version part (e.g., major, minor, or patch) should be\n   incremented.\n\n2. The release channel defined by the `channel` property is set to a \"more unstable\" version than the release channel of\n   the current/latest git tag version. For example, if the latest git tag is \"1.0.0-rc.2\" and the `channel` parameter is\n   set to `Channel.BETA`, the version will be incremented to \"1.1.0-beta.1\" (see the configuration below).\n\nHere is how you can set the `defaultIncrement` property in your `versioning` configuration:\n\n```kotlin\nversioning {\n    defaultIncrement = Inc.MINOR\n}\n```\n\n#### Full Commit Hash in Version Names\n\nIf you prefer including the full commit hash in the version name, set the `useShortHash` property to `false`.\n\n```kotlin\nversioning {\n    useShortHash = false\n}\n```\n\n### Custom Version Code Generator\n\nFor Android projects, a default version code generator is provided. If you need a custom generator, specify it like\nthis:\n\n```kotlin\nversioning {\n    versionCodeGenerator = { version -\u003e\n        computeUIntVersionCode(version)\n    }\n}\n```\n\n### Applying the Plugin to Android Projects\n\nTo use this plugin for versioning your Android app, follow these steps:\n\n1. Apply the plugin in your `build.gradle.kts` or `build.gradle` file as described in the Getting Started section.\n2. Remove or comment out the `versionName` and `versionCode` properties in the `defaultConfig` block within\n   the `application` extension.\n3. Apply the generated versioning source set `build/generated/versioning/kotlin` to your build.gradle.kts file.\n4. Apply `android versionedBy versioning` to the root of your build.gradle.kts file\n5. Apply `build/generated/versioning/kotlin` to your source set\n6. Add `io.github.z4kn4fein:semver:2.0.0` dependency\n\n```kotlin\nandroid versionedBy versioning\nandroid {\n    defaultConfig {\n        applicationId = \"com.example.app\"\n        minSdk = libs.versions.android.minSdk.get().toInt()\n        targetSdk = libs.versions.android.compileSdk.get().toInt()\n        // versionName = \"1.0.0\"\n        // versionCode = 1\n\n        testInstrumentationRunner = \"androidx.test.runner.AndroidJUnitRunner\"\n\n        vectorDrawables {\n            useSupportLibrary = true\n        }\n    }\n\n    sourceSets.getByName(\"main\") {\n        kotlin.srcDir(\"build/generated/versioning/kotlin\")\n    }\n}\n\ndependencies {\n    implementation(\"io.github.z4kn4fein:semver:2.0.0\")\n}\n```\n\nThe plugin will automatically set the appropriate version name and version code based on the Git tags.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffrange%2Fgit-semver-gradle-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foffrange%2Fgit-semver-gradle-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffrange%2Fgit-semver-gradle-plugin/lists"}