Merge pull request #531 from coursier/topic/foo

Minor things
This commit is contained in:
Alexandre Archambault 2017-05-09 17:04:58 +02:00 committed by GitHub
commit 7874f62c41
2 changed files with 21 additions and 20 deletions

View File

@ -16,11 +16,11 @@ object Tree {
def init[E, O](seq: Seq[E])(f: E => O) =
seq.dropRight(1).map(f)
/**
* Add elements to the stack
* @param elems elements to add
* @param isLast a list that contains whether an element is the last in its siblings or not.
*/
/*
* Add elements to the stack
* @param elems elements to add
* @param isLast a list that contains whether an element is the last in its siblings or not.
*/
def childrenWithLast(elems: Seq[T],
isLast: Seq[Boolean]): Seq[(T, Seq[Boolean])] = {

View File

@ -18,7 +18,7 @@ object CoursierSettings {
}
def sonatypeRepository(name: String) = {
resolvers += Resolver.sonatypeRepo("releases")
resolvers += Resolver.sonatypeRepo(name)
}
lazy val localM2Repository = {
@ -70,26 +70,27 @@ object CoursierSettings {
)
lazy val generatePropertyFile =
resourceGenerators.in(Compile) += {
(target, version).map { (dir, ver) =>
import sys.process._
resourceGenerators.in(Compile) += Def.task {
import sys.process._
val dir = target.value
val ver = version.value
val f = dir / "coursier.properties"
dir.mkdirs()
val f = dir / "coursier.properties"
dir.mkdirs()
val p = new java.util.Properties
val p = new java.util.Properties
p.setProperty("version", ver)
p.setProperty("commit-hash", Seq("git", "rev-parse", "HEAD").!!.trim)
p.setProperty("version", ver)
p.setProperty("commit-hash", Seq("git", "rev-parse", "HEAD").!!.trim)
val w = new java.io.FileOutputStream(f)
p.store(w, "Coursier properties")
w.close()
val w = new java.io.FileOutputStream(f)
p.store(w, "Coursier properties")
w.close()
println(s"Wrote $f")
println(s"Wrote $f")
Seq(f)
}.taskValue
Seq(f)
}
lazy val coursierPrefix = {