From 111dfba6a3c4b2ce110925e347b956b5d7a0fc24 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Tue, 7 Feb 2012 21:51:16 -0500 Subject: [PATCH] support setting sbt.version from system property, which overrides setting in a properties file fixes #354 --- launch/ConfigurationParser.scala | 5 +++-- launch/src/main/input_resources/sbt/sbt.boot.properties | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/launch/ConfigurationParser.scala b/launch/ConfigurationParser.scala index 7e68c790f..353436da2 100644 --- a/launch/ConfigurationParser.scala +++ b/launch/ConfigurationParser.scala @@ -90,11 +90,12 @@ class ConfigurationParser def processVersion(label: String, defaultName: String)(value: Option[String]): Value[String] = value.map(readValue[String](label)).getOrElse(new Implicit(defaultName, None)) - def readValue[T](label: String)(implicit read: String => T): String => Value[T] = value => + def readValue[T](label: String)(implicit read: String => T): String => Value[T] = value0 => { + val value = substituteVariables(value0) if(isEmpty(value)) error(label + " cannot be empty (omit declaration to use the default)") try { parsePropertyValue(label, value)(Value.readImplied[T]) } - catch { case e: BootException => new Explicit(read(substituteVariables(value))) } + catch { case e: BootException => new Explicit(read(value)) } } def processSection[T](sections: SectionMap, name: String, f: LabelMap => T) = process[String,LabelMap,T](sections, name, m => f(m default(x => None))) diff --git a/launch/src/main/input_resources/sbt/sbt.boot.properties b/launch/src/main/input_resources/sbt/sbt.boot.properties index 0a09cab65..e22520776 100644 --- a/launch/src/main/input_resources/sbt/sbt.boot.properties +++ b/launch/src/main/input_resources/sbt/sbt.boot.properties @@ -2,12 +2,12 @@ version: ${sbt.scala.version-auto} [app] - org: ${{org}} + org: ${sbt.organization-${{org}}} name: sbt - version: read(sbt.version)[${{sbt.version}}] + version: ${sbt.version-read(sbt.version)[${{sbt.version}}]} class: ${sbt.main.class-sbt.xMain} components: xsbti,extra - cross-versioned: false + cross-versioned: ${sbt.cross.versioned-false} [repositories] local