-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle.kts
75 lines (64 loc) · 1.84 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
plugins {
kotlin("jvm") version "1.9.22"
application
`maven-publish`
}
group = "vadyushkins"
version = "1.1.1"
repositories { mavenCentral() }
dependencies {
testImplementation(kotlin("test"))
testImplementation("org.junit.jupiter:junit-jupiter-params:5.10.1")
implementation("org.jetbrains.kotlinx:kotlinx-cli:0.3.6")
}
tasks.test { useJUnitPlatform() }
kotlin { jvmToolchain(11) }
application { mainClass.set("org.kotgll.MainKt") }
tasks.withType<Jar> {
dependsOn.addAll(listOf("compileJava", "compileKotlin", "processResources"))
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest { attributes(mapOf("Main-Class" to application.mainClass)) }
val sourcesMain = sourceSets.main.get()
val contents =
configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) } +
sourcesMain.output
from(contents)
}
publishing {
publications {
create<MavenPublication>("kotgll") {
from(components["java"])
versionMapping {
usage("java-api") { fromResolutionOf("runtimeClasspath") }
usage("java-runtime") { fromResolutionResult() }
}
pom {
name.set("kotgll")
url.set("https://github.com/vadyushkins/kotgll")
licenses {
license {
name.set("MIT License")
url.set("https://github.com/vadyushkins/kotgll/blob/main/LICENSE")
}
}
developers {
developer {
id.set("vadyushkins")
name.set("Vadim Abzalov")
email.set("[email protected]")
}
}
}
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/vadyushkins/kotgll")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}