-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbuild.gradle
118 lines (94 loc) · 3.77 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
apply plugin: 'java'
apply plugin: 'jacoco'
def jversion= JavaVersion.VERSION_1_8
sourceCompatibility= jversion
targetCompatibility= jversion
if(JavaVersion.current() < jversion) {
throw new GradleException("Java >= " + jversion + " is required but you are running " + JavaVersion.current())
}
/** Return the MD5 sum of the give File object */
ext.generateMD5 = { file ->
def digest = java.security.MessageDigest.getInstance("MD5")
file.eachByte( 4096 ) { buffer, length ->
digest.update( buffer, 0, length )
}
new BigInteger(1, digest.digest()).toString(16).padLeft(32, '0')
}
/** Gunzip the given file. Same as `gunzip -c dir/myfile.txt.gz > dir/myfile.txt`.
String filename must have extension .gz */
ext.gunzip = { filename ->
File outfile = new File(filename.replaceFirst('\\.gz$', ''))
outfile.withOutputStream { os ->
os << resources.gzip(filename).read()
}
}
/* Prepare test data */
File targetFile= new File('test_data/chr7.fa')
String targetMD5= "30c3693ead968844a769a90a801a900f"
if (!targetFile.exists() || ext.generateMD5(targetFile) != targetMD5) {
File fgz= new File("test_data", targetFile.name + ".gz")
ext.gunzip(fgz.absolutePath)
if(ext.generateMD5(targetFile) != targetMD5){
throw new GradleException("Corrupted file " + targetFile)
}
}
targetFile= new File('test_data/ALL.wex.union_illumina_wcmc_bcm_bc_bi.20110521.snps.exome.sites.vcf')
targetMD5= "6783ca5e6df2ce1075e1e0c924ad7d37"
if (!targetFile.exists() || ext.generateMD5(targetFile) != targetMD5) {
File fgz= new File("test_data", targetFile.name + ".gz")
ext.gunzip(fgz.absolutePath)
if(ext.generateMD5(targetFile) != targetMD5){
throw new GradleException("Corrupted file " + targetFile)
}
}
ext.gunzip("test_data/CEU.exon.2010_06.genotypes.vcf.gz")
ext.gunzip("test_data/ALL.wgs.mergedSV.v8.20130502.svs.genotypes.vcf.gz")
// ---------------------------
test {
testLogging {
events "passed", "skipped", "failed"
exceptionFormat "full"
}
if (project.hasProperty('excludeTests')) {
exclude project.property('excludeTests')
}
}
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
jar {
manifest {
attributes "Main-Class": "samTextViewer.Main"
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}
dependencies {
compile group: 'net.sourceforge.argparse4j', name: 'argparse4j', version: '0.8.1'
compile group: 'jline', name: 'jline', version: '2.14.5'
compile 'com.github.dariober:Jawk:e5c8f26'
compile group: 'com.github.igvteam', name: 'igv', version: 'v2.6.3'
compile group: 'log4j', name: 'log4j', version: '1.2.17'
compile group: 'com.github.dariober', name: 'htsjdk', version: 'b8f559b9f'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.5'
compile group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1'
compile group: 'commons-validator', name: 'commons-validator', version: '1.6'
compile group: 'commons-io', name: 'commons-io', version: '2.6'
compile group: 'com.esotericsoftware.yamlbeans', name: 'yamlbeans', version: '1.13'
compile group: 'com.itextpdf', name: 'itextpdf', version: '5.5.13'
compile group: 'com.google.guava', name: 'guava', version: '24.0-android'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.2'
compile group: 'org.biojava', name: 'biojava-genome', version: '5.4.0'
compile group: 'org.xerial', name: 'sqlite-jdbc', version: '3.21.0.1'
// implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1'
testCompile 'junit:junit:4.12'
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}
check.dependsOn jacocoTestReport