summaryrefslogtreecommitdiff
path: root/build.sc
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-02-04 16:14:25 -0800
committerLi Haoyi <haoyi.sg@gmail.com>2018-02-04 16:38:21 -0800
commit593d9f94794e6db8040e7082ba50a24d86c4cc06 (patch)
tree061aa31787a213866964cff6d52a98295c2a0e1f /build.sc
parent5871dd570403906435ad407059398c53d002fdbf (diff)
downloadmill-593d9f94794e6db8040e7082ba50a24d86c4cc06.tar.gz
mill-593d9f94794e6db8040e7082ba50a24d86c4cc06.tar.bz2
mill-593d9f94794e6db8040e7082ba50a24d86c4cc06.zip
properly embed the local module dependency graph metadata in published pom.xmls
Diffstat (limited to 'build.sc')
-rwxr-xr-xbuild.sc10
1 files changed, 7 insertions, 3 deletions
diff --git a/build.sc b/build.sc
index 1e85b64f..73b98061 100755
--- a/build.sc
+++ b/build.sc
@@ -206,17 +206,21 @@ val isMasterCommit = {
(sys.env.get("TRAVIS_BRANCH") == Some("master") || sys.env("TRAVIS_TAG") != "")
}
+def gitHead = T.input{
+ sys.env.get("TRAVIS_COMMIT").getOrElse(
+ %%('git, "rev-parse", "head")(pwd).out.string.trim()
+ )
+}
def publishVersion = T.input{
val tag =
- try Option(%%('git, 'describe, "--exact-match", "--tags", 'HEAD)(pwd).out.string)
+ try Option(%%('git, 'describe, "--exact-match", "--tags", gitHead())(pwd).out.string)
catch{case e => None}
tag match{
case Some(t) => (t, t)
case None =>
val timestamp = java.time.Instant.now().toString.replaceAll(":|\\.", "-")
- val gitHash = %%('git, "rev-parse", "head")(pwd).out.string.trim()
- ("unstable", timestamp + "-" + gitHash)
+ ("unstable", timestamp + "-" + gitHead())
}
}