Browse Source
Got parsing of property files to work. Fixed some annoyances. Added a version class to handle parsing versions from the properties file
master
Got parsing of property files to work. Fixed some annoyances. Added a version class to handle parsing versions from the properties file
master
Drew Short
11 years ago
5 changed files with 111 additions and 23 deletions
-
2src/main/java/com/sothr/imagetools/App.java
-
38src/main/java/com/sothr/imagetools/AppConfig.java
-
14src/main/resources/default.properties
-
63src/main/scala/com/sothr/imagetools/util/PropertiesService.scala
-
17src/main/scala/com/sothr/imagetools/util/Version.scala
@ -0,0 +1,17 @@ |
|||||
|
package com.sothr.imagetools.util |
||||
|
|
||||
|
/** |
||||
|
* Created by drew on 1/6/14. |
||||
|
*/ |
||||
|
class Version(val versionString:String) { |
||||
|
//parse version into parts |
||||
|
val (major,minor,revision,buildType) = { |
||||
|
val splitVersion = versionString.split("""\.""") |
||||
|
val splitType = splitVersion(splitVersion.length-1).split("""-""") |
||||
|
(splitVersion(0),splitVersion(1),splitType(0),splitType(1)) |
||||
|
} |
||||
|
|
||||
|
override def toString():String = { |
||||
|
return s"$major.$minor.$revision-$buildType" |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue