-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
144 lines (120 loc) · 4.58 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
plugins {
id 'org.hidetake.swagger.generator' version '2.18.1'
id 'java'
}
group = 'pl.grzeslowski.jsupla.api'
version '4.1.0'
apply plugin: 'maven-publish'
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
}
// https://github.com/int128/gradle-swagger-generator-plugin
swaggerSources {
suplaCloud {
inputFile = file("${rootDir}/src/main/resources/openapi.yaml")
code {
language = 'java'
}
}
}
compileJava.dependsOn generateSwaggerCode
sourceSets.main.java.srcDir "${swaggerSources.suplaCloud.code.outputDir}/src/main/java"
sourceSets.main.resources.srcDir "${swaggerSources.suplaCloud.code.outputDir}/src/main/resources"
repositories {
mavenLocal()
mavenCentral()
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
dependencies {
implementation 'io.swagger.core.v3:swagger-annotations:2.0.0'
implementation 'com.squareup.okhttp:okhttp:2.7.5'
implementation 'com.squareup.okhttp:logging-interceptor:2.7.5'
implementation 'com.google.code.gson:gson:2.8.1'
implementation 'io.gsonfire:gson-fire:1.8.3'
implementation 'org.threeten:threetenbp:1.3.5'
implementation group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2'
implementation group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion
compileOnly "org.projectlombok:lombok:$lombokVersion"
testImplementation "org.projectlombok:lombok:$lombokVersion"
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
testAnnotationProcessor "org.projectlombok:lombok:$lombokVersion"
swaggerCodegen 'io.swagger.codegen.v3:swagger-codegen-cli:3.0.5' // or Swagger Codegen V3
testImplementation 'pl.grzeslowski.jsuplaservermock:jsupla-mock-server:0.10.0'
testImplementation "org.junit.jupiter:junit-jupiter-api:$jUnitVersion"
testImplementation "org.junit.jupiter:junit-jupiter-params:$jUnitVersion"
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '2.23.4'
testImplementation 'io.github.glytching:junit-extensions:2.3.0'
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.13.2'
testImplementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
testImplementation group: 'com.google.guava', name: 'guava', version: '29.0-jre'
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$jUnitVersion"
}
test {
useJUnitPlatform()
}
apply from: 'integration-tests.gradle'
apply plugin: 'maven'
apply plugin: 'signing'
task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
signing {
sign configurations.archives
}
group = project.group
archivesBaseName = project.name
version = project.version
def final githubRepo = "magx2/jSuplaApi"
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://s01.oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
//noinspection GroovyAssignabilityCheck
name project.name
description description
packaging 'jar'
url = "https://github.com/${githubRepo}"
scm {
connection "scm:git:git://github.com/${githubRepo}.git"
developerConnection "scm:git:git://github.com/${githubRepo}.git"
url "https://github.com/${githubRepo}.git"
}
licenses {
license {
//noinspection GroovyAssignabilityCheck
name "MIT"
url "https://opensource.org/licenses/MIT"
}
}
developers {
developer {
id 'magx2'
//noinspection GroovyAssignabilityCheck
name 'Martin Grzeslowski'
email 'hello@grzeslowski.pl'
}
}
}
}
}
}