-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle.kts
108 lines (88 loc) · 2.73 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.dokka.gradle.DokkaTask
val projectGroup = "ch.kuon.phoenix"
// Update elixir project (mock_servver:mix.exs) version too to keep them in sync
// Also update version in README.md
val projectVersion = "0.1.9"
val projectName = "channel"
plugins {
// Apply the Kotlin JVM plugin to add support for Kotlin.
id("org.jetbrains.kotlin.jvm") version "1.3.61"
// Documentation generation
id("org.jetbrains.dokka") version "0.10.0"
// Apply the java-library plugin for API and implementation separation.
`java-library`
signing
// Create maven artefacts
`maven-publish`
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// Align versions of all Kotlin components
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
// Use the Kotlin JDK 8 standard library.
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
// Web Socket Client
implementation("com.neovisionaries:nv-websocket-client:2.9")
// JSON handling
implementation("com.github.openjson:openjson:1.0.11")
// Use the Kotlin test library.
testImplementation("org.jetbrains.kotlin:kotlin-test")
// Use the Kotlin JUnit integration.
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
// Concurrent Unit test
testImplementation("net.jodah:concurrentunit:0.4.6")
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
groupId = projectGroup
artifactId = projectName
version = projectVersion
}
}
repositories {
maven {
url = uri(layout.buildDirectory.dir("repo"))
}
}
}
signing {
useGpgCmd()
sign(publishing.publications["mavenJava"])
}
tasks.withType<Sign>().configureEach {
onlyIf { project.hasProperty("sign") as Boolean }
}
tasks {
compileKotlin {
kotlinOptions.allWarningsAsErrors = true
}
jar {
archiveBaseName.set(projectName)
archiveVersion.set(projectVersion)
}
withType<DokkaTask> {
outputFormat = "html"
outputDirectory = "build/docs/"
configuration {
moduleName = "phoenix-channel"
includes = listOf("README.md")
samples = listOf("src/test/kotlin/ch/kuon/phoenix/LibraryTest.kt")
}
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
withType(Test::class.java) {
testLogging.showStandardStreams = true
}
withType<GenerateMavenPom> {
destination = file("$buildDir/libs/${projectName}.pom")
}
}