-
Notifications
You must be signed in to change notification settings - Fork 174
/
build.gradle
113 lines (100 loc) · 4.1 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
plugins {
id 'java'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '7.1.1'
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
}
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.autoValueVersion = '1.11.0'
ext.autoServiceVersion = '1.1.1'
ext.guiceVersion = '5.1.0'
implementation 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359'
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.service:auto-service-annotations:${autoServiceVersion}")
annotationProcessor ("com.google.auto.service:auto-service:${autoServiceVersion}")
implementation ("com.google.auto.value:auto-value-annotations:${autoValueVersion}")
annotationProcessor ("com.google.auto.value:auto-value:${autoValueVersion}")
testImplementation ("org.apache.jclouds:jclouds-core:${jcloudsVersion}:tests")
testImplementation ("org.apache.jclouds.driver:jclouds-slf4j:${jcloudsVersion}")
testImplementation ('org.assertj:assertj-core:3.26.3')
testImplementation ('ch.qos.logback:logback-core:1.5.12')
testImplementation ('com.squareup.okhttp3:mockwebserver:4.12.0')
testImplementation ('org.testng:testng:7.10.2')
testImplementation ('ch.qos.logback:logback-classic:1.5.12')
}
ext.compatibilityVersion = JavaVersion.VERSION_11
ext.javadocPath = compatibilityVersion.isJava8() ? '' : 'en/java/'
sourceCompatibility = compatibilityVersion
targetCompatibility = compatibilityVersion
jar {
manifest {
attributes 'Implementation-Title': 'Jenkins 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
}
}
tasks.withType(JavaCompile) {
options.compilerArgs += ["-Xlint:-options"]
}
task mockTest(type: Test) {
group = "Verification"
description = "Mock tests"
useTestNG()
include '**/**MockTest*'
maxParallelForks = 2
testLogging {
showStandardStreams = true
events 'started', 'passed', 'failed'
}
}
task integTest(type: Test, dependsOn: mockTest) {
group = "Verification"
description = "Integration tests - Jenkins must be running. See the README."
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*"
maxParallelForks = 1
testLogging {
showStandardStreams = true
events 'started', 'passed', 'failed'
}
def possibleUsernameApiToken = project.findProperty("testJenkinsUsernameApiToken")
def usernameApiToken = [:]
if (possibleUsernameApiToken) {
usernameApiToken["test.jenkins.usernameApiToken"] = possibleUsernameApiToken
}
systemProperties = [
"test.jenkins.endpoint" : testJenkinsRestEndpoint,
"test.jenkins.usernamePassword" : testJenkinsUsernamePassword
] << usernameApiToken
}
javadoc {
source = sourceSets.main.allJava
options.with {
links "https://docs.oracle.com/${javadocPath}javase/${compatibilityVersion.toString().replaceAll(/.*\./,"")}/docs/api"
links "https://google.github.io/guice/api-docs/${dependencies.guiceVersion}/javadoc/"
addStringOption('Xdoclint:none', '-quiet')
addStringOption('source', compatibilityVersion.toString().replaceAll(/.*\./,""))
}
}