-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
113 lines (92 loc) · 2.76 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
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
}
group 'com.azuriom'
version '1.0.0-SNAPSHOT'
ext {
isReleaseVersion = !version.endsWith('SNAPSHOT')
}
java {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
repositories {
mavenCentral()
}
dependencies {
api 'com.google.code.gson:gson:2.10.1'
compileOnlyApi 'org.jetbrains:annotations:24.1.0'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
test {
useJUnitPlatform()
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'AzAuth'
description = 'A Java implementation of the Azuriom Auth API.'
url = 'https://github.com/Azuriom/AzAuth'
licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'mrmicky'
name = 'MrMicky'
email = '[email protected]'
}
}
issueManagement {
system = 'GitHub Issues'
url = 'https://github.com/Azuriom/AzAuth/issues'
}
scm {
connection = 'scm:git:https://github.com/Azuriom/AzAuth.git'
developerConnection = 'scm:git:[email protected]:Azuriom/AzAuth.git'
url = 'https://github.com/Azuriom/AzAuth'
}
}
}
}
repositories {
maven {
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
url = isReleaseVersion ? releasesRepoUrl : snapshotsRepoUrl
credentials {
username = findProperty('ossrhUsername') ?: System.getenv('SONATYPE_USERNAME')
password = findProperty('ossrhPassword') ?: System.getenv('SONATYPE_PASSWORD')
}
}
}
}
signing {
def signingKey = System.getenv('SIGNING_KEY')
def signingPassword = System.getenv('SIGNING_PASSWORD')
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}