This repository has been archived by the owner on Apr 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
91 lines (78 loc) · 2.29 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
plugins {
`java-library`
`maven-publish`
}
group = "net.gigaclub"
version = "14.0.1.0.3"
val myArtifactId: String = rootProject.name
val myArtifactGroup: String = project.group.toString()
val myArtifactVersion: String = project.version.toString()
val GITHUB_PACKAGES_USERID: String by project
val GITHUB_PACKAGES_PUBLISH_TOKEN: String by project
val myGithubUsername = "GigaClub"
val myGithubHttpUrl = "https://github.com/$myGithubUsername/$myArtifactId"
val myGithubIssueTrackerUrl = "https://github.com/$myGithubUsername/$myArtifactId/issues"
val myLicense = "MIT"
val myLicenseUrl = "https://opensource.org/licenses/MIT"
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
repositories {
mavenCentral()
}
dependencies {
api("org.apache.xmlrpc:xmlrpc-client:3.1.3")
api("org.json:json:20180813")
}
val sourcesJar by tasks.creating(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.getByName("main").allSource)
from("LICENCE.md") {
into("META-INF")
}
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/$myGithubUsername/$myArtifactId")
credentials {
username = GITHUB_PACKAGES_USERID
password = GITHUB_PACKAGES_PUBLISH_TOKEN
}
}
}
}
publishing {
publications {
register("gprRelease", MavenPublication::class) {
groupId = myArtifactGroup
artifactId = myArtifactId
version = myArtifactVersion
from(components["java"])
artifact(sourcesJar)
pom {
packaging = "jar"
name.set(myArtifactId)
url.set(myGithubHttpUrl)
scm {
url.set(myGithubHttpUrl)
}
issueManagement {
url.set(myGithubIssueTrackerUrl)
}
licenses {
license {
name.set(myLicense)
url.set(myLicenseUrl)
}
}
developers {
developer {
id.set(myGithubUsername)
}
}
}
}
}
}