-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
125 lines (110 loc) · 4.16 KB
/
build.gradle.kts
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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
java
`java-library`
`maven-publish`
id("com.github.johnrengelman.shadow") version "8.1.1"
}
description = "FunnyCommands|Parent"
allprojects {
apply(plugin = "java-library")
apply(plugin = "signing")
apply(plugin = "maven-publish")
group = "net.dzikoysk"
version = "0.7.4"
repositories {
mavenCentral()
maven {
name = "reposilite-repository"
url = uri("https://maven.reposilite.com/releases")
}
maven {
name = "spigot-repository"
url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}
maven {
name = "sonatype-repository"
url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
}
publishing {
repositories {
maven {
name = "reposilite-repository"
url = uri("https://maven.reposilite.com/${if (version.toString().endsWith("-SNAPSHOT")) "snapshots" else "releases"}")
credentials {
username = getEnvOrProperty("MAVEN_NAME", "mavenUser")
password = getEnvOrProperty("MAVEN_TOKEN", "mavenPassword")
}
}
}
}
afterEvaluate {
description
?.takeIf { it.isNotEmpty() }
?.split("|")
?.let { (projectName, projectDescription) ->
publishing {
publications {
create<MavenPublication>("library") {
pom {
name.set(projectName)
description.set(projectDescription)
url.set("https://github.com/FunnyGuilds/FunnyCommands")
licenses {
license {
name.set("Apache-2.0 license")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("dzikoysk")
name.set("dzikoysk")
email.set("[email protected]")
}
developer {
id.set("peridot")
name.set("Peridot")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git://github.com/FunnyGuilds/FunnyCommands.git")
developerConnection.set("scm:git:ssh://github.com/FunnyGuilds/FunnyCommands.git")
url.set("https://github.com/FunnyGuilds/FunnyCommands.git")
}
}
from(components.getByName("java"))
}
}
}
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
subprojects {
java {
withJavadocJar()
withSourcesJar()
}
tasks.withType<Test> {
useJUnitPlatform()
setForkEvery(1)
maxParallelForks = 4
testLogging {
events(TestLogEvent.STARTED, TestLogEvent.PASSED, TestLogEvent.FAILED, TestLogEvent.SKIPPED)
exceptionFormat = TestExceptionFormat.FULL
showExceptions = true
showCauses = true
showStackTraces = true
showStandardStreams = true
}
}
}
fun getEnvOrProperty(env: String, property: String): String? =
System.getenv(env) ?: findProperty(property)?.toString()