mill-git_2.12

A git version plugin for Mill build tool

License

License

MIT
GroupId

GroupId

com.goyeau
ArtifactId

ArtifactId

mill-git_2.12
Last Version

Last Version

9977203
Release Date

Release Date

Type

Type

jar
Description

Description

mill-git_2.12
A git version plugin for Mill build tool
Project URL

Project URL

https://github.com/joan38/mill-git
Source Code Management

Source Code Management

https://github.com/joan38/mill-git

Download mill-git_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/com.goyeau/mill-git_2.12/ -->
<dependency>
    <groupId>com.goyeau</groupId>
    <artifactId>mill-git_2.12</artifactId>
    <version>9977203</version>
</dependency>
// https://jarcasting.com/artifacts/com.goyeau/mill-git_2.12/
implementation 'com.goyeau:mill-git_2.12:9977203'
// https://jarcasting.com/artifacts/com.goyeau/mill-git_2.12/
implementation ("com.goyeau:mill-git_2.12:9977203")
'com.goyeau:mill-git_2.12:jar:9977203'
<dependency org="com.goyeau" name="mill-git_2.12" rev="9977203">
  <artifact name="mill-git_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.goyeau', module='mill-git_2.12', version='9977203')
)
libraryDependencies += "com.goyeau" % "mill-git_2.12" % "9977203"
[com.goyeau/mill-git_2.12 "9977203"]

Dependencies

compile (1)

Group / Artifact Type Version
org.eclipse.jgit : org.eclipse.jgit jar 5.8.1.202007141445-r

provided (2)

Group / Artifact Type Version
com.lihaoyi : mill-main_2.12 jar 0.6.3
com.lihaoyi : mill-contrib-docker_2.12 jar 0.6.3

Project Modules

There are no modules declared in this project.

mill-git

Latest version

A git version plugin for Mill build tool.

Requirements

  • Mill
  • An initialized git project (git init)

Usage

With PublishModule

build.sc:

import $ivy.`com.goyeau::mill-git:<latest version>`
import com.goyeau.mill.git.GitVersionedPublishModule
import mill.scalalib.JavaModule
import mill.scalalib.publish.{Developer, License, PomSettings, VersionControl}

object `jvm-project` extends JavaModule with GitVersionedPublishModule {
  override def pomSettings = PomSettings(
    description = "JVM Project",
    organization = "com.goyeau",
    url = "https://github.com/joan38/mill-git",
    licenses = Seq(License.MIT),
    versionControl = VersionControl.github("joan38", "mill-git"),
    developers = Seq(Developer("joan38", "Joan Goyeau", "https://github.com/joan38"))
  )
}
> mill show jvm-project.publishVersion
[1/1] show 
[2/2] com.goyeau.mill.git.GitVersionModule.version 
"0.0.0-470-6d0b3d9"

With DockerModule

build.sc:

import $ivy.`com.goyeau::mill-git:<latest version>`
import com.goyeau.mill.git.GitTaggedDockerModule
import mill.scalalib.JavaModule

object `docker-project` extends JavaModule with GitTaggedDockerModule {
  object docker extends DockerConfig with GitTaggedDocker {
    def tagLatest = true // Default is false
  }
}
> mill show docker-project.docker.tags
[1/1] show 
[6/6] docker-project.docker.tags 
[
    "docker-project:0.0.0-470-6d0b3d9",
    "docker-project:latest"
]

Custom

import $ivy.`com.goyeau::mill-git:<latest version>`
import com.goyeau.mill.git.GitVersionModule
import mill.scalalib.JavaModule

object `job-project` extends JavaModule {
  def jobVersion = GitVersionModule.version
}
> mill show job-project.jobVersion
[1/1] show 
[2/2] com.goyeau.mill.git.GitVersionModule.version 
"0.0.0-470-6d0b3d9"

Versioning strategy

Tag Tag distance HEAD hash Uncommitted changes Uncommitted hash gitVersion
v1.0.0 0 c85ec8a false 1.0.0
v1.0.0 0 c85ec8a true 303eee4 1.0.0-1-303eee4
v1.0.0 123 c85ec8a false 1.0.0-123-c85ec8a
v1.0.0 123 c85ec8a true 303eee4 1.0.0-124-303eee4
none c85ec8a false c85ec8a
none c85ec8a true 303eee4 303eee4
none none true 303eee4 303eee4

Note that we are generating a git hash for the uncommitted changes (even if they are not committed yet).

Related projects

Contributing

Contributions are more than welcome!
See CONTRIBUTING.md for all the information and getting help.

Versions

Version
9977203
5286023
946280f
48517e5
203db15
46f51a4
39e6073
22f8716
18ee89d
2d01648
0.1.1
0.1.0-8-5ed3839
0.1.0-6-4254b37
0.1.0-5-af33063
0.1.0-4-9b459c6
0.1.0
ff9b4dc
fc9189d
f90dd3f
e8d8fae
ddf0ac3
d14e75c
bf2480c