-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
118 lines (99 loc) · 3.31 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
112
113
114
115
116
117
118
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
group = "be.yellowduck"
version = "1.0.10"
val myArtifactId: String = rootProject.name
val myArtifactGroup: String = project.group.toString()
val myArtifactVersion: String = project.version.toString()
val myGithubUsername = "pieterclaerhout"
val myGithubDescription = "A GPX library written in Kotlin"
val myGithubHttpUrl = "https://github.com/${myGithubUsername}/kotlin-yellowduck-gpx"
val myGithubIssueTrackerUrl = "https://github.com/${myGithubUsername}/kotlin-yellowduck-gpx/issues"
val myLicense = "MIT"
val myLicenseUrl = "https://raw.githubusercontent.com/pieterclaerhout/kotlin-yellowduck-gpx/main/LICENSE"
val myDeveloperName = "Pieter Claerhout"
plugins {
kotlin("jvm") version "1.5.0"
kotlin("plugin.serialization") version "1.5.0"
id("org.jetbrains.dokka") version "1.4.32"
`maven-publish`
`java-library`
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.1")
implementation("com.fasterxml.jackson.core:jackson-core:2.12.3")
implementation("com.fasterxml.jackson.core:jackson-annotations:2.12.3")
implementation("com.fasterxml.jackson.core:jackson-databind:2.12.3")
implementation("org.glassfish.jaxb:txw2:2.2.11")
testImplementation("org.assertj:assertj-core:3.18.1")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.2")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "11"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
val sourcesJar by tasks.creating(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.getByName("main").allSource)
from("LICENCE") {
into("META-INF")
}
}
tasks {
dokkaHtml {
dokkaSourceSets.configureEach {
includeNonPublic.set(false)
skipEmptyPackages.set(true)
}
}
}
val dokkaJavadocJar by tasks.creating(Jar::class) {
dependsOn(tasks.dokkaHtml)
from(tasks.dokkaJavadoc.get().outputDirectory.get())
archiveClassifier.set("javadoc")
}
publishing {
publications {
register("gprRelease", MavenPublication::class) {
groupId = myArtifactGroup
artifactId = myArtifactId
version = myArtifactVersion
from(components["java"])
artifact(sourcesJar)
artifact(dokkaJavadocJar)
pom {
packaging = "jar"
name.set(myArtifactId)
description.set(myGithubDescription)
url.set(myGithubHttpUrl)
scm {
url.set(myGithubHttpUrl)
}
issueManagement {
url.set(myGithubIssueTrackerUrl)
}
licenses {
license {
name.set(myLicense)
url.set(myLicenseUrl)
}
}
developers {
developer {
id.set(myGithubUsername)
name.set(myDeveloperName)
}
}
}
}
}
}