From 74c70e0ecceb72f23fc1e89e91a4b78156e93936 Mon Sep 17 00:00:00 2001 From: Drew Short Date: Sat, 25 Jan 2014 22:17:13 -0600 Subject: [PATCH] Updated some version code, and added a commons-cli dependancy --- pom.xml | 5 +++++ .../scala/com/sothr/imagetools/util/PropertiesService.scala | 2 +- src/main/scala/com/sothr/imagetools/util/Version.scala | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f3f0639..469ae9f 100644 --- a/pom.xml +++ b/pom.xml @@ -88,6 +88,11 @@ jtransforms 2.4.0 + + commons-cli + commons-cli + 1.2 + diff --git a/src/main/scala/com/sothr/imagetools/util/PropertiesService.scala b/src/main/scala/com/sothr/imagetools/util/PropertiesService.scala index ad7baf3..4463bca 100644 --- a/src/main/scala/com/sothr/imagetools/util/PropertiesService.scala +++ b/src/main/scala/com/sothr/imagetools/util/PropertiesService.scala @@ -60,7 +60,7 @@ object PropertiesService extends Logging { val out:OutputStream = new FileOutputStream(location, false) val cleanProperties = getCleanProperties //insert special keys here - cleanProperties.setProperty("version.previous", version.toString()) + cleanProperties.setProperty("version.previous", version.parsableToString()) cleanProperties.storeToXML(out, "User Properties") out.flush() out.close() diff --git a/src/main/scala/com/sothr/imagetools/util/Version.scala b/src/main/scala/com/sothr/imagetools/util/Version.scala index e81864d..7b07742 100644 --- a/src/main/scala/com/sothr/imagetools/util/Version.scala +++ b/src/main/scala/com/sothr/imagetools/util/Version.scala @@ -52,8 +52,12 @@ class Version(val versionString:String) { } } + def parsableToString():String = { + s"$major.$minor.$patch-$buildTag-$buildNumber-$buildHash" + } + override def toString():String = { - return s"$major.$minor.$patch-$buildTag build:$buildNumber code:$buildHash" + s"$major.$minor.$patch-$buildTag build:$buildNumber code:$buildHash" } override def hashCode(): Int = {