From 450fa15c0e663f23d6f19d00e80c245ad4d4180b Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Fri, 9 Sep 2011 18:35:38 +0530 Subject: [PATCH] Expose snapshot flag via standard `SettingKey` --- main/Defaults.scala | 1 + main/Keys.scala | 1 + 2 files changed, 2 insertions(+) diff --git a/main/Defaults.scala b/main/Defaults.scala index e3fa40645..5485f247e 100644 --- a/main/Defaults.scala +++ b/main/Defaults.scala @@ -632,6 +632,7 @@ object Classpaths conflictWarning <<= (thisProjectRef, conflictWarning) { (ref, cw) => cw.copy(label = Project.display(ref)) }, unmanagedBase <<= baseDirectory / "lib", normalizedName <<= name(StringUtilities.normalize), + isSnapshot <<= isSnapshot or version(_ endsWith "-SNAPSHOT"), description <<= description or name.identity, homepage in GlobalScope :== None, startYear in GlobalScope :== None, diff --git a/main/Keys.scala b/main/Keys.scala index 9baa6869a..26efd5eca 100644 --- a/main/Keys.scala +++ b/main/Keys.scala @@ -248,6 +248,7 @@ object Keys val moduleName = SettingKey[String]("module-name", "The name of the current module, used for dependency management.") val version = SettingKey[String]("version", "The version/revision of the current module.") + val isSnapshot = SettingKey[Boolean]("is-snapshot", "True if the the version of the project is a snapshot version.") val moduleID = SettingKey[ModuleID]("module-id", "A dependency management descriptor. This is currently used for associating a ModuleID with a classpath entry.") val projectID = SettingKey[ModuleID]("project-id", "The dependency management descriptor for the current module.") val externalResolvers = TaskKey[Seq[Resolver]]("external-resolvers", "The external resolvers for automatically managed dependencies.")