-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
111 lines (95 loc) · 3.07 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
108
109
110
111
plugins {
id("org.jetbrains.kotlin.jvm") version "1.7.20"
`java-library`
`maven-publish`
signing
id("org.jetbrains.dokka") version "1.7.20"
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}
group = "dev.vstrs"
version = "0.2.0-SNAPSHOT"
val githubOrg = "evestera"
repositories {
mavenCentral()
}
dependencies {
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.slf4j:slf4j-api:1.7.36")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2")
testImplementation("org.assertj:assertj-core:3.23.1")
}
buildscript {
dependencies {
classpath("org.jetbrains.dokka:dokka-base:1.7.20")
}
}
val isRelease = System.getenv("MAVEN_RELEASE") == "true"
if (isRelease) {
project.version = project.version.toString().replace("-SNAPSHOT", "")
println("Building release version ${project.version}")
}
tasks.test {
useJUnitPlatform()
}
java {
withSourcesJar()
withJavadocJar()
}
tasks.named<Jar>("javadocJar") {
from(tasks.named("dokkaJavadoc"))
}
tasks.withType(org.jetbrains.dokka.gradle.DokkaTask::class).configureEach {
dokkaSourceSets {
named("main") {
includes.from("module-docs.md")
}
}
pluginConfiguration<org.jetbrains.dokka.base.DokkaBase, org.jetbrains.dokka.base.DokkaBaseConfiguration> {
footerMessage = "Copyright © 2022 Erik Vesteraas"
}
}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
publishing {
publications {
register<MavenPublication>("maven") {
from(components["java"])
pom {
name.set("${project.group}:${project.name}")
description.set("Simple dependency resolution and injection for Kotlin classes")
url.set("https://github.com/$githubOrg/${project.name}")
scm {
url.set("scm:git:git@github.com:$githubOrg/${project.name}.git")
connection.set("https://github.com/$githubOrg/${project.name}")
developerConnection.set("scm:git:git://github.com/$githubOrg/${project.name}.git")
}
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/MIT")
}
}
developers {
developer {
id.set("evestera")
name.set("Erik Vesteraas")
email.set("erik@vestera.as")
}
}
}
}
}
}
signing {
setRequired({ isRelease })
sign(publishing.publications["maven"])
}