This repository was archived by the owner on Nov 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
92 lines (80 loc) · 2.38 KB
/
build.gradle.kts
File metadata and controls
92 lines (80 loc) · 2.38 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.net.URI
plugins {
kotlin("jvm") version "1.8.21"
id("org.jetbrains.dokka") version "1.9.20"
`java-gradle-plugin`
`maven-publish`
}
group = "io.github.headlesshq"
version = "0.4.0"
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
}
repositories {
mavenCentral()
maven {
name = "3arthMaven"
url = URI("https://3arthqu4ke.github.io/maven")
}
}
dependencies {
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
implementation("me.earth.headlessmc:headlessmc-launcher:2.2.0")
implementation("me.earth.headlessmc:headlessmc-jline:2.2.0")
}
tasks.test {
useJUnitPlatform()
}
tasks.withType<JavaCompile> {
if (JavaVersion.current().isJava9Compatible) {
options.release.set(8)
}
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
val dokkaJavadocJar: TaskProvider<Jar> by tasks.registering(Jar::class) {
dependsOn(tasks.getByName("dokkaJavadoc"))
archiveClassifier.set("javadoc")
from(tasks.getByName("dokkaJavadoc").property("outputDirectory"))
}
gradlePlugin {
plugins {
create("simplePlugin") {
id = "io.github.headlesshq.headlessmc-gradle-plugin"
implementationClass = "io.github.headlesshq.headlessmc.gradle.HeadlessMcPlugin"
}
}
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = "${project.group}"
artifactId = project.base.archivesName.get()
version = "${project.version}"
from(components.getByName("java"))
artifact(dokkaJavadocJar)
}
}
repositories {
if (System.getenv("DEPLOY_TO_GITHUB_PACKAGES_URL") != null) {
maven {
name = "GithubPagesMaven"
url = URI(System.getenv("DEPLOY_TO_GITHUB_PACKAGES_URL"))
credentials {
username = System.getenv("GITHUB_USER")
password = System.getenv("GITHUB_TOKEN")
}
}
} else {
maven {
name = "BuildDirMaven"
url = rootProject.layout.buildDirectory.dir("maven").get().asFile.toURI()
}
}
}
}