-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.gradle
114 lines (99 loc) · 4.39 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
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.3.0"
}
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 {
mavenCentral()
}
dependencies {
ext.autoValueVersion = '1.10.4'
ext.jcloudsVersion = '2.5.0'
ext.guiceVersion = '5.1.0'
ext.autoServiceVersion = '1.1.1'
ext.guiceVersion = '5.0.1'
implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation 'javax.annotation:javax.annotation-api:1.3.2'
// The ArtifactApi takes in org.jclouds.io.Payload, so it must be exposed as an API
api("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.25.1')
testImplementation ('org.testng:testng:7.9.0')
testImplementation ('com.squareup.okhttp:mockwebserver:2.7.5')
testImplementation ('ch.qos.logback:logback-core:1.4.14')
testImplementation ('ch.qos.logback:logback-classic:1.4.14')
}
ext.compatibilityVersion = JavaVersion.VERSION_1_8
sourceCompatibility = compatibilityVersion
targetCompatibility = compatibilityVersion
jar {
manifest {
attributes 'Implementation-Title': 'Artifactory 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) {
useTestNG()
include "**/**MockTest.class"
testLogging {
showStandardStreams = true
events 'started', 'passed', 'failed'
}
}
task integTest(type: Test, dependsOn: ['mockTest']) {
useTestNG()
include "**/StorageApiLiveTest.class"
testLogging {
showStandardStreams = true
events 'started', 'passed', 'failed'
}
def authentication = [:]
def possibleAuth = project.findProperty('testArtifactoryRestCredentials')
if (possibleAuth) {
authentication['test.artifactory.rest.credentials'] = possibleAuth
} else {
possibleAuth = project.findProperty('testArtifactoryRestToken')
if (possibleAuth) {
authentication['test.artifactory.rest.token'] = possibleAuth
} else {
logger.quiet 'No authentication parameters found. Assuming anonymous...'
}
}
// property 'test.artifactory.endpoint' needs to be
// hard-coded in for jclouds test framework
systemProperties = ["test.artifactory.endpoint" : "${testArtifactoryRestEndpoint}",
"test.artifactory.docker.repo" : "${testArtifactoryRestDockerRepo}",
"test.artifactory.docker.repo.promoted" : "${testArtifactoryRestDockerPromotedRepo}",
"test.artifactory.docker.image" : "${testArtifactoryRestDockerImage}",
"test.artifactory.docker.tag" : "${testArtifactoryRestDockerTag}"] << authentication
}
javadoc {
source = sourceSets.main.allJava
options.with {
links "https://docs.oracle.com/javase/${compatibilityVersion.toString().split("\\.").last()}/docs/api"
links "https://google.github.io/guice/api-docs/${dependencies.guiceVersion}/javadoc/"
links "https://javadoc.io/doc/org.apache.jclouds/jclouds-core/${dependencies.jcloudsVersion}"
addStringOption('Xdoclint:none', '-quiet')
addStringOption('source', '8')
}
}