{"id":19146664,"url":"https://github.com/tslamic/versioning","last_synced_at":"2025-05-07T02:04:36.625Z","repository":{"id":69301902,"uuid":"142743011","full_name":"tslamic/versioning","owner":"tslamic","description":"Gradle plugin to ease versioning on Android.","archived":false,"fork":false,"pushed_at":"2018-11-11T23:24:40.000Z","size":78,"stargazers_count":52,"open_issues_count":1,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-07T02:04:32.331Z","etag":null,"topics":["android","git","gradle","gradle-plugin","version-manager","versioning"],"latest_commit_sha":null,"homepage":"https://plugins.gradle.org/plugin/me.tadej.versioning","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tslamic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-07-29T08:17:21.000Z","updated_at":"2023-09-08T17:43:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"8902d003-82b3-4456-84d8-4ceaf8403ad3","html_url":"https://github.com/tslamic/versioning","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tslamic%2Fversioning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tslamic%2Fversioning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tslamic%2Fversioning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tslamic%2Fversioning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tslamic","download_url":"https://codeload.github.com/tslamic/versioning/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252798852,"owners_count":21805886,"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","git","gradle","gradle-plugin","version-manager","versioning"],"created_at":"2024-11-09T07:47:39.680Z","updated_at":"2025-05-07T02:04:36.600Z","avatar_url":"https://github.com/tslamic.png","language":"Kotlin","readme":"[![Build Status](https://travis-ci.org/tslamic/versioning.svg?branch=master)](https://travis-ci.org/tslamic/versioning)\n[![codecov](https://codecov.io/gh/tslamic/versioning/branch/master/graph/badge.svg)](https://codecov.io/gh/tslamic/versioning)\n\n# Versioning \n\nA Grade plugin that makes versioning easier:\n\n```groovy\nandroid {\n  defaultConfig {\n    versionCode versioning.versionCode() // e.g. 42\n    versionName versioning.versionName() // e.g. 1.0.0\n  }\n}\n```\n\nThe only prerequisite is using Git as your VCS.\n\n## How to use it\n\nBuild script snippet for plugins DSL for Gradle 2.1 and later:\n\n```groovy\nplugins {\n  id \"me.tadej.versioning\" version \"0.2.0\"\n}\n```\n\nBuild script snippet for use in older Gradle versions or where dynamic configuration is required:\n\n```groovy\nbuildscript {\n  repositories {\n    maven {\n      url \"https://plugins.gradle.org/m2/\"\n    }\n  }\n  dependencies {\n    classpath \"gradle.plugin.me.tadej:versioning:0.2.0\"\n  }\n}\n\napply plugin: \"me.tadej.versioning\"\n```\n\n## How does it work?\n\nThe plugin assumes you use [tags](https://git-scm.com/book/en/v2/Git-Basics-Tagging) to mark your releases. The version name corresponds to the git command:\n\n```shell\n$ git describe --tags --dirty --always\n```\n\nThe version code is simply the number of commits:\n\n```shell\n$ git rev-list --count HEAD\n```\n\n## Examples\n\n Assume you're executing the commands below in sequential order.\n\n```shell\n$ git commit -a -m \"First commit.\"\n```\n\n| Op | Result |\n| -- | ------ |\n`versioning.versionCode()` | 1\n`versioning.versionName()` | \"3db5953\"\n\n```shell\n$ git tag -a 0.1.0 -m \"First tag.\"\n```\n\n| Op | Result |\n| -- | ------ |\n`versioning.versionCode()` | 1\n`versioning.versionName()` | \"0.1.0\"\n\n```shell\n$ git commit -a -m \"Second commit.\"\n```\n\n| Op | Result |\n| -- | ------ |\n`versioning.versionCode()` | 2\n`versioning.versionName()` | \"0.1.0-1-g3db5953\"\n\n```shell\n$ echo \"Hi, mom!\" \u003e hi.txt \u0026\u0026 git add hi.txt\n```\n\n| Op | Result |\n| -- | ------ |\n`versioning.versionCode()` | 2\n`versioning.versionName()` | \"0.1.0-1-g3db5953-dirty\"\n\n```shell\n$ git commit -m \"Third commit.\"\n```\n\n| Op | Result |\n| -- | ------ |\n`versioning.versionCode()` | 3\n`versioning.versionName()` | \"0.1.0-2-g3cbf60f\"\n\n```shell\n$ git tag 0.1.1\n```\n\n| Op | Result |\n| -- | ------ |\n`versioning.versionCode()` | 3\n`versioning.versionName()` | \"0.1.1\"\n\n## Decorators\n\nYou can tweak the version name and/or version code:\n\n```groovy\nversioning {\n  decorateVersionCode { code -\u003e code * 1000 }\n  decorateVersionName { name -\u003e \"$name-SNAPSHOT\" }\n}\n```\n\n## License\n\n    Copyright 2018 Tadej Slamic\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","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftslamic%2Fversioning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftslamic%2Fversioning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftslamic%2Fversioning/lists"}