-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
134 lines (110 loc) · 3.33 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
plugins {
id 'java-library'
id 'maven'
id 'signing'
id 'maven-publish'
}
repositories {
jcenter()
mavenCentral()
}
def getNexusUsername() {
return hasProperty("nexusUsername") ? findProperty("nexusUsername") : ""
}
def getNexusPassword() {
return hasProperty("nexusPassword") ? findProperty("nexusPassword") : ""
}
def isRelease() {
findProperty("environment") == "release"
}
def resolveVersion() {
return findProperty("version") + (isRelease() ? "" : "-SNAPSHOT")
}
group = 'com.scayle.adminapi'
version = resolveVersion()
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
implementation 'com.google.guava:guava:32.0.1-jre'
compile 'com.google.code.gson:gson:2.10.1'
testImplementation 'junit:junit:4.13.2'
testImplementation 'net.javacrumbs.json-unit:json-unit-assertj:2.36.1'
testImplementation 'com.squareup.moshi:moshi:1.14.0'
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
testCompileOnly 'org.projectlombok:lombok:1.18.24'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.24'
compile 'com.squareup.okhttp3:okhttp:4.10.0'
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task fatJar(type: Jar) {
archiveClassifier = "all"
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
with jar
}
artifacts {
archives javadocJar, sourcesJar
}
signing {
def signingKeyId = findProperty("signingKeyId")
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
pom.groupId = project.group
pom.version = project.version
repository(url: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: getNexusUsername(), password: getNexusPassword())
}
snapshotRepository(url: "https://s01.oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: getNexusUsername(), password: getNexusPassword())
}
pom.project {
name 'SCAYLE AdminAPI SDK'
packaging 'jar'
description 'SCAYLE AdminAPI SDK'
url 'https://scayle.dev/en/developer-guide/introduction/apis#admin-api'
scm {
connection 'scm:git:[email protected]:scayle/admin-api-java-sdk.git'
developerConnection 'scm:git:[email protected]:scayle/admin-api-java-sdk.git'
url 'https://github.com/scayle/admin-api-java-sdk'
}
licenses {
license {
name 'The MIT License'
url 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id 'SCAYLE'
name 'SCAYLE Support'
email '[email protected]'
}
}
}
}
}
}
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
}