-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
135 lines (118 loc) · 3.85 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
plugins {
id "java"
id "com.diffplug.spotless" version "${spotlessVersion}"
id "maven-publish"
id "signing"
id "com.github.nbaztec.coveralls-jacoco" version "${coverallsJacocoVersion}"
id "jacoco"
}
group = "com.box"
archivesBaseName = "box-java-sdk-gen"
version = "0.6.1"
java {
sourceCompatibility = "${libraryJavaVersion}"
targetCompatibility = "${libraryJavaVersion}"
withSourcesJar()
withJavadocJar()
}
repositories {
mavenCentral()
}
dependencies {
implementation "com.fasterxml.jackson.core:jackson-annotations:${jacksonAnnotationVersion}"
implementation "com.fasterxml.jackson.core:jackson-core:${jacksonCoreVersion}"
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonDatabindVersion}"
implementation "com.squareup.okhttp3:okhttp:${okhttpVersion}"
implementation "com.squareup.okio:okio:${okioVersion}"
implementation "org.bitbucket.b_c:jose4j:${jose4jVersion}"
implementation "org.bouncycastle:bcprov-jdk18on:${bouncyCastleBcprovJdk18onVersion}"
implementation "org.bouncycastle:bcpkix-jdk18on:${bouncyCastleBcpkixJdk18onVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitApiVersion}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitEngineVersion}"
}
spotless {
java {
googleJavaFormat "${googleJavaFormatVersion}"
target "src/**/*.java"
}
}
test {
useJUnitPlatform()
testLogging {
events = ['passed', 'failed', 'skipped']
showStandardStreams = true
}
jacoco {
destinationFile = file("$buildDir/jacoco/test.exec")
}
filter {
// Additional params are not supported
excludeTestsMatching 'com.box.sdkgen.test.filemetadata.FileMetadataITest.testGlobalFileMetadata'
excludeTestsMatching 'com.box.sdkgen.test.foldermetadata.FolderMetadataITest.testGlobalFolderMetadata'
// Socket timeout
excludeTestsMatching 'com.box.sdkgen.test.transfer.TransferITest.testTransferUserContent'
}
}
publishing {
publications {
boxJavaSdkGen(MavenPublication) {
from components.java
pom {
artifactId = project.getArchivesBaseName()
name = "Box Java SDK Gen"
description = "Official Box Java Generated SDK."
url = "https://opensource.box.com/box-java-sdk-gen/"
packaging = "jar"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "box"
name = "box"
email = "[email protected]"
}
}
scm {
connection = "scm:git:https://github.com/box/box-java-sdk-gen.git"
developerConnection = "scm:git:https://github.com/box/box-java-sdk-gen.git"
url = "https://github.com/box/box-java-sdk-gen"
}
}
}
}
repositories {
maven {
name = "sonatype"
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl
if (project.hasProperty("ossrhUsername") && project.hasProperty("ossrhPassword")) {
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}
}
signing {
required { !version.endsWith("SNAPSHOT") && gradle.taskGraph.hasTask("publish") }
// we are switching to gpg-agent and not using Java-based implementation because of
// org.bouncycastle:bc-fips:1.0.2.1 libray preset in our Docker machines which is
// not compatible with Gradle implementation
useGpgCmd()
sign publishing.publications.boxJavaSdkGen
}
jacoco {
reportsDirectory = file("$buildDir/reports/jacoco")
}
jacocoTestReport {
reports {
xml.required = true
html.required = true
}
}