forked from cdancy/bitbucket-rest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
151 lines (132 loc) · 4.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
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
143
144
145
146
147
148
149
150
151
plugins {
id 'java-library'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '6.1.0'
id "io.github.gradle-nexus.publish-plugin" version "1.2.0"
//id 'checkstyle'
id 'jacoco'
id 'eclipse'
id 'pmd'
}
apply from: "$rootDir/gradle/additional-artifacts.gradle"
apply from: "$rootDir/gradle/dependencies.gradle"
apply from: "$rootDir/gradle/publishing.gradle"
apply from: "$rootDir/gradle/release.gradle"
repositories {
mavenCentral()
}
dependencies {
ext.jcloudsVersion = '2.5.0'
ext.autoServiceVersion = '1.0.1'
ext.autoValueVersion = '1.10.1'
ext.guiceVersion = '5.1.0'
// The transitive dependencies that are exposed via the public API of this project
api 'com.google.code.gson:gson:2.10.1'
implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation 'javax.annotation:javax.annotation-api:1.3.2'
implementation ("org.apache.jclouds:jclouds-core:${jcloudsVersion}")
implementation ("com.google.inject:guice:${guiceVersion}")
implementation ("com.google.inject.extensions:guice-assistedinject:${guiceVersion}")
implementation ("com.google.auto.value:auto-value-annotations:${autoValueVersion}")
annotationProcessor ("com.google.auto.value:auto-value:${autoValueVersion}")
implementation ("com.google.auto.service:auto-service-annotations:${autoServiceVersion}")
annotationProcessor ("com.google.auto.service:auto-service:${autoServiceVersion}")
implementation ('javax.xml.bind:jaxb-api:2.3.1')
testImplementation ("org.apache.jclouds:jclouds-core:${jcloudsVersion}:tests")
testImplementation ("org.apache.jclouds.driver:jclouds-slf4j:${jcloudsVersion}")
testImplementation ('org.assertj:assertj-core:3.24.2')
testImplementation ('org.testng:testng:7.7.1')
testImplementation ('com.squareup.okhttp:mockwebserver:2.7.5')
testImplementation ('ch.qos.logback:logback-classic:1.4.5')
testImplementation ('ch.qos.logback:logback-core:1.4.5')
testImplementation ('commons-io:commons-io:2.11.0')
}
ext.compatibilityVersion = JavaVersion.VERSION_11
sourceCompatibility = compatibilityVersion
targetCompatibility = compatibilityVersion
jar {
manifest {
attributes 'Implementation-Title': 'Bitbucket REST client',
'Implementation-Version': archiveVersion,
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'),
'Built-Gradle': gradle.gradleVersion
}
}
/*
checkstyle {
toolVersion = "6.13"
}
*/
pmd {
ruleSetConfig = resources.text.fromFile(rootProject.file('config/pmd/pmd.xml'))
consoleOutput = true
ignoreFailures = false
ruleSets = []
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
tasks.withType(Pmd) {
reports {
xml.enabled = true
html.enabled = true
}
}
tasks.withType(JavaCompile) {
options.compilerArgs += ['-Xlint:-options']
}
task mockTest(type: Test) {
useTestNG()
include '**/**MockTest.class'
maxParallelForks = 2
testLogging {
showStandardStreams = true
events 'started', 'passed', 'failed'
}
}
task integTest(type: Test, dependsOn: ['mockTest']) {
doFirst {
def integProjectDir = project.file("${buildDir}/integ-projects")
if (!integProjectDir.exists()) {
if (!integProjectDir.mkdirs()) {
throw new RuntimeException("Failed to create integ-project directory @ ${integProjectDir.path}")
}
}
}
useTestNG()
include '**/**LiveTest.class'
testLogging {
showStandardStreams = true
events 'started', 'passed', 'failed'
}
def authentication = [:]
def possibleAuth = project.findProperty('testBitbucketRestCredentials')
if (possibleAuth) {
authentication['test.bitbucket.rest.credentials'] = possibleAuth
} else {
possibleAuth = project.findProperty('testBitbucketRestToken')
if (possibleAuth) {
authentication['test.bitbucket.rest.token'] = possibleAuth
} else {
logger.quiet 'No authentication parameters found. Assuming anonymous...'
}
}
// property 'test.bitbucket.endpoint' needs to be
// hard-coded in for jclouds test framework
systemProperties = ["test.bitbucket.endpoint" : "${testBitbucketRestEndpoint}",
"test.bitbucket.project" : "${testBitbucketRestProject}",
"test.bitbucket.basedir" : "${buildDir}/integ-projects"] << authentication
}
javadoc {
source = sourceSets.main.allJava
options.with {
links "https://docs.oracle.com/en/java/javase/${compatibilityVersion}/docs/api"
links "https://google.github.io/guice/api-docs/${dependencies.guiceVersion}/javadoc/"
addStringOption('Xdoclint:none', '-quiet')
}
}