forked from gorkemmulayim/ETUmulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
160 lines (140 loc) · 4.3 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
158
159
160
apply plugin: "application"
apply plugin: "jacoco"
apply plugin: "antlr"
apply plugin: "pmd"
apply plugin: "findbugs"
version = "0.5.0"
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
[compileJava, compileTestJava]*.options*.encoding = "UTF-8"
mainClassName = "com.kasirgalabs.etumulator.ETUmulator"
repositories {
mavenCentral()
maven { url "http://dl.bintray.com/typesafe/maven-releases" }
}
sourceSets {
integrationTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integrationTest/java')
}
}
}
configurations {
providedRuntime
codacy
integrationTestCompile.extendsFrom compile
integrationTestRuntime.extendsFrom runtime
}
dependencies {
antlr group: "org.antlr", name: "antlr4", version: "4.7"
testCompile group: "junit", name: "junit", version: "4.12"
integrationTestCompile group: "junit", name: "junit", version: "4.12"
compile group: "com.google.inject", name: "guice", version: "4.1.0"
compile group: "org.fxmisc.richtext", name: "richtextfx", version: "0.7-M3"
codacy group: "com.codacy", name: "codacy-coverage-reporter", version: "2.0.1"
}
task integrationTest(type: Test) {
group 'Verification'
description 'Runs the integration tests.'
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
}
check.dependsOn integrationTest
tasks.withType(Test) {
testLogging {
events "FAILED", "PASSED", "SKIPPED", "STANDARD_ERROR"
showCauses = true
showExceptions = true
showStackTraces = true
showStandardStreams = true
afterSuite { desc, result ->
if (!desc.parent) {
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
def startItem = "| ", endItem = " |"
def repeatLength = startItem.length() + output.length() + endItem.length()
println("\n" + ("-" * repeatLength) + "\n" + startItem + output + endItem + "\n" + ("-" * repeatLength))
}
}
}
}
pmd {
toolVersion = "5.8.1"
consoleOutput = true
ignoreFailures = true
ruleSetFiles = files("config/pmd/kasirgalabs-pmd.xml")
}
tasks.withType(Pmd) {
reports {
html.enabled true
xml.enabled true
}
}
findbugs {
toolVersion = "3.0.1"
ignoreFailures = true
effort = "max"
reportLevel = "low"
}
tasks.withType(FindBugs) {
reports {
html.enabled = true
xml.enabled = false
xml.withMessages = true
}
}
generateGrammarSource {
arguments += ["-package", "com.kasirgalabs.thumb2", "-visitor", "-no-listener", "-long-messages"]
doLast {
copy {
from "build/generated-src/antlr/main/"
include "*.java"
into "src/main/java/com/kasirgalabs/thumb2"
}
delete "build/generated-src/antlr"
}
}
task uploadCoverageToCodacy(type: JavaExec, dependsOn: jacocoTestReport) {
main = "com.codacy.CodacyCoverageReporter"
classpath = configurations.codacy
args = [
"-l",
"Java",
"-r",
"${buildDir}/reports/jacoco/test/jacocoTestReport.xml"
]
}
jar {
manifest {
attributes "Application-Name": "ETUmulator"
attributes "Implementation-Title": "Simple Thumb-2 Emulator"
attributes "Implementation-Version": version
attributes "Implementation-Vendor": "Kasirgalabs"
attributes "Main-Class": mainClassName
attributes "Codebase": "https://github.com/kasirgalabs/ETUmulator/releases"
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}
jacoco {
toolVersion = "0.7.9"
}
jacocoTestReport {
executionData test, integrationTest
afterEvaluate {
classDirectories = files(
classDirectories.files.collect {
fileTree(dir: it, exclude: "com/kasirgalabs/thumb2/**")
})
}
reports {
html.enabled true
xml.enabled true
csv.enabled true
}
}
task wrapper(type: Wrapper) {
gradleVersion = "2.10"
}