forked from PaperMC/PaperLib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
139 lines (121 loc) · 3.65 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
plugins {
java
`maven-publish`
}
val javadoc by tasks.existing(Javadoc::class)
val jar by tasks.existing
group = "gg.solarmc.paperlib" // Solar
version = "1.0.7-SNAPSHOT"
val mcVersion = "1.16.5-R0.1-SNAPSHOT"
repositories {
mavenCentral()
/* Solar start
maven("https://papermc.io/repo/repository/maven-public/")
maven("https://oss.sonatype.org/content/groups/public/")
*/
maven("https://repo.solarmc.gg/mvn")
// Solar end
}
dependencies {
/* Solar start
compileOnly("com.google.code.findbugs:jsr305:1.3.9")
compileOnly("com.destroystokyo.paper:paper-api:$mcVersion")
*/
implementation("gg.solarmc.paper:solarpaper-api:1.2.1")
// Solar end
}
java {
// Solar start
sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16
// Solar end
}
val sourcesJar by tasks.registering(Jar::class) {
classifier = "sources"
from(sourceSets["main"].allSource)
}
javadoc {
isFailOnError = false
}
val javadocJar by tasks.registering(Jar::class) {
dependsOn(javadoc)
classifier = "javadoc"
from(javadoc)
}
// A couple aliases just to simplify task names
tasks.register("install") {
group = "publishing"
description = "Alias for publishToMavenLocal"
dependsOn(tasks.named("publishToMavenLocal"))
}
tasks.register("deploy") {
group = "publishing"
description = "Alias for publish"
dependsOn(tasks.named("publish"))
}
artifacts {
add("archives", sourcesJar)
add("archives", javadocJar)
}
publishing {
publications {
register<MavenPublication>("mavenJava") {
from(components["java"])
artifact(sourcesJar.get())
artifact(javadocJar.get())
// Solar start - modify details
pom {
name.set("PaperLib")
description.set("Plugin library for interfacing with Paper specific APIs with graceful fallback that maintains Spigot compatibility.")
url.set("https://github.com/SolarMC-Dev/PaperLib")
scm {
url.set("https://github.com/SolarMC-Dev/PaperLib")
}
issueManagement {
system.set("github")
url.set("https://github.com/SolarMC-Dev/PaperLib/issues")
}
licenses {
license {
name.set("MIT")
url.set("https://opensource.org/licenses/MIT")
}
license {
name.set("GNU Lesser General Public License, Version 3")
url.set("https://www.gnu.org/licenses/")
}
}
}
// Solar end
}
}
if (project.hasProperty("papermcRepoUser") && project.hasProperty("papermcRepoPass")) {
val papermcRepoUser: String by project
val papermcRepoPass: String by project
val repoUrl = if (version.toString().endsWith("-SNAPSHOT")) {
"https://papermc.io/repo/repository/maven-snapshots/"
} else {
"https://papermc.io/repo/repository/maven-releases/"
}
repositories {
maven {
url = uri(repoUrl)
name = "Paper"
credentials {
username = papermcRepoUser
password = papermcRepoPass
}
}
}
}
// Solar start
repositories.maven {
credentials {
username = System.getenv("REPO_USER")
password = System.getenv("REPO_PASS")
}
name = "solar-repo"
url = uri("https://maven.cloudsmith.io/solarmc/oss-lesser-gpl3")
}
// Solar end
}