Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Scala Steward: Reformat with scalafmt 3.10.6
407ebdb3e8789f834dc1734d765f9ebaf3a3ece2
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 3.10.3
version = 3.10.6
runner.dialect = scala3
maxColumn = 120
align.preset = more
Expand Down
73 changes: 25 additions & 48 deletions mill-git/test/resources/custom/build.mill
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,33 @@
//| mvnDeps:
//| - com.goyeau::mill-git::0.3.0
import com.goyeau.mill.git.GitVersionModule
import mill._
import mill.*
import mill.scalalib.JavaModule
import os._
import os.*

object project extends JavaModule {
object project extends JavaModule:
def jobVersion = Task(GitVersionModule.version()())
}

/** Usage

> git init
...

// Uncommitted changes
> ./mill show project.jobVersion
"..."

// Commit without tag
> git add --all
> git commit -m "Some commit"

> ./mill show project.jobVersion
"..."

// Uncommitted changes after commit without tag
> echo "Some change!" > some-file
> ./mill show project.jobVersion
"..."

// Head tagged
> git add --all
> git commit -m "Some commit 2"
> git tag -a v1.0.0 -m "v1.0.0"
> ./mill show project.jobVersion
"1.0.0"

// Uncommitted changes after tag
> echo "Some change 2!" > some-file
> ./mill show project.jobVersion
"1.0.0-..."

// Commit after tag
> git add --all
> git commit -m "Some commit 3"
> ./mill show project.jobVersion
"1.0.0-1-..."

// Uncommitted changes after tag and after commit
> echo "Some change 3!" > some-file
> ./mill show project.jobVersion
"1.0.0-2-..."

*/
*
* > git init ...
*
* // Uncommitted changes > ./mill show project.jobVersion "..."
*
* // Commit without tag > git add --all > git commit -m "Some commit"
*
* > ./mill show project.jobVersion "..."
*
* // Uncommitted changes after commit without tag > echo "Some change!" > some-file > ./mill show project.jobVersion
* "..."
*
* // Head tagged > git add --all > git commit -m "Some commit 2" > git tag -a v1.0.0 -m "v1.0.0" > ./mill show
* project.jobVersion "1.0.0"
*
* // Uncommitted changes after tag > echo "Some change 2!" > some-file > ./mill show project.jobVersion "1.0.0-..."
*
* // Commit after tag > git add --all > git commit -m "Some commit 3" > ./mill show project.jobVersion "1.0.0-1-..."
*
* // Uncommitted changes after tag and after commit > echo "Some change 3!" > some-file > ./mill show
* project.jobVersion "1.0.0-2-..."
*/
10 changes: 4 additions & 6 deletions mill-git/test/resources/docker/build.mill
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
//| - com.goyeau::mill-git::0.3.0
//| - com.lihaoyi::mill-contrib-docker:$MILL_VERSION
import com.goyeau.mill.git.GitTaggedDockerModule
import mill._
import mill.*
import mill.contrib.docker.DockerModule
import mill.scalalib.JavaModule
import os._
import os.*

object project extends JavaModule with GitTaggedDockerModule {
object docker extends DockerConfig with GitTaggedDocker {
object project extends JavaModule with GitTaggedDockerModule:
object docker extends DockerConfig with GitTaggedDocker:
override def tagLatest = true // Default is false
}
}
7 changes: 3 additions & 4 deletions mill-git/test/resources/publish/build.mill
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
//| mvnDeps:
//| - com.goyeau::mill-git::0.3.0
import com.goyeau.mill.git.GitVersionedPublishModule
import mill._
import mill.*
import mill.scalalib.JavaModule
import mill.scalalib.publish.{Developer, License, PomSettings, VersionControl}
import os._
import os.*

object project extends JavaModule with GitVersionedPublishModule {
object project extends JavaModule with GitVersionedPublishModule:
override def pomSettings = PomSettings(
description = "JVM Project",
organization = "com.goyeau",
Expand All @@ -16,4 +16,3 @@ object project extends JavaModule with GitVersionedPublishModule {
versionControl = VersionControl.github("joan38", "mill-git"),
developers = Seq(Developer("joan38", "Joan Goyeau", "https://github.com/joan38"))
)
}
Loading