-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
70 lines (62 loc) · 1.92 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.konan.properties.Properties
plugins {
`maven-publish`
kotlin("jvm") version "2.1.0"
}
group = "me.theevilroot"
version = "1.2"
repositories {
mavenCentral()
}
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0")
testImplementation("junit:junit:4.13.2")
}
val sourcesJar by tasks.registering(Jar::class) {
classifier = "sources"
from(sourceSets.main.get().allSource)
}
publishing {
repositories {
maven {
val localProps = Properties()
if (rootProject.file("local.properties").exists())
localProps.load(rootProject.file("local.properties").reader())
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/TheEvilRoot/async-coroutines-socket")
credentials {
username = localProps.getOrDefault("gpr.user",
System.getenv("USERNAME")) as? String?
password = localProps.getOrDefault("gpr.key",
System.getenv("TOKEN")) as? String?
}
}
}
publications {
create<MavenPublication>("maven") {
groupId = "me.theevilroot"
artifactId = "coroutine-async-socket"
version = version
from(components["java"])
}
register<MavenPublication>("gpr") {
groupId = "me.theevilroot"
artifactId = "coroutine-async-socket"
version = version
from(components["java"])
artifact(sourcesJar.get())
}
register("mavenJava", MavenPublication::class) {
from(components["java"])
artifact(sourcesJar.get())
}
}
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
tasks.withType<JavaCompile> {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}