-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathbuild.gradle
157 lines (136 loc) · 4.36 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
148
149
150
151
152
153
154
155
156
157
buildscript {
repositories {
jcenter()
}
}
plugins {
id 'jacoco'
}
apply plugin: 'idea'
apply plugin: 'eclipse'
group = 'jp.ne.paypay'
version = '1.0.8'
repositories {
jcenter()
}
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'pmd'
apply plugin: 'maven-publish'
apply plugin: 'signing'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
javadoc.options.encoding = 'UTF-8'
jacocoTestReport {
reports {
xml.enabled = true // coverage depends on xml format report
html.enabled = true
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: ['jp/ne/paypay/model/**', 'jp/ne/paypay/example/**'])
}))
}
}
def isDevBuild
def isReleaseBuild
if(hasProperty("release")) {
isReleaseBuild = true
} else {
isDevBuild = true
}
install {
repositories.mavenInstaller {
pom.artifactId = 'paypayopa'
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
task execute(type:JavaExec) {
main = System.getProperty('mainClass')
classpath = sourceSets.main.runtimeClasspath
}
java {
withJavadocJar()
withSourcesJar()
}
dependencies {
compile 'io.swagger:swagger-annotations:1.6.6'
compile 'com.squareup.okhttp:okhttp:2.7.5'
compile 'com.squareup.okhttp:logging-interceptor:2.7.5'
compile 'com.google.code.gson:gson:2.9.1'
compile ('com.auth0:java-jwt:3.19.2'){
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'
}
compile 'com.fasterxml.jackson.core:jackson-databind:2.13.3'
compile 'org.apache.commons:commons-lang3:3.12.0'
// validation
compile group: 'org.hibernate.validator', name: 'hibernate-validator', version: '7.0.5.Final'
compile group: 'org.hibernate.validator', name: 'hibernate-validator-annotation-processor', version: '7.0.5.Final'
compile group: 'jakarta.el', name: 'jakarta.el-api', version: '4.0.0'
compile group: 'org.glassfish', name: 'jakarta.el', version: '4.0.2'
testCompile 'org.mockito:mockito-core:4.4.0'
testCompile("org.junit.jupiter:junit-jupiter-engine:5.9.0")
testCompile("org.junit.platform:junit-platform-runner:1.9.0")
}
pmd{
consoleOutput = true
toolVersion = "6.21.0"
rulePriority = 5
ignoreFailures = true
ruleSets = ["category/java/errorprone.xml"]
}
artifacts {
archives javadocJar, sourcesJar
}
//********* artifact signing *********
if(isReleaseBuild) {
signing {
sign configurations.archives
}
}
uploadArchives {
repositories {
if (isDevBuild) {
mavenLocal()
}else{
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: System.getenv("OSSRH_USERNAME"), password: System.getenv("OSSRH_TOKEN"))
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: System.getenv("OSSRH_USERNAME"), password: System.getenv("OSSRH_TOKEN"))
}
pom.project {
name 'paypayopa'
packaging 'jar'
description 'PayPay OPA SDK'
url 'https://github.com/paypay/paypayopa-sdk-java'
scm {
connection 'scm:git:git@github.com:paypay/paypayopa-sdk-java.git'
developerConnection 'scm:git:git@github.com:paypay/paypayopa-sdk-java.git'
url 'https://github.com/paypay/paypayopa-sdk-java'
}
licenses {
license {
name 'The Apache License, Version 2.0'
url 'https://opensource.org/licenses/Apache-2.0'
}
}
developers {
developer {
id 'javidlulu'
name 'Jaavid Ahmed'
email 't-jaavidahmed.looloo@paypay-corp.co.jp'
}
}
}
}
}
}
}
test {
useJUnitPlatform()
}