-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
120 lines (99 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
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"
}
group = 'com.scayle.storefrontapi'
version = '[VERSION]' + (isRelease() ? '' : '-SNAPSHOT')
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile 'com.google.guava:guava:29.0-jre'
compile 'com.google.code.gson:gson:2.8.6'
testImplementation 'junit:junit:4.13'
testImplementation 'net.javacrumbs.json-unit:json-unit-assertj:2.19.0'
testImplementation 'com.squareup.moshi:moshi:1.9.3'
compileOnly 'org.projectlombok:lombok:1.18.12'
annotationProcessor 'org.projectlombok:lombok:1.18.12'
testCompileOnly 'org.projectlombok:lombok:1.18.12'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.12'
compile 'com.squareup.okhttp3:okhttp:4.8.1'
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
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 Storefront API SDK'
packaging 'jar'
description 'SCAYLE Storefront API SDK'
url 'https://scayle.dev/en/dev/storefront-api/introduction'
scm {
connection 'scm:git:[email protected]:scayle/storefront-api-java-sdk.git'
developerConnection 'scm:git:[email protected]:scayle/storefront-api-java-sdk.git'
url 'https://github.com/scayle/storefront-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
}
}
}