-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use T.workspace in Git.open() #93
Conversation
Good catch @defung |
@joan38 done! |
@@ -7,12 +7,12 @@ import com.goyeau.mill.scalafix.StyleModule | |||
import de.tobiasroeser.mill.integrationtest._ | |||
import mill._ | |||
import mill.scalalib._ | |||
import mill.scalalib.api.Util.scalaNativeBinaryVersion | |||
import mill.scalalib.api.ZincWorkerUtil.scalaNativeBinaryVersion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Util
is deprecated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case untaggedRegex(hash) => | ||
if (isDirty) uncommitted() | ||
else s"${hash.take(hashLength)}$snapshotSuffix" | ||
case _ => throw new IllegalStateException(s"Unexpected git describe output: $description") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
./mill __.style
doesn't like throw new...
, so changed this up to use pattern matching instead of fold
@@ -61,5 +65,5 @@ object GitVersionModule extends ExternalModule { | |||
cache.writeTree(altGit.getRepository.newObjectInserter()).abbreviate(hashLength).name() | |||
} | |||
|
|||
override lazy val millDiscover: Discover[this.type] = Discover[this.type] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discover
in mill 0.12.x no longer take a type parameter:
[130/142] mill-git[0.12.4].compile
[info] compiling 1 Scala source to /Users/dennis.fung/repos/defung/mill-git/out/mill-git/0.12.4/compile.dest/classes ...
[error] /Users/defung/repos/joan38/mill-git/mill-git/src/com/goyeau/mill/git/GitVersionModule.scala:68:35: mill.define.Discover does not take type parameters
[error] override lazy val millDiscover: Discover[this.type] = Discover[this.type]
[error] ^
[error] one error found
1 targets failed
mill-git[0.12.4].compile Compilation failed
@@ -20,7 +20,7 @@ jobs: | |||
- name: Checks | |||
run: | | |||
git config --global user.name "CI" | |||
./mill all __.checkStyle __.docJar __.test | |||
./mill all __.checkStyle __.docJar __.publishLocal __.test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needed __.publishLocal
in order for it to work with mill 0.12 for some reason
In mill 0.12, the following line fails because the workdir (
"."
) is now deep inside the mill-server directory, and that's not where we want to get the git repo from:error:
Instead, we should be explicitly using
T.workspace
to get the root dir of the workspace.