forked from twingly/twingly-search-api-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
120 lines (106 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
apply plugin: "idea"
apply plugin: "java"
apply plugin: "groovy"
apply plugin: "maven"
apply plugin: "signing"
apply plugin: "jacoco"
group = "com.twingly"
ext {
versionProperties = new Properties()
versionProperties.load(file("src/main/resources/version.properties").newReader())
projectVersion = versionProperties["version"]
sourceEncoding = "UTF-8"
spockVersion = "1.0-groovy-2.3"
groovyVersion = "2.3.3"
junitVersion = "4.12"
cglibVersion = "3.2.0"
objenesisVersion = "2.2"
jaxbVersion = "2.2.11"
libs = [
jaxb : "org.glassfish.jaxb:jaxb-runtime:$jaxbVersion",
junit : "junit:junit:$junitVersion",
groovy : "org.codehaus.groovy:groovy-all:$groovyVersion",
spock : "org.spockframework:spock-core:$spockVersion",
cglib : "cglib:cglib-nodep:$cglibVersion",
objenesis: "org.objenesis:objenesis:$objenesisVersion"
]
buildTime = new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
sharedManifest = manifest {
attributes(
"Implementation-Title": "Twingly Search API Java",
"Implementation-Version": projectVersion,
"Build-Time": buildTime
)
}
}
version = ext.projectVersion
sourceCompatibility = 1.7
targetCompatibility = 1.7
repositories {
mavenCentral()
jcenter()
mavenLocal()
}
dependencies {
compile libs.jaxb
testCompile libs.junit
testCompile libs.groovy
testCompile libs.spock
testRuntime libs.cglib
testRuntime libs.objenesis
}
jacoco {
toolVersion = "0.7.1.201405082137"
}
test {
testLogging.showStandardStreams = true
testLogging {
events "PASSED", "FAILED", "SKIPPED"
}
jacoco {
append = false
destinationFile = file("$buildDir/jacoco/jacocoTest.exec")
classDumpFile = file("$buildDir/jacoco/classpathdumps")
}
}
jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
html.destination "${buildDir}/jacocoHtml"
}
}
javadoc {
options.memberLevel = JavadocMemberLevel.PROTECTED
classpath = configurations.compile
}
//create a single Jar with all dependencies
task generateOneJar(type: Jar) {
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
tasks.withType(Jar) { // includes War and Ear
manifest = project.manifest {
from sharedManifest
}
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from tasks.javadoc.destinationDir
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
tasks.withType(JavaCompile.class) {
options.deprecation = false
options.warnings = false
options.encoding = sourceEncoding
options.compilerArgs = ["-Xmaxerrs", "20", "-Xmaxwarns", "0", "-Xlint:all"]
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}