forked from ev3dev-lang-java/ev3dev-lang-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
142 lines (114 loc) · 2.94 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
//Gradle file library ev3dev-lang-java
//Author: Juan Antonio Breña Moral
version = '2.4.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: "jacoco"
apply plugin: 'checkstyle'
repositories {
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
checkstyle 'com.puppycrawl.tools:checkstyle:8.2'
annotationProcessor("org.projectlombok:lombok:1.16.20")
compileOnly("org.projectlombok:lombok:1.16.20")
testCompileOnly("org.projectlombok:lombok:1.16.20")
compile("org.slf4j:slf4j-api:1.7.25")
compile("com.github.ev3dev-lang-java:lejos-commons:0.7.1")
testCompile("ch.qos.logback:logback-classic:1.2.3")
testCompile("commons-io:commons-io:2.5")
testCompile("junit:junit:4.12")
testCompile("org.hamcrest:hamcrest-all:1.3")
}
//Wrapper
task wrapper(type: Wrapper) {
description = 'Generates gradlew[.bat] scripts'
gradleVersion = '4.7'
}
compileJava.options.encoding = 'UTF-8'
//Compile
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
tasks.withType(Test) {
maxParallelForks = Runtime.runtime.availableProcessors() / 2
}
jacoco {
toolVersion = "0.8.1"
reportsDir = file("$buildDir/customJacocoReportDir")
}
jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
html.destination file("${buildDir}/jacocoHtml")
}
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.75
}
}
}
}
test {
jacoco {
append = false
destinationFile = file("$buildDir/jacoco/jacocoTest.exec")
classDumpDir = file("$buildDir/jacoco/classpathdumps")
}
}
test.finalizedBy jacocoTestReport
test.finalizedBy jacocoTestCoverageVerification
//Jar
jar {
baseName = "${rootProject.name}"
manifest {
from file("${projectDir}/src/main/resources/META-INF/MANIFEST.MF")
}
}
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.0'
classpath "gradle.plugin.net.ossindex:ossindex-gradle-plugin:0.1.1"
}
}
//Fat Jar
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: "net.ossindex.audit"
task fatJar << {
}
fatJar.dependsOn shadowJar
//Deploy on Brick
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.hidetake:gradle-ssh-plugin:2.9.0"
}
}
apply plugin: 'org.hidetake.ssh'
apply from: './gradle/deploy.gradle'
apply from: './gradle/docker.gradle'
/* global settings */
configure(allprojects) { project ->
compileJava.options*.compilerArgs = [
"-Xlint:unchecked", "-Xlint:rawtypes",
]
compileTestJava.options*.compilerArgs = [
"-Xlint:deprecation", "-Xlint:unchecked", "-Xlint:rawtypes",
]
}