-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
104 lines (89 loc) · 3.08 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
import Globals.Versions.assertjVersion
import Globals.Versions.junit4Version
import Globals.Versions.junitJupiterVersion
import Globals.Versions.logbackVersion
import Globals.Versions.lombokVersion
import Globals.Versions.slf4jVersion
import Globals.Versions.vavrVersion
import org.gradle.api.tasks.testing.logging.TestLogEvent.*
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.3.21"
id("com.moowork.node") version "1.2.0"
id("io.franzbecker.gradle-lombok") version "2.1"
}
lombok {
version = lombokVersion
}
allprojects {
version = "1.0.1-SNAPSHOT"
group = "com.github.daggerok"
repositories {
mavenCentral()
}
}
subprojects {
apply(plugin = "java")
this.group = "${this.parent?.group}.${this.name.replace("-", "")}"
the<SourceSetContainer>()["main"].java.srcDir("src/main/kotlin")
the<SourceSetContainer>()["test"].java.srcDir("src/test/kotlin")
dependencies {
implementation("io.vavr:vavr:$vavrVersion")
annotationProcessor("org.projectlombok:lombok:$lombokVersion")
testAnnotationProcessor("org.projectlombok:lombok:$lombokVersion")
compileOnly("org.projectlombok:lombok:$lombokVersion")
testCompileOnly("org.projectlombok:lombok:$lombokVersion")
implementation("org.slf4j:slf4j-api:$slf4jVersion")
implementation("ch.qos.logback:logback-classic:$logbackVersion")
}
dependencies {
testImplementation("org.assertj:assertj-core:$assertjVersion")
testImplementation("junit:junit:$junit4Version")
testAnnotationProcessor("org.projectlombok:lombok:$lombokVersion")
testImplementation(platform("org.junit:junit-bom:$junitJupiterVersion"))
testImplementation("org.junit.jupiter:junit-jupiter-api")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine")
testRuntime("org.junit.platform:junit-platform-launcher")
}
tasks.withType<Test> {
useJUnitPlatform()
testLogging {
showExceptions = true
showStandardStreams = true
events(PASSED, SKIPPED, FAILED)
}
}
}
defaultTasks("build")
dependencies {
implementation(kotlin("stdlib-jdk8"))
}
// vuepress npm config
node {
download = true
version = "10.9.0"
npmVersion = "6.8.0"
}
// jvm global config
val javaVersion = JavaVersion.VERSION_1_8
configure<JavaPluginConvention> {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "$javaVersion"
}
// wrapper
tasks.withType<Wrapper> {
gradleVersion = "5.2.1"
distributionType = Wrapper.DistributionType.BIN
}
// incrementVersion
tasks.register("incrementVersion") {
doLast {
incrementVersion(path = "./build.gradle.kts", prefix = " version = \"", suffix = "\"")
incrementVersion(path = "./package.json", prefix = " \"version\": \"", suffix = "\",")
incrementVersion(path = "./package-lock.json", prefix = " \"version\": \"", suffix = "\",")
}
}