-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
174 lines (149 loc) · 5.06 KB
/
build.gradle
File metadata and controls
174 lines (149 loc) · 5.06 KB
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
plugins {
id "java"
id "com.github.bjornvester.xjc" version "1.8.2"
id 'java-library'
id "maven-publish"
id "signing"
id "org.jreleaser" version "1.20.0"
id "org.sonarqube" version "6.0.1.5171"
}
group = 'com.altapay'
version = '3.1.10'
repositories {
mavenCentral()
}
sourceSets {
integrationTest {
compileClasspath += main.output
runtimeClasspath += main.output
}
}
configurations {
integrationTestImplementation.extendsFrom implementation
integrationTestRuntimeOnly.extendsFrom runtimeOnly
}
dependencies {
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.2'
implementation 'net.sourceforge.javacsv:javacsv:2.0'
implementation 'commons-collections:commons-collections:3.2.2'
implementation 'commons-codec:commons-codec:1.17.1'
testImplementation platform('org.junit:junit-bom:5.11.4')
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-params'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly 'org.glassfish.jaxb:jaxb-runtime:3.0.2'
integrationTestImplementation platform('org.junit:junit-bom:5.11.4')
integrationTestImplementation 'org.junit.jupiter:junit-jupiter-api'
integrationTestImplementation 'org.junit.jupiter:junit-jupiter-params'
integrationTestRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
integrationTestRuntimeOnly 'org.glassfish.jaxb:jaxb-runtime:3.0.2'
}
xjc {
xjcVersion.set("3.0.2")
useJakarta.set(true)
markGenerated.set(true)
xsdDir.set(layout.projectDirectory.dir("src/main/resources/xsd"))
outputResourcesDir.set(layout.projectDirectory.dir("generated"))
defaultPackage.set("com.pensio.api.generated")
bindingFiles = layout.files(layout.projectDirectory.file("src/main/resources/xsd/bindings.xjb"))
}
test {
useJUnitPlatform()
}
tasks.register("integrationTest", Test) {
description = 'Runs integration tests.'
group = 'verification'
testClassesDirs = sourceSets.integrationTest.output
classpath = sourceSets.integrationTest.runtimeClasspath
shouldRunAfter(tasks.test)
useJUnitPlatform()
}
sonar {
properties {
property "sonar.projectKey", "AltaPay_sdk-java_69a0e28c-3133-48fd-8372-6c73a9cba728"
property "sonar.host.url", System.getenv("SONAR_HOST_URL") ?: System.getProperty("sonar.host.url")
property "sonar.token", System.getenv("SONAR_TOKEN") ?: System.getProperty("sonar.token")
property "sonar.scm.disabled", "true"
property "sonar.cpd.exclusions", "**/*"
property "sonar.duplications.exclusions", "**/*"
property "sonar.coverage.exclusions", "**/*"
property "sonar.java.coveragePlugin", "none"
// Fail build if Quality Gate fails
property "sonar.qualitygate.wait", "true"
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = "sdk-java"
from components.java
pom {
name = "sdk-java"
description = "JavaSDK - for integrating Java projects with the AltaPay gateway."
url = "https://github.com/AltaPay/sdk-java"
scm {
connection = "scm:https://github.com/AltaPay/sdk-java.git"
developerConnection = "scm:git://github.com:AltaPay/sdk-java.git"
url = "https://github.com/AltaPay/sdk-java"
}
licenses {
license {
name = "MIT License"
url = "https://github.com/AltaPay/sdk-java/blob/master/LICENSE"
}
}
developers {
developer {
id = "altapay"
name = "AltaPay"
email = "3rdpartydeps@altapay.com"
}
}
}
}
}
repositories {
maven {
name = "localStaging"
url = uri("${buildDir}/staging-deploy")
}
}
}
signing {
sign publishing.publications.mavenJava
}
tasks.named("jreleaserDeploy").configure {
dependsOn(
tasks.named("publishMavenJavaPublicationToLocalStagingRepository")
)
}
jreleaser {
project {
name = "sdk-java"
description = "JavaSDK - for integrating Java projects with the AltaPay gateway."
links { homepage = "https://github.com/AltaPay/sdk-java" }
}
deploy {
maven {
mavenCentral {
sonatype {
active = 'ALWAYS'
url = 'https://central.sonatype.com/api/v1/publisher'
username = providers.gradleProperty("jreleaser.mavencentral.username").orNull
password = providers.gradleProperty("jreleaser.mavencentral.password").orNull
// Artifacts are already signed by Gradle
sign = false
// Path where Gradle stages the signed repo
stagingRepository("${buildDir}/staging-deploy")
}
}
}
}
}