Commit 801b72ed authored by bow's avatar bow
Browse files

Merge branch 'feature-license' into 'develop'

Feature license

Issue: #47
Added license to the project. Bash script to check and reformat if needed.

Also fix for #90 and #91

See merge request !59
parents 5abe8248 d8189966
#!/bin/bash
#
# Copyright (c) 2014 Leiden University Medical Center - Sequencing Analysis Support Core <sasc@lumc.nl>
# @author Peter van 't Hof <p.j.van_t_hof@lumc.nl>
#
DIR=`readlink -f \`dirname $0\``
MODE=check
if [ $1 ] ; then
MODE=$1
fi
mvn -f $DIR/public/pom.xml license:$MODE -Dlicense.header=$DIR/public/LICENSE
mvn -f $DIR/protected/pom.xml license:$MODE -Dlicense.header=$DIR/protected/LICENSE
\ No newline at end of file
biopet-gatk-extensions/src/main/resources/nl/lumc/sasc/biopet/License.txt
\ No newline at end of file
** This part of Biopet can only be used inside the LUMC **
......@@ -15,7 +15,12 @@
<inceptionYear>2014</inceptionYear>
<name>BiopetProtectedPackage</name>
<properties>
<sting.shade.phase>package</sting.shade.phase>
<app.main.class>nl.lumc.sasc.biopet.core.BiopetExecutableProtected</app.main.class>
</properties>
<dependencies>
<dependency>
<groupId>nl.lumc.sasc</groupId>
......@@ -56,6 +61,12 @@
</transformer>
</transformers>
<filters>
<filter>
<artifact>nl.lumc.sasc:BiopetFramework</artifact>
<excludes>
<exclude>nl/lumc/sasc/biopet/License.txt</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
......
biopet-framework/src/main/resources/nl/lumc/sasc/biopet/License.txt
\ No newline at end of file
......@@ -3,6 +3,7 @@ log4j.rootLogger=INFO, A1
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.Target=System.err
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
......
This file is part of ${project.name}.
${project.name} is built on top of GATK Queue for building bioinformatic
Biopet is built on top of GATK Queue for building bioinformatic
pipelines. It is mainly intended to support LUMC SHARK cluster which is running
SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
should also be able to execute Biopet tools and pipelines.
Copyright ${project.inceptionYear} ${owner}
Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
Contact us at: ${email}
Contact us at: sasc@lumc.nl
A dual licensing mode is applied. The source code within this project that are
not part of GATK Queue is freely available for non-commercial use under an AGPL
license; For commercial users or users who do not want to follow the AGPL
license, please contact us to obtain a separate license.
${project.name} is free software: you can redistribute it and/or modify
Biopet is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
${project.name} is distributed in the hope that it will be useful,
Biopet is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with ${project.name}. If not, see <http://www.gnu.org/licenses/>.
\ No newline at end of file
along with Biopet. If not, see <http://www.gnu.org/licenses/>.
\ No newline at end of file
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
trait BiopetExecutable extends Logging {
......@@ -18,6 +21,7 @@ trait BiopetExecutable extends Logging {
* @param args the command line arguments
*/
def main(args: Array[String]): Unit = {
checkDirtyBuild(logger)
def toBulletedList(m: List[MainCommand], kind: String = "", bullet: String = "-") =
"Available %s(s):\n ".format(kind) + bullet + " " + m.map(x => x.commandName).sorted.mkString("\n " + bullet + " ")
......@@ -37,6 +41,7 @@ trait BiopetExecutable extends Logging {
|
|Subcommands:
| - version
| - 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)
......@@ -56,31 +61,48 @@ trait BiopetExecutable extends Logging {
System.err.println(s"ERROR: command '$name' does not exist in module '$module'\n" + usage(module))
System.exit(1)
}
return command.get
command.get
}
args match {
case Array("version") => {
println("version: " + getVersion)
}
case Array("license") => {
println(getLicense)
}
case Array(module, name, passArgs @ _*) => {
getCommand(module, name).main(passArgs.toArray)
try {
getCommand(module, name).main(passArgs.toArray)
} catch {
case e: Exception => {
val sWriter = new StringWriter()
val pWriter = new PrintWriter(sWriter)
e.printStackTrace(pWriter)
pWriter.close()
val trace = (sWriter.toString.split("\n"))
if (!logger.isDebugEnabled) {
logger.error(trace.head)
logger.error("For more info please run with -l debug")
} else {
trace.foreach(logger.debug(_))
}
sys.exit(1)
}
}
}
case Array(module) => {
System.err.println(usage(module))
System.exit(1)
sys.exit(1)
}
case _ => {
System.err.println(usage())
System.exit(1)
sys.exit(1)
}
}
}
def getVersion = BiopetExecutable.getVersion
def getCommitHash = BiopetExecutable.getCommitHash
def checkDirtyBuild(logger: Logger) {
val prop = new Properties()
prop.load(getClass.getClassLoader.getResourceAsStream("git.properties"))
......@@ -92,7 +114,6 @@ trait BiopetExecutable extends Logging {
logger.warn("**********************************************************")
}
}
checkDirtyBuild(logger)
}
object BiopetExecutable {
......@@ -105,4 +126,9 @@ object BiopetExecutable {
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")
}
}
\ No newline at end of file
......@@ -22,7 +22,6 @@
<app.main.class>nl.lumc.sasc.biopet.core.BiopetExecutablePublic</app.main.class>
</properties>
<dependencies>
<dependency>
<groupId>nl.lumc.sasc</groupId>
......
......@@ -144,6 +144,25 @@
</gitDescribe>
</configuration>
</plugin>
</plugins>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>2.6</version>
<configuration>
<excludes>
<exclude>**/*git*</exclude>
<exclude>**/License*</exclude>
<exclude>**/*.bam</exclude>
<exclude>**/*.bai</exclude>
<exclude>**/*.gtf</exclude>
<exclude>**/*.fq</exclude>
<exclude>**/*.sam</exclude>
<exclude>**/*.bed</exclude>
<exclude>**/*.refFlat</exclude>
<exclude>**/*.R</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
This file is part of Biopet
Biopet is built on top of GATK Queue for building bioinformatic
pipelines. It is mainly intended to support LUMC SHARK cluster which is running
SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
should also be able to execute Biopet tools and pipelines.
Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
Contact us at: sasc@lumc.nl
A dual licensing mode is applied. The source code within this project that are
not part of GATK Queue is freely available for non-commercial use under an AGPL
license; For commercial users or users who do not want to follow the AGPL
license, please contact us to obtain a separate license.
Biopet is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Biopet is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Biopet. If not, see <http://www.gnu.org/licenses/>.
Supports Markdown
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