-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
95 lines (83 loc) · 2.6 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
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
}
sourceCompatibility = 11
targetCompatibility = 11
group = 'gs.mclo'
version = project.findProperty("release") ?: "dev"
ext.isReleaseVersion = version != "dev" && !version.endsWith("SNAPSHOT")
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.3'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.3'
implementation 'com.google.code.gson:gson:2.10.1'
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
java {
withJavadocJar()
withSourcesJar()
}
jar {
from sourceSets.main.allSource
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'api'
from components.java
pom {
name = 'mclo.gs API'
description = 'The official java library for the mclo.gs API'
url = 'https://github.com/aternosorg/mclogs-java'
licenses {
license {
name = 'MIT'
url = 'https://github.com/aternosorg/mclogs-java/blob/master/LICENSE'
}
}
developers {
developer {
id = 'julian'
name = 'Julian Vennen'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:https://github.com/aternosorg/mclogs-java.git'
developerConnection = 'scm:git:[email protected]:aternosorg/mclogs-java.git'
url = 'https://github.com/aternosorg/mclogs-java'
}
}
}
}
repositories {
maven {
def releaseRepo = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotRepo = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = isReleaseVersion ? releaseRepo : snapshotRepo
credentials {
username = findProperty('OSSRH_USERNAME')
password = findProperty('OSSRH_PASSWORD')
}
}
}
}
signing {
def signingKey = findProperty("SIGNING_KEY").toString()
def signingPassword = findProperty("SIGNING_PASSPHRASE").toString()
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}
tasks.withType(Sign).configureEach {
onlyIf { isReleaseVersion }
}