This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
147 lines (130 loc) · 4.17 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
plugins {
id 'idea'
id 'java'
id 'jvm-test-suite'
id 'maven-publish'
id 'signing'
id 'com.palantir.git-version' version "3.0.0"
id "io.freefair.lombok" version "8.0.1"
}
repositories {
mavenCentral()
}
ext {
jacksonVersion = '2.15.2'
jacksonDatabindVersion = '2.15.2'
}
dependencies {
implementation 'org.apache.logging.log4j:log4j-api:2.20.0'
implementation 'org.apache.logging.log4j:log4j-core:2.20.0'
implementation "com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion"
implementation "com.fasterxml.jackson.core:jackson-core:$jacksonVersion"
implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion"
testImplementation 'commons-io:commons-io:2.13.0'
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.3'
testImplementation 'org.mock-server:mockserver-junit-jupiter-no-dependencies:5.15.0'
testImplementation 'org.apache.logging.log4j:log4j-api:2.20.0'
testImplementation 'org.apache.logging.log4j:log4j-core:2.20.0'
}
tasks.named('test') {
useJUnitPlatform()
}
test {
filter {
// Don't execute the examples by default, as these create test orders and need a token to run
excludeTestsMatching("com.duffel.example.*")
}
}
testing {
suites {
test {}
example(JvmTestSuite) {
testType = TestSuiteType.INTEGRATION_TEST
dependencies {
implementation project
}
sources {
java {
srcDirs = ["src/test/java/com/duffel/example"]
}
}
targets {
all {
testTask.configure {
shouldRunAfter(test)
}
}
}
}
}
}
configurations {
exampleImplementation.extendsFrom(testImplementation)
exampleRuntimeOnly.extendsFrom(testRuntimeOnly)
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
release(MavenPublication) {
from components.java
if (project.hasProperty('sign')) {
signing {
useInMemoryPgpKeys(
property('SIGNING_KEY_ID'),
property('SIGNING_KEY'),
property('SIGNING_PASSWORD')
)
sign publishing.publications.release
sign configurations.archives
}
}
pom {
name = 'duffel-api'
group = 'com.duffel'
version = gitVersion(null)
description = 'Java SDK for Duffel'
url = 'http://www.duffel.com'
scm {
url = 'https://github.com/duffelhq/duffel-api-java'
}
licenses {
license {
name = 'MIT License'
url = 'https://github.com/duffelhq/duffel-api-java/blob/main/LICENSE'
}
}
developers {
developer {
id = 'Duffel'
name = 'Duffel'
email = '[email protected]'
}
}
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = findProperty("SONATYPE_USERNAME")
password = findProperty("SONATYPE_PASSWORD")
}
}
}
}
javadoc {
options.addBooleanOption('html5', true)
options.addStringOption('Xdoclint:all,-missing', '-quiet')
}
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
group = "com.duffel"
archivesBaseName = "api"
version = "0.0.1"