-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
113 lines (95 loc) · 2.62 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
import org.jetbrains.intellij.tasks.PatchPluginXmlTask
import org.jetbrains.intellij.tasks.PublishTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
repositories {
jcenter()
maven { setUrl("http://dl.bintray.com/jetbrains/intellij-plugin-service") }
}
}
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf("-Xjsr305=strict")
}
}
repositories {
mavenCentral()
jcenter()
}
plugins {
id("org.jetbrains.kotlin.jvm")
id("org.jetbrains.intellij") version "0.4.15"
id("jacoco")
}
group = "com.github.shiraji.ccch"
version = System.getProperty("VERSION") ?: "0.0.1"
val test by tasks.getting(Test::class) {
useJUnitPlatform()
maxHeapSize = "3g"
}
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf("-Xjsr305=strict")
}
}
jacoco {
toolVersion = "0.8.2"
}
val jacocoTestReport by tasks.existing(JacocoReport::class) {
reports {
xml.isEnabled = true
html.isEnabled = true
}
}
// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
version = "2019.2"
}
val patchPluginXml: PatchPluginXmlTask by tasks
patchPluginXml {
changeNotes(project.file("LATEST.txt").readText())
sinceBuild("192.5728")
untilBuild("999")
}
val publishPlugin: PublishTask by tasks
publishPlugin {
token(System.getenv("HUB_TOKEN"))
channels(System.getProperty("CHANNELS") ?: "beta")
}
configurations {
create("ktlint")
dependencies {
add("ktlint", "com.github.shyiko:ktlint:0.30.0")
}
}
tasks.register("ktlintCheck", JavaExec::class) {
description = "Check Kotlin code style."
classpath = configurations["ktlint"]
main = "com.github.shyiko.ktlint.Main"
args("src/**/*.kt")
}
tasks.register("ktlintFormat", JavaExec::class) {
description = "Fix Kotlin code style deviations."
classpath = configurations["ktlint"]
main = "com.github.shyiko.ktlint.Main"
args("-F", "src/**/*.kt")
}
tasks.register("resolveDependencies") {
doLast {
project.rootProject.allprojects.forEach {subProject ->
subProject.buildscript.configurations.forEach {configuration ->
if (configuration.isCanBeResolved) {
configuration.resolve()
}
}
subProject.configurations.forEach {configuration ->
if (configuration.isCanBeResolved) {
configuration.resolve()
}
}
}
}
}
inline operator fun <T : Task> T.invoke(a: T.() -> Unit): T = apply(a)