-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
117 lines (104 loc) · 3.52 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
import org.ajoberstar.grgit.Grgit
import java.util.*
plugins {
java
id("org.ajoberstar.grgit") version "5.2.2"
`java-library`
`maven-publish`
signing
}
if (!File("$rootDir/.git").exists()) {
logger.lifecycle(
"""
**************************************************************************************
You need to fork and clone this repository! Don't download a .zip file.
If you need assistance, consult the GitHub docs: https://docs.github.com/get-started/quickstart/fork-a-repo
**************************************************************************************
""".trimIndent()
).also { System.exit(1) }
}
group = "dev.themeinerlp"
var baseVersion by extra("1.1.0")
var extension by extra("")
var snapshot by extra("")
ext {
val git: Grgit = Grgit.open {
dir = File("$rootDir/.git")
}
val revision = git.head().abbreviatedId
extension = "%s+%s".format(Locale.ROOT, snapshot, revision)
}
version = "%s%s".format(Locale.ROOT, baseVersion, extension)
repositories {
mavenCentral()
}
dependencies {
implementation("net.lingala.zip4j:zip4j:2.11.5")
implementation("com.google.code.gson:gson:2.10.1")
}
tasks {
test {
useJUnitPlatform()
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components.findByName("java"))
groupId = "dev.themeinerlp"
artifactId = "plugin-debug"
version = "%s%s".format(Locale.ROOT, baseVersion, snapshot)
pom {
name.set("Plugin debug")
description.set("A simple library to upload plugin debugs")
url.set("https://github.com/OneLiteFeatherNET/Plugin-Debug")
licenses {
license {
name.set("AGPL-3.0")
url.set("https://github.com/OneLiteFeatherNET/Plugin-Debug/blob/main/LICENSE")
}
}
issueManagement {
system.set("Github")
url.set("https://github.com/OneLiteFeatherNET/Plugin-Debug/issues")
}
developers {
developer {
id.set("TheMeinerLP")
name.set("Phillipp Glanz")
email.set("[email protected]")
}
}
scm {
connection.set("scm:[email protected]:OneLiteFeatherNET/Plugin-Debug.git")
developerConnection.set("scm:[email protected]:OneLiteFeatherNET/Plugin-Debug.git")
url.set("https://github.com/OneLiteFeatherNET/Plugin-Debug")
}
}
}
}
repositories {
maven {
val releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = if (version.toString().contains("SNAPSHOT")) uri(snapshotsRepoUrl) else uri(releasesRepoUrl)
credentials {
username = System.getenv("OSSRH_USERNAME")
password = System.getenv("OSSRH_PASSWORD")
}
}
}
}
signing {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications)
}