forked from mattbdean/JRAW
-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.gradle
116 lines (96 loc) · 2.86 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
plugins {
id 'java'
id 'maven'
id 'maven-publish'
id 'jacoco'
id 'com.github.kt3k.coveralls' version '2.4.0x'
}
ext {
releaseDest = new File(project.buildDir, "releases")
generatedJavaSrc = file("src/gen/java/")
}
allprojects {
sourceCompatibility = 1.7
group = 'net.dean.jraw'
version = '0.9.0'
repositories {
mavenCentral()
}
compileJava.options.encoding = 'UTF-8'
}
dependencies {
def okHttpVersion = '3.1.2'
compile "com.squareup.okhttp3:okhttp:$okHttpVersion"
compile "com.squareup.okhttp3:okhttp-urlconnection:$okHttpVersion"
compile 'com.fasterxml.jackson.core:jackson-databind:2.6.0'
compile 'com.google.guava:guava:19.0'
compile 'org.slf4j:slf4j-api:1.7.13'
testCompile 'org.slf4j:slf4j-simple:1.7.13'
testCompile 'org.testng:testng:6.9.10'
testCompile 'net.sourceforge.htmlunit:htmlunit:2.19'
}
// Add the generated source to the main Java source directories
sourceSets.main.java.srcDir ext.generatedJavaSrc
task fatJar(type: Jar, dependsOn: assemble) {
classifier = 'fat'
destinationDir = releaseDest
from(
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) },
sourceSets.main.output
)
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
destinationDir = releaseDest
from javadoc.destinationDir
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
destinationDir = releaseDest
from sourceSets.main.allSource
}
task renamePom(dependsOn: 'generatePomFileForMavenPublication') << {
println(file('build/publications/maven/pom-default.xml'))
file('build/publications/maven/pom-default.xml').renameTo("build/publications/maven/JRAW-${version}.pom")
}
task release(type: Jar, dependsOn: ['fatJar', 'javadocJar', 'sourcesJar', 'renamePom']) {
from sourceSets.main.output
destinationDir = releaseDest
}
javadoc {
def overrideVersion = System.properties.'javadoc-version'
def version = overrideVersion != null ? overrideVersion : project.version
title = "${project.name} $version API"
}
test {
useTestNG()
testLogging {
// Show stderr and stdout (useful for exceptions)
showStandardStreams = true
}
beforeTest { descriptor ->
logger.lifecycle("Running test: ${descriptor.className}.${descriptor.name}")
}
}
jacocoTestReport {
reports {
xml.enabled = true // coveralls depends on XML reports
html.enabled = true
}
}
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
}
artifacts {
archives sourcesJar
archives javadocJar
}
defaultTasks "test"
task wrapper(type: Wrapper) {
gradleVersion = '2.13'
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
}