-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
114 lines (95 loc) · 2.62 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
subprojects {
apply plugin: 'java'
apply plugin: 'checkstyle'
apply plugin: 'jacoco'
apply plugin: 'maven'
apply plugin: 'eclipse'
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
compileJava {
options.compilerArgs << "-Xlint:all" << "-Werror"
}
compileTestJava {
options.compilerArgs << "-Xlint:all" << "-Werror"
}
plugins.withType(JavaPlugin) {
checkstyle.sourceSets = [sourceSets.main]
}
test {
maxParallelForks = Math.max(1, (int)(Runtime.getRuntime().availableProcessors() / 4))
jacoco {
excludes = ['**/package-info**','**/*Test']
destinationFile = file("$buildDir/reports/jacoco/test.exec")
}
getReports().getJunitXml().setDestination(file("$buildDir/reports/tests/xml"))
getReports().getHtml().setDestination(file("$buildDir/reports/tests/html"))
setBinResultsDir(file("$buildDir/reports/tests/bin"))
}
build.dependsOn jacocoTestReport
jacocoTestReport {
doFirst {
classDirectories = fileTree(dir: 'build/classes/java/main', include: 'org/threadly/**')
sourceDirectories = fileTree(dir: 'src/main/java', include: 'org/threadly/**')
}
reports {
csv.enabled = false
xml.enabled = true
xml.destination = file("$buildDir/reports/jacoco/jacoco.xml")
html.enabled = true
html.destination = file("$buildDir/reports/jacoco/html")
}
doLast {
println "Test results available at:"
println "html - $buildDir/reports/tests/html/index.html"
println "Test coverage reports available at:"
println "html - $buildDir/reports/jacoco/html/index.html"
}
}
jar {
manifest {
attributes 'Implementation-Title': 'litesockets-rtc', 'Implementation-Version': version
}
}
javadoc {
source = sourceSets.main.allJava
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PUBLIC
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
build.dependsOn("copyLibs");
task copyLibs(type: Copy) {
into "$buildDir/dependencies/"
from configurations.testRuntime
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
}
project(':sdp') {
archivesBaseName = 'litesockets-sdp'
dependencies {
testCompile (
"junit:junit:$junitVersion",
)
}
}
project(':stun') {
archivesBaseName = 'litesockets-stun'
dependencies {
testCompile (
"junit:junit:$junitVersion",
)
}
}