forked from Dynatrace/openkit-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
130 lines (105 loc) · 2.81 KB
/
Copy pathbuild.gradle
File metadata and controls
130 lines (105 loc) · 2.81 KB
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
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
classpath 'ru.vyarus:gradle-animalsniffer-plugin:1.3.0'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.2'
}
}
group 'com.dynatrace.openkit'
version '1.0.2-SNAPSHOT'
def buildNumber = System.getenv()['BUILD_NUMBER']
if (version.endsWith('-SNAPSHOT') && buildNumber != null) {
version version + '-' + buildNumber
}
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'ru.vyarus.animalsniffer'
apply plugin: 'jacoco'
apply plugin: 'com.github.kt3k.coveralls'
apply from: "gradle/license.gradle"
repositories {
mavenCentral()
}
def target = System.getenv("TARGET_COMPATIBILITY") ?: "6"
sourceCompatibility = 1.6
targetCompatibility = "1." + target
dependencies {
signature 'org.codehaus.mojo.signature:java16:1.1@signature'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19'
}
test {
exclude '**/local/*.class'
}
jar {
baseName = 'openkit'
//classifier = 'java' + target
manifest {
attributes 'Specification-Title': 'Dynatrace OpenKit SDK for Java',
'Specification-Version': version,
'Specification-Vendor': 'Dynatrace LLC',
'url': 'https://github.com/Dynatrace/openkit-java'
}
}
def coverageReportDir = file("$buildDir/reports/coverage/jacoco")
jacoco {
toolVersion = "0.8.1"
reportsDir = coverageReportDir
}
def coverageXmlReportFile = file("${coverageReportDir}/jacocoReport.xml")
jacocoTestReport {
reports {
xml.enabled = true
xml.destination = coverageXmlReportFile
html.enabled = true
html.destination = file("${coverageReportDir}/html")
}
}
coveralls {
jacocoReportPath = coverageXmlReportFile.toString()
}
tasks.coveralls {
dependsOn 'check'
onlyIf { System.env.'CI' }
}
task sourceJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
}
task javadocZip(type: Zip, dependsOn: javadoc) {
baseName = 'openkit'
classifier = 'javadoc'
from javadoc.destinationDir
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
artifacts {
archives sourceJar, javadocZip, javadocJar
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId project.name
from components.java
artifact sourceJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
}
}
}
task printVersion {
doLast {
logger.quiet version
}
}