forked from J4C0B3Y/ConfigAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
100 lines (82 loc) · 2.35 KB
/
build.gradle.kts
File metadata and controls
100 lines (82 loc) · 2.35 KB
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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import java.nio.charset.StandardCharsets
import kotlin.io.path.Path
plugins {
java
`maven-publish`
`java-library`
id("io.freefair.lombok") version "9.4.0"
id("com.gradleup.shadow") version "9.3.0"
}
object Project {
const val NAME = "ConfigAPI"
const val GROUP = "net.j4c0b3y"
const val VERSION = "1.2.11"
}
allprojects {
repositories {
mavenCentral()
}
}
subprojects {
apply {
plugin("java")
plugin("java-library")
plugin("io.freefair.lombok")
plugin("maven-publish")
plugin("com.gradleup.shadow")
}
dependencies {
compileOnly("org.jspecify:jspecify:1.0.0")
}
if (project.name == "paper") {
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
withSourcesJar()
}
} else {
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withSourcesJar()
}
}
tasks {
compileJava {
options.encoding = StandardCharsets.UTF_8.name()
}
register<Copy>("copy") {
from(shadowJar)
rename("(.*)-all.jar", "${Project.NAME}-${this@subprojects.name}-${Project.VERSION}.jar")
into(Path(rootDir.path, "jars"))
}
shadowJar {
exclude("org/jetbrains/**")
exclude("org/intellij/**")
}
build { dependsOn(named("copy")) }
}
publishing {
repositories {
maven("https://repo.j4c0b3y.net/public/") {
name = "j4c0b3yPublic"
credentials(PasswordCredentials::class)
authentication {
create<BasicAuthentication>("basic")
}
}
}
publications {
create<MavenPublication>(name) {
artifactId = Project.NAME + "-" + name
groupId = Project.GROUP
version = Project.VERSION
artifact(tasks.named<ShadowJar>("shadowJar").get().archiveFile)
artifact(tasks.named<Jar>("sourcesJar").get().archiveFile) {
classifier = "sources"
}
}
}
}
}