diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-04 16:14:25 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-04 16:38:21 -0800 |
commit | 593d9f94794e6db8040e7082ba50a24d86c4cc06 (patch) | |
tree | 061aa31787a213866964cff6d52a98295c2a0e1f /build.sc | |
parent | 5871dd570403906435ad407059398c53d002fdbf (diff) | |
download | mill-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-x | build.sc | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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()) } } |