{"id":17136592,"url":"https://github.com/joan38/mill-git","last_synced_at":"2025-03-22T18:33:30.844Z","repository":{"id":44807695,"uuid":"258657108","full_name":"joan38/mill-git","owner":"joan38","description":"A git version plugin for Mill build tool","archived":false,"fork":false,"pushed_at":"2024-10-14T13:37:28.000Z","size":49,"stargazers_count":6,"open_issues_count":4,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-22T04:47:56.750Z","etag":null,"topics":["mill-module","mill-plugin","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/joan38.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2020-04-25T00:52:18.000Z","updated_at":"2024-10-14T13:37:32.000Z","dependencies_parsed_at":"2024-01-15T23:03:55.755Z","dependency_job_id":"9e631f0a-aed3-497d-8d54-bc033b448247","html_url":"https://github.com/joan38/mill-git","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joan38%2Fmill-git","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joan38%2Fmill-git/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joan38%2Fmill-git/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joan38%2Fmill-git/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joan38","download_url":"https://codeload.github.com/joan38/mill-git/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221832313,"owners_count":16888209,"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":["mill-module","mill-plugin","scala"],"created_at":"2024-10-14T20:04:47.650Z","updated_at":"2025-03-22T18:33:30.817Z","avatar_url":"https://github.com/joan38.png","language":"Scala","readme":"# mill-git\n\n![Maven Central](https://img.shields.io/maven-central/v/com.goyeau/mill-git_mill0.11_2.13)\n\nA git version plugin for Mill build tool.\n\n\n## Requirements\n\n * [Mill](https://www.lihaoyi.com/mill)\n * An initialized git project (`git init`)\n\n\n## Usage\n\n### With PublishModule\n\n*build.sc*:\n```scala\nimport $ivy.`com.goyeau::mill-git::\u003clatest version\u003e`\nimport com.goyeau.mill.git.GitVersionedPublishModule\nimport mill.scalalib.JavaModule\nimport mill.scalalib.publish.{Developer, License, PomSettings, VersionControl}\n\nobject `jvm-project` extends JavaModule with GitVersionedPublishModule {\n  override def pomSettings = PomSettings(\n    description = \"JVM Project\",\n    organization = \"com.goyeau\",\n    url = \"https://github.com/joan38/mill-git\",\n    licenses = Seq(License.MIT),\n    versionControl = VersionControl.github(\"joan38\", \"mill-git\"),\n    developers = Seq(Developer(\"joan38\", \"Joan Goyeau\", \"https://github.com/joan38\"))\n  )\n}\n```\n\n```shell script\n\u003e mill show jvm-project.publishVersion\n[1/1] show \n[2/2] com.goyeau.mill.git.GitVersionModule.version \n\"0.0.0-470-6d0b3d9\"\n```\n\n### With DockerModule\n\n*build.sc*:\n```scala\nimport $ivy.`com.goyeau::mill-git::\u003clatest version\u003e`\nimport com.goyeau.mill.git.GitTaggedDockerModule\nimport mill.scalalib.JavaModule\n\nobject `docker-project` extends JavaModule with GitTaggedDockerModule {\n  object docker extends DockerConfig with GitTaggedDocker {\n    def tagLatest = true // Default is false\n  }\n}\n```\n\n```shell script\n\u003e mill show docker-project.docker.tags\n[1/1] show \n[6/6] docker-project.docker.tags \n[\n    \"docker-project:0.0.0-470-6d0b3d9\",\n    \"docker-project:latest\"\n]\n```\n\n### Custom options\n\nHere is a custom configuration with the default option:\n*build.sc*:\n```scala\nimport $ivy.`com.goyeau::mill-git::\u003clatest version\u003e`\nimport com.goyeau.mill.git.GitVersionModule\nimport mill.scalalib.JavaModule\n\nobject `job-project` extends JavaModule {\n  def jobVersion = GitVersionModule.version(\n    hashLength = 7,            // Sets the length of the commit hash to use as a version.\n    withSnapshotSuffix = false // Add the -SNAPSHOT suffix so that versions gets pushed to the snapshot sonatype.\n  )()\n}\n```\n\n```shell script\n\u003e mill show job-project.jobVersion\n[1/1] show \n[2/2] com.goyeau.mill.git.GitVersionModule.version \n\"0.0.0-470-6d0b3d9\"\n```\n\n\n## Versioning strategy\n\n| Tag    | Tag distance | HEAD hash | Uncommitted changes | Uncommitted hash | gitVersion        |\n|:------ |:------------:|:---------:|:-------------------:|:----------------:|:----------------- |\n| v1.0.0 | 0            | c85ec8a   | false               |                  | 1.0.0             |\n| v1.0.0 | 0            | c85ec8a   | true                | 303eee4          | 1.0.0-1-303eee4   |\n| v1.0.0 | 123          | c85ec8a   | false               |                  | 1.0.0-123-c85ec8a |\n| v1.0.0 | 123          | c85ec8a   | true                | 303eee4          | 1.0.0-124-303eee4 |\n| none   |              | c85ec8a   | false               |                  | c85ec8a           |\n| none   |              | c85ec8a   | true                | 303eee4          | 303eee4           |\n| none   |              | none      | true                | 303eee4          | 303eee4           |\n\nNote that we are generating a git hash for the uncommitted changes (even if they are not committed yet).\n \n\n## Related projects\n\n* Inspired by [sbt-dynver](https://github.com/dwijnand/sbt-dynver)\n* [sbt-git](https://github.com/sbt/sbt-git)\n\n\n## Contributing\n\nContributions are more than welcome!  \nSee [CONTRIBUTING.md](CONTRIBUTING.md) for all the information and getting help.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoan38%2Fmill-git","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoan38%2Fmill-git","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoan38%2Fmill-git/lists"}