-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle.kts
93 lines (81 loc) · 2.38 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
plugins {
kotlin("jvm") version "1.8.10"
id("org.jetbrains.dokka") version "1.8.10"
id("org.gradle.maven-publish")
id("org.gradle.application")
}
group = "com.github.sszuev"
version = "2.0.2-SNAPSHOT"
description = "A simple command-line utility to convert any RDF graph to OWL2-DL ontology"
repositories {
mavenCentral()
}
dependencies {
val ontapiVersion = "3.0.0"
val owlapiVersion = "5.1.20"
val kotlinCliVersion = "0.3.5"
val kotlinCoroutinesVersion = "1.6.4"
val slf4jVersion = "2.0.6"
implementation("org.jetbrains.kotlinx:kotlinx-cli:$kotlinCliVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion")
implementation("com.github.owlcs:ontapi:$ontapiVersion")
implementation("net.sourceforge.owlapi:owlapi-parsers:$owlapiVersion")
implementation("org.slf4j:slf4j-api:$slf4jVersion")
implementation("org.slf4j:slf4j-reload4j:$slf4jVersion")
testImplementation(kotlin("test"))
}
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(11)
}
application {
mainClass.set("com.github.sszuev.ontconverter.MainKt")
}
val fatJar = tasks.register<Jar>("fatJar") {
dependsOn.addAll(
listOf(
"compileJava",
"compileKotlin",
"processResources",
"test"
)
)
archiveFileName.set(rootProject.name + ".jar")
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)
}
val sourcesJar by tasks.creating(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
dependsOn.add(fatJar)
}
val dokkaHtml by tasks.getting(org.jetbrains.dokka.gradle.DokkaTask::class)
val javadocJar: TaskProvider<Jar> by tasks.registering(Jar::class) {
dependsOn(dokkaHtml)
archiveClassifier.set("javadoc")
from(dokkaHtml.outputDirectory)
dependsOn.add(sourcesJar)
}
tasks {
build {
dependsOn(fatJar)
}
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
artifact(sourcesJar)
artifact(javadocJar)
}
}
}