-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
159 lines (124 loc) · 3.45 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
if(JavaVersion.current() < JavaVersion.VERSION_1_7){
println("\t************************")
println("\t*** Hello from Bixie ***")
println("\tYou will need Java 1.7 or higher if you want to continue.")
println("\tYour Java is really old. Found version " + JavaVersion.current())
println("\t************************")
throw new GradleException("Update your Java!")
}
buildscript {
repositories {
mavenCentral()
maven {
name 'Shadow'
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.0.1'
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.2'
}
}
apply plugin: 'java'
apply plugin: 'eclipse-wtp'
apply plugin: 'jacoco'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'application'
apply plugin: 'findbugs'
apply plugin: 'com.github.johnrengelman.shadow'
task wrapper(type: Wrapper) {
gradleVersion = '2.3'
}
sourceCompatibility = 1.7
def version = '1.2'
jar.archiveName = "jar2bpl.jar"
shadowJar.archiveName = "jar2bpl.jar"
mainClassName = "org.joogie.Main"
repositories {
mavenCentral()
}
configurations{
common
}
dependencies {
compile (
'args4j:args4j:2.32',
'log4j:log4j:1.2.17',
'com.google.code.findbugs:annotations:3.0.0',
fileTree(dir: 'lib', include: '*.jar')
)
testCompile "junit:junit:4.11" // Or whatever version
}
// building the jar ---------------------
//copy the jars into the output before zipping it into a jar.
task copyToLib(type: Copy) {
into "$buildDir/output/libs"
from configurations.runtime
}
build.dependsOn(copyToLib)
jar {
baseName = 'jar2bpl'
manifest {
attributes 'Main-Class': mainClassName,
'Class-Path': '.',
'Implementation-Title': 'Jar2Bpl',
'Implementation-Version': version
}
from('src/main/resorces'){ include('log4j.properties')}
from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
// testing related activities -----------------
tasks.withType(FindBugs) {
effort = "default"
reportLevel = "medium"
reports {
xml.enabled = false
html.enabled = true
}
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled true
csv.enabled false
html.destination "${buildDir}/reports/coverage"
}
}
test {
jacoco {
enabled = true
}
testLogging {
events "failed"
exceptionFormat "full"
}
useJUnit()
}
task coverityCheck {
group 'Verification'
description 'Send the build to coverity for analysis'
doLast {
println("REQUIRES cov-build TO BE IN YOUR PATH.")
println("Running coverity")
exec {
workingDir '.'
commandLine 'cov-build', '--dir', 'cov-int', 'gradle', 'clean', 'compileJava'
}
println("Packing the results")
exec {
workingDir '.'
commandLine 'tar', 'czvf', 'cov-report.tgz', 'cov-int'
}
println("Uploading to coverity")
exec {
workingDir '.'
commandLine 'curl', '--form', 'token=X5pUWlwGfyZ-zPqgkUE61w', '--form' , 'email=martinschaef@gmail.com', '--form', 'file=@cov-report.tgz', '--form', 'version="${version}"', 'https://scan.coverity.com/builds?project=martinschaef%2Fjar2bpl'
}
exec {
workingDir '.'
commandLine 'rm', 'cov-report.tgz'
commandLine 'rm', '-rf', 'cov-int/'
}
println("Done")
}
}