-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
107 lines (103 loc) · 4.2 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
import java.net.URI
plugins {
kotlin("jvm") version "1.6.10"
java
id("org.jlleitschuh.gradle.ktlint") version "10.2.1"
id("maven-publish")
}
allprojects {
repositories {
mavenCentral()
}
apply<org.jlleitschuh.gradle.ktlint.KtlintPlugin>()
apply<org.jetbrains.kotlin.gradle.plugin.KotlinPlatformJvmPlugin>()
if (this != rootProject) {
apply<MavenPublishPlugin>()
apply<JavaPlugin>()
apply<SigningPlugin>()
java {
withJavadocJar()
withSourcesJar()
}
afterEvaluate {
val mavenCentralPublishing:String by project
if(mavenCentralPublishing.toBoolean()){
configure<SigningExtension> {
val signingKeyLocation: String by project
val secretKey = File(signingKeyLocation).readText()
val signingPassword: String by project
useInMemoryPgpKeys(secretKey, signingPassword)
publishing.publications.configureEach {
sign(this)
}
}
publishing {
val nexusUsername: String by project
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
configureEach {
if (this !is MavenPublication) return@configureEach
if (name == "jvm") {
artifact(tasks.getByName("javadocJar")) {
classifier = "javadoc"
}
}
version = project.version.toString()
pom {
name = "An YAKL ${project.name} module"
description = name.get()
url = "https://github.com/MEJIOMAH17/yakl"
licenses {
license {
name = "MIT"
url = "https://opensource.org/license/mit/"
}
}
developers {
developer {
id = nexusUsername
name = "Mark Epshtein"
email = "epshteinme@gmail.com"
}
}
scm {
url = "scm:git:git://github.com/MEJIOMAH17/yakl.git"
connection = "scm:git:ssh://git@github.com/MEJIOMAH17/yakl.git"
developerConnection = "https://github.com/MEJIOMAH17/yakl"
}
}
}
repositories {
maven {
val releasesRepoUrl =
URI.create("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
name = "mavenCentral"
url = releasesRepoUrl
val nexusToken: String by project
credentials {
username = nexusUsername
password = nexusToken
}
}
}
}
}
}
}
}
dependencies {
testImplementation("io.kotest:kotest-assertions-core:5.0.3")
testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
}
tasks.withType<Test> {
useJUnitPlatform()
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "1.8"
}
}
}