Commit f4bd70ff authored by bow's avatar bow
Browse files

Use FullVersion throughout

parent c30670ae
......@@ -16,11 +16,13 @@
package nl.lumc.sasc.biopet.core
import java.io.{ PrintWriter, StringWriter }
import java.util.Properties
import nl.lumc.sasc.biopet.core.BiopetExecutable._
import org.apache.log4j.Logger
import scala.io.Source
import org.apache.log4j.Logger
import nl.lumc.sasc.biopet.{ FullVersion, LastCommitHash }
import nl.lumc.sasc.biopet.core.BiopetExecutable._
trait BiopetExecutable extends Logging {
def pipelines: List[MainCommand]
......@@ -59,7 +61,7 @@ trait BiopetExecutable extends Logging {
| - license
|
|Questions or comments? Email sasc@lumc.nl or check out the project page at https://git.lumc.nl/biopet/biopet.git
""".stripMargin.format(modules.keys.mkString(","), getVersion, usage)
""".stripMargin.format(modules.keys.mkString(","), FullVersion, usage)
}
def checkModule(module: String) {
......@@ -81,7 +83,7 @@ trait BiopetExecutable extends Logging {
args match {
case Array("version") => {
println("version: " + getVersion)
println("version: " + FullVersion)
}
case Array("license") => {
println(getLicense)
......@@ -118,30 +120,16 @@ trait BiopetExecutable extends Logging {
}
}
def checkDirtyBuild(logger: Logger) {
val prop = new Properties()
prop.load(getClass.getClassLoader.getResourceAsStream("git.properties"))
val describeShort = prop.getProperty("git.commit.id.describe-short")
if (describeShort.endsWith("-dirty")) {
def checkDirtyBuild(logger: Logger): Unit =
if (LastCommitHash.endsWith("-dirty")) {
logger.warn("**********************************************************")
logger.warn("* This JAR was built while there are uncommited changes. *")
logger.warn("* Reproducible results are *not* guaranteed. *")
logger.warn("**********************************************************")
}
}
}
object BiopetExecutable {
def getVersion = {
getClass.getPackage.getImplementationVersion + " (" + getCommitHash + ")"
}
def getCommitHash = {
val prop = new Properties()
prop.load(getClass.getClassLoader.getResourceAsStream("git.properties"))
prop.getProperty("git.commit.id.abbrev")
}
def getLicense: String = {
val stream = getClass.getClassLoader.getResourceAsStream("nl/lumc/sasc/biopet/License.txt")
Source.fromInputStream(stream).getLines().mkString("\n", "\n", "\n")
......
......@@ -15,6 +15,8 @@
*/
package nl.lumc.sasc.biopet.core
import nl.lumc.sasc.biopet.FullVersion
/**
* Trait for biopet tools, sets some default args
*/
......@@ -45,7 +47,7 @@ trait ToolCommand extends MainCommand with Logging {
sys.exit(1)
} text ("Print usage")
opt[Unit]('v', "version") foreach { _ =>
System.err.println("Version: " + BiopetExecutable.getVersion)
System.err.println("Version: " + FullVersion)
sys.exit(1)
} text ("Print version")
}
......
......@@ -45,23 +45,24 @@
package nl.lumc.sasc.biopet.core.workaround
import java.io.File
import collection.JavaConversions._
import java.io.{ File, FileOutputStream }
import java.net.URL
import java.util.{ ResourceBundle, Arrays }
import org.apache.commons.io.FilenameUtils
import org.broadinstitute.gatk.utils.commandline._
import org.broadinstitute.gatk.queue.util._
import org.broadinstitute.gatk.queue.{ QCommandPlugin, QScript, QScriptManager }
import org.broadinstitute.gatk.queue.util.{ Logging => GatkLogging }
import org.broadinstitute.gatk.queue.engine.{ QStatusMessenger, QGraphSettings, QGraph }
import collection.JavaConversions._
import org.broadinstitute.gatk.utils.classloader.PluginManager
import org.broadinstitute.gatk.utils.exceptions.UserException
import org.broadinstitute.gatk.utils.io.IOUtils
import org.broadinstitute.gatk.utils.help.ApplicationDetails
import java.io.FileOutputStream
import java.net.URL
import java.util.{ ResourceBundle, Arrays }
import org.broadinstitute.gatk.utils.text.TextFormattingUtils
import org.apache.commons.io.FilenameUtils
import nl.lumc.sasc.biopet.core.BiopetExecutable
import nl.lumc.sasc.biopet.FullVersion
/**
* Entry point of Queue. Compiles and runs QScripts passed in to the command line.
......@@ -291,7 +292,7 @@ class BiopetQCommandLine extends CommandLineProgram with Logging {
}
private def createQueueHeader(): Seq[String] = {
Seq("Biopet version: " + BiopetExecutable.getVersion, "",
Seq("Biopet version: " + FullVersion, "",
"Based on GATK Queue",
// String.format("Queue v%s, Compiled %s", getQueueVersion, getBuildTimestamp),
"Copyright (c) 2012 The Broad Institute",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment