forked from cdancy/jenkins-rest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
108 lines (96 loc) · 3.46 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
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1'
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
}
}
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'com.github.johnrengelman.shadow'
apply from: "$rootDir/gradle/additional-artifacts.gradle"
apply from: "$rootDir/gradle/dependencies.gradle"
apply from: "$rootDir/gradle/documentation.gradle"
apply from: "$rootDir/gradle/publishing.gradle"
apply from: "$rootDir/gradle/release.gradle"
repositories {
jcenter()
mavenCentral()
}
dependencies {
ext.jcloudsVersion = '2.1.2'
compile ("org.apache.jclouds:jclouds-core:${jcloudsVersion}")
compile ('com.google.auto.service:auto-service:1.0-rc3')
compile ('com.google.auto.value:auto-value-annotations:1.6.2')
compileOnly ('com.google.auto.value:auto-value:1.6.2')
testCompile ("org.apache.jclouds:jclouds-core:${jcloudsVersion}:tests")
testCompile ("org.apache.jclouds.driver:jclouds-slf4j:${jcloudsVersion}")
testCompile ('org.testng:testng:6.11')
testCompile ('org.assertj:assertj-core:3.8.0')
testCompile ('com.squareup.okhttp:mockwebserver:2.7.5')
testCompile ('ch.qos.logback:logback-core:1.2.3')
testCompile ('ch.qos.logback:logback-classic:1.2.3')
}
ext.compatibilityVersion = '1.8'
sourceCompatibility = compatibilityVersion
targetCompatibility = compatibilityVersion
jar {
manifest {
attributes 'Implementation-Title': 'Jenkins REST client',
'Implementation-Version': version,
'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) {
useTestNG()
include '**/**MockTest*'
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*"
maxParallelForks = 1
testLogging {
showStandardStreams = true
events 'started', 'passed', 'failed'
}
def authentication = [:]
def possibleAuth = project.findProperty('testJenkinsRestCredentials')
if (possibleAuth) {
authentication['test.jenkins.rest.credentials'] = possibleAuth
} else {
possibleAuth = project.findProperty('testJenkinsRestToken')
if (possibleAuth) {
authentication['test.jenkins.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.jenkins.endpoint" : "${testJenkinsRestEndpoint}",
"test.jenkins.basedir" : "${buildDir}/integ-projects"] << authentication
}