{"id":15932037,"url":"https://github.com/sciwhiz12/simplversion","last_synced_at":"2026-01-21T21:33:57.684Z","repository":{"id":51227335,"uuid":"519714797","full_name":"sciwhiz12/simplversion","owner":"sciwhiz12","description":"A simple Git tag-based versioning plugin","archived":false,"fork":false,"pushed_at":"2024-04-30T11:14:47.000Z","size":173,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T09:23:00.955Z","etag":null,"topics":["git","gradle-plugin","modding-inquisition","versioning"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sciwhiz12.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2022-07-31T08:04:19.000Z","updated_at":"2024-04-30T11:14:51.000Z","dependencies_parsed_at":"2024-04-30T13:09:41.785Z","dependency_job_id":null,"html_url":"https://github.com/sciwhiz12/simplversion","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/sciwhiz12/simplversion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciwhiz12%2Fsimplversion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciwhiz12%2Fsimplversion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciwhiz12%2Fsimplversion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciwhiz12%2Fsimplversion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sciwhiz12","download_url":"https://codeload.github.com/sciwhiz12/simplversion/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciwhiz12%2Fsimplversion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28644119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T21:29:11.980Z","status":"ssl_error","status_checked_at":"2026-01-21T21:24:31.872Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["git","gradle-plugin","modding-inquisition","versioning"],"created_at":"2024-10-07T01:41:23.591Z","updated_at":"2026-01-21T21:33:57.668Z","avatar_url":"https://github.com/sciwhiz12.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simplversion\n\n**simplversion** is a simple [Git][git]-based versioning plugin.\n\nThis plugin is meant for maintainer-controlled versioning -- releases are only published on tagged commits (without any\nuncommitted changes). This gives flexibility to the maintainer in making releases, as opposed to a more automated \nversioning setup which builds and publishes all commits as releases.\n\nThe version calculated by this plugin is based on Git tags, and tries its best to be compatible with the [Semantic \nVersioning  specification, v2.0.0][semver]. A notable caveat is that pre-release versions have both the pre-release \nversion and the `-SNAPSHOT` suffix in the full version.\n\n## Installation\n\nThis plugin is available [on the Gradle Plugin Portal](https://plugins.gradle.org/plugin/dev.sciwhiz12.gradle.simplversion);\nyou do not need to add an additional repository.\n\nApply the `dev.sciwhiz12.gradle.simplversion` plugin:\n```gradle\nplugins {\n    id 'dev.sciwhiz12.gradle.simplversion' version '0.2.0' // Replace version with the latest release\n}\n```\n\nConfigure the `versions` extension, and configure your project to use the version from the extension:\n```gradle\nversions {\n    // Defaults included with the plugin, do not include unless customizing\n    stripBranchPrefix = true\n    incrementPositionIfSnapshot(-2) // Second to last version: #.#.(#).#\n    skipIncrementForClassifiers('alpha', 'beta', 'pre', 'rc')\n}\n\n// Set project version\nversion = versions.version\n```\n\n_Optionally, if publishing:_ Configure the publication to use the simple version from the extension:\n```gradle\npublishing {\n    publications {\n        mavenJava { // Example publication\n            // ...\n            version = versions.simpleVersion\n\n        }\n    }\n}\n```\n\n## Configuration\n\nBy default, the following configuration options are set:\n\n- The branch name is stripped from the raw version.\n- No dirty workspace prefix is configured.\n- The second-to-last position in the raw version is incremented for snapshot versions.\n- The snapshot increment is skipped when the following classifiers (prefixed with a `-`) are found in the raw version: \n  `alpha`, `beta`, `pre`, and `rc`.\n\n  For example, `1.3.0-beta`, `2.4.6-rc2`, and `5.0.0-pre7` will not be incremented, even if it is a snapshot version.\n\nSome terms used in the plugin:\n\n- **raw version**: the version as taken from the nearest reachable tag, after stripping the branch and custom prefixes \n  and removing parts that match the stripping pattern\n- **full version** or simply **version**: the raw version and any calculated classifiers\n- **classifiers**: when part of the _raw version_, any text after the first hyphen (`-`). when part of the _full version_,\n  metadata calculated by the plugin that is separated from the raw version with a hyphen (`-`).\n\n  Classifiers currently used by the plugin are as follows:\n    - `-SNAPSHOT` - a Maven-recognized version classifier/suffix that is appended for snapshot versions\n    - `+\u003ccommit ID\u003e` - the abbreviated commit ID, separated using a plus sign as indicated in [SemVer 2.0.0][semver], when\n      not in a detached HEAD state\n    - the configured dirty workspace suffix\n\n### `versions` extension\n\nThe `versions` project-level extension configures the plugin and provides the calculated version information. The \nextension's class is `VersionExtension`, and the version information is represented by the `VersionInformation` class.\nFor additional details, consult the documented source code.\n\n### Version stripping\n\nThis plugin is configured to strip parts of the raw version based on a mix of configuration from the user and hardcoded\ndefaults. Stripping is done in four parts:\n\n- First, the **branch name prefix**, separated from the rest of the raw version with a hyphen (`-`) or forward slash (`/`),\n  is removed when the extension is configured to do so through the `stripBranchPrefix` boolean property.\n- Second, any **custom prefixes**, separated from the rest of the raw version with a hyphen (`-`) or forward slash (`/`), \n  are removed according to the `customPrefixes` string list property.\n- Third, the **stripping pattern** is matched against the raw version and any matching parts are removed, as configured\n  by the `stripPattern` regular expression pattern property.\n\n  It should be noted that only the parts matched by the pattern are removed. When creating the pattern, users should \n  take care to include any separator between the parts and the rest of the raw version. Users should also use the line \n  start boundary matcher (`^`) if they are stripping out a prefix, to ensure no accidental removals in the middle of the\n  raw version happen.\n- Fourth, the `v` prefix is removed from the raw version if present. \n\n### Positional increment\n\nSnapshot versions may be configured to increment an integer position in the raw version. This allows in-development \nversions to attempt to match to the next likely version to be released.\n\nThe `snapshotIncrementPosition` integer property (which can be set using the `incrementPositionIfSnapshot` method) \nconfigures the position to be incremented. Positions are counted by separating the raw version into parts by first \ntaking the part of the raw version before any hyphens (`-`), plus signs (`+`), or underscores (`_`), then splitting that\ninto parts based on the dot/period (`.`).\n\nFor example, the version `1.4.5.3-pre3+2` will be first cleaned up into `1.2.5.4`, and then split into four parts: `1`,\n`2`, `5`, and `3`.\n\nThe values of the property are interpreted as follows:\n- A value of zero means no increment will be done.\n- A positive value means the position starting from the beginning of the version is incremented. In the above example,\na value of `2` would mean the second position would be incremented: `2` becomes `3`.\n- A negative value means the position starting from the end of the version is incremented. In the above example, a value\nof `-2` would mean the second-to-last (third) position would be incremented: `5` becomes `6`.\n\n#### Skipping the increment\n\nThe `skipIncrement` predicate allows customizing when the above incrementing behavior is skipped for certain snapshot \nversions. The predicate is provided with a `VersionInformation` encapsulating the current version information, with the \nnotable caveat that it is not the _final_ version information, as the raw version contains the version before any \nincrement and the classifiers do not contain the `-SNAPSHOT` suffix.\n\nFor convenience, the `skipIncrementForClassifiers` method is provided to configure a predicate which skips the increment\nif any of the given classifiers (along with a `-` prepended before them) are found anywhere in the raw version. For \nexample, passing in `pre` would mean it would look for the string `-pre` in any place of the raw version.\n\n### Dirty workspace suffix\n\nThe `dirtySuffix` string property configures a suffix to be appended if the current workspace is dirty -- if there are\nany uncommitted (including untracked) changes. This may be useful in ensuring that any artifacts built from a dirty\nworkspace are appropriately marked in their filename, reducing possible confusion. For example, a dirty suffix of \n`.dirty` in a workspace on a commit tagged `1.5.0` and commit `afbc345` would result in a full version of \n`1.5.0+afbc345.dirty`.\n\n## Reading the version programmatically\n\nThe version information is available through the extension's `versionInfo` property, as a provider. The provider's value\nis calculated once on the first query to the provider , and all properties in the extension are finalized once the \nversion is calculated. For convenience, the properties available on the `VersionInformation` object are available on \nthe `VersionExtension` as well, which call the provider and retrieve the corresponding property.\n\n- `version` - the full version\n- `rawVersion` - the raw version, without any classifiers\n- `simpleVersion` - the simple version, which is composed of the raw version and the `-SNAPSHOT` classifier for a \n  snapshot version\n- `snapshot` - a boolean for whether it is a snapshot version\n- `classifiers` - the classifiers, as a string which can be appended to the raw version (forming the full version)\n- `fullCommitId` - the full SHA-1 (or SHA-256) ID of the commit, in lowercase hexadecimal\n- `abbreivatedCommitId` - the abbreviated SHA-1 (or SHA-256) ID of the commit, in lowercase hexadecimal\n  - This is unambiguous in the repository as of the time of calculation, and no guarantees are made about its minimum \n    or maximum length. However, it will almost always be considerably shorter than the full ID, and is more suitable for\n    filenames and other length-restricted names.\n- `commitTimestamp` - the timestamp of the commit, in ISO-8601 extended offset date-time format (`1970-01-01T00:00:00+00:00`)\n\n## License\n\nThis project is licensed under the MIT License. See the `LICENSE.txt` file for the full license text.\n\n[git]: https://git-scm.com/\n[semver]: https://semver.org/spec/v2.0.0.html","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsciwhiz12%2Fsimplversion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsciwhiz12%2Fsimplversion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsciwhiz12%2Fsimplversion/lists"}