This repository has been archived by the owner on Jul 28, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
158 lines (135 loc) · 4.56 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.dokka.gradle.LinkMapping
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
version = "1.1.1"
group = "com.dmdirc.ktirc"
plugins {
`maven-publish`
jacoco
kotlin("jvm") version "1.3.31"
id("com.jfrog.bintray") version "1.8.4"
id("org.jetbrains.dokka") version "0.9.18"
id("name.remal.check-updates") version "1.0.130"
}
jacoco {
toolVersion = "0.8.3"
}
configurations {
create("itestImplementation") { extendsFrom(getByName("testImplementation")) }
create("itestRuntime") { extendsFrom(getByName("testRuntime")) }
all {
resolutionStrategy.eachDependency {
if (requested.group == "org.jetbrains.kotlin") {
useVersion("1.3.31")
}
}
}
}
repositories {
jcenter()
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib-jdk8", "1.3.31"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-io-jvm:0.1.8")
compile(kotlin("reflect"))
testImplementation("org.junit.jupiter:junit-jupiter-api:5.4.2")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.4.2")
testImplementation("io.mockk:mockk:1.9.3")
testRuntime("org.junit.jupiter:junit-jupiter-engine:5.4.2")
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceSets {
create("itest") {
compileClasspath += getByName("main").output
runtimeClasspath += getByName("main").output
java.srcDirs("src/itest/kotlin")
}
}
}
tasks {
create<Test>("itest") {
group = "verification"
testClassesDirs = sourceSets["itest"].output.classesDirs
classpath = sourceSets["itest"].runtimeClasspath
}
create<Jar>("sourceJar") {
description = "Creates a JAR that contains the source code."
from(sourceSets["main"].allSource)
archiveClassifier.set("sources")
}
create<JacocoReport>("codeCoverageReport") {
executionData(fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec"))
sourceSets(sourceSets["main"])
reports {
xml.isEnabled = true
xml.destination = File("$buildDir/reports/jacoco/report.xml")
html.isEnabled = true
csv.isEnabled = false
}
dependsOn("test")
}
withType<Wrapper> {
gradleVersion = "5.4.1"
}
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
}
}
withType<Test> {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
withType<DokkaTask> {
moduleName = "ktirc"
includes = listOf("src/docs/manual.md")
linkMappings = arrayListOf(LinkMapping().apply {
dir = "src/main/kotlin"
url = "https://github.com/csmith/ktirc/blob/master/src/main/kotlin"
suffix = "#L"
})
}
}
publishing {
publications {
create<MavenPublication>("Publication") {
groupId = "com.dmdirc"
artifactId = "ktirc"
version = project.version as String
artifact(tasks["jar"])
artifact(tasks["sourceJar"])
pom.withXml {
val root = asNode()
root.appendNode("name", "KtIrc")
root.appendNode("description", "Kotlin library for connecting to and interacting with IRC")
val dependenciesNode = root.appendNode("dependencies")
configurations.implementation.get().allDependencies.forEach {
val dependencyNode = dependenciesNode.appendNode("dependency")
dependencyNode.appendNode("groupId", it.group)
dependencyNode.appendNode("artifactId", it.name)
dependencyNode.appendNode("version", it.version)
}
}
}
}
}
bintray {
user = System.getenv("BINTRAY_USER")
key = System.getenv("BINTRAY_API_KEY")
setPublications("Publication")
with(pkg) {
userOrg = "dmdirc"
repo = "releases"
name = "ktirc"
publish = true
desc = "A kotlin library for connecting to and interacting with IRC"
setLicenses("MIT")
vcsUrl = "https://g.c5h.io/public/ktirc"
}
}