Skip to content

Commit 8eaf9f1

Browse files
committed
feat(core): use gradle script kotlin and kotlin 1.1.0-beta-38
1 parent ea88357 commit 8eaf9f1

File tree

3 files changed

+163
-155
lines changed

3 files changed

+163
-155
lines changed

build.gradle

Lines changed: 0 additions & 155 deletions
This file was deleted.

build.gradle.kts

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
import com.moowork.gradle.node.NodeExtension
2+
import com.moowork.gradle.node.yarn.YarnTask
3+
import org.gradle.api.tasks.bundling.Jar
4+
import org.gradle.api.tasks.testing.Test
5+
import org.gradle.language.jvm.tasks.ProcessResources
6+
import org.gradle.testing.jacoco.tasks.JacocoReport
7+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
8+
9+
buildscript {
10+
val kotlinVersion = "1.1.0-beta-38"
11+
val springBootVersion = "1.5.1.RELEASE"
12+
val gradleNodePluginVersion = "1.1.1"
13+
14+
repositories {
15+
mavenCentral()
16+
maven { setUrl("https://plugins.gradle.org/m2/") }
17+
maven { setUrl("http://dl.bintray.com/kotlin/kotlin-eap-1.1") }
18+
}
19+
20+
dependencies {
21+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
22+
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
23+
classpath("com.moowork.gradle:gradle-node-plugin:$gradleNodePluginVersion")
24+
classpath("org.jetbrains.kotlin:kotlin-noarg:$kotlinVersion")
25+
classpath("org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion")
26+
}
27+
}
28+
29+
apply {
30+
plugin("java")
31+
plugin("kotlin")
32+
plugin("kotlin-kapt")
33+
plugin("kotlin-allopen")
34+
plugin("kotlin-spring")
35+
plugin("kotlin-noarg")
36+
plugin("kotlin-jpa")
37+
plugin("org.springframework.boot")
38+
plugin("com.moowork.node")
39+
plugin("jacoco")
40+
}
41+
42+
group = "com.shardis"
43+
version = "0.0.4-SNAPSHOT"
44+
45+
repositories {
46+
mavenCentral()
47+
maven { setUrl("https://dl.bintray.com/jetbrains/spek") }
48+
maven { setUrl("http://dl.bintray.com/kotlin/kotlin-eap-1.1") }
49+
}
50+
51+
tasks.withType<KotlinCompile> {
52+
kotlinOptions {
53+
jvmTarget = "1.8"
54+
}
55+
}
56+
57+
tasks.withType<Jar> {
58+
baseName = "shardis"
59+
}
60+
61+
configure<JavaPluginConvention> {
62+
setSourceCompatibility(1.8)
63+
setTargetCompatibility(1.8)
64+
sourceSets.getByName("main").resources.srcDirs("$buildDir/generated/source/kapt/")
65+
}
66+
67+
68+
configure<NodeExtension> {
69+
version = "7.5.0"
70+
yarnVersion = "0.19.1"
71+
download = true
72+
workDir = file("${project.buildDir}/nodejs")
73+
yarnWorkDir = file("${project.buildDir}/yarn")
74+
nodeModulesDir = file("${project.projectDir}")
75+
}
76+
77+
78+
tasks.withType<JacocoReport> {
79+
reports.apply {
80+
html.isEnabled = true
81+
html.setDestination(file("${project.buildDir}/jacocoHtml"))
82+
xml.isEnabled = true
83+
}
84+
}
85+
86+
tasks.withType<ProcessResources> {
87+
filesMatching("**/application.yml") {
88+
expand(project.properties)
89+
}
90+
filesMatching("**/bootstrap.yml") {
91+
expand(project.properties)
92+
}
93+
}
94+
95+
tasks.withType<Test> {
96+
testLogging.apply {
97+
events("passed", "skipped", "failed", "standardOut", "standardError")
98+
}
99+
}
100+
101+
102+
dependencies {
103+
104+
val kotlinVersion = "1.1.0-beta-38"
105+
val jacksonVersion = "2.8.6"
106+
val jjwtVersion = "0.7.0"
107+
val reflectionsVersion = "0.9.10"
108+
109+
configurations.compile.exclude(group = "org.springframework.boot", module = "spring-boot-starter-tomcat")
110+
111+
compile("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
112+
compile("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
113+
114+
compile("org.springframework.boot:spring-boot-devtools")
115+
compile("org.springframework.boot:spring-boot-starter-actuator")
116+
compile("org.springframework.boot:spring-boot-starter-cache")
117+
compile("org.springframework.boot:spring-boot-starter-data-jpa")
118+
compile("org.springframework.boot:spring-boot-starter-security")
119+
compile("org.springframework.boot:spring-boot-starter-undertow")
120+
compile("org.springframework.boot:spring-boot-starter-validation")
121+
compile("org.springframework.boot:spring-boot-starter-web")
122+
compile("org.springframework.boot:spring-boot-configuration-processor")
123+
124+
compile("org.hibernate:hibernate-java8")
125+
compile("org.hibernate:hibernate-envers")
126+
127+
kapt("org.springframework.boot:spring-boot-configuration-processor")
128+
kapt("org.hibernate:hibernate-jpamodelgen")
129+
130+
compile("io.jsonwebtoken:jjwt:$jjwtVersion")
131+
132+
compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
133+
compile("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")
134+
compile("com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion")
135+
136+
runtime("com.h2database:h2")
137+
runtime("org.postgresql:postgresql")
138+
139+
testCompile("org.springframework.boot:spring-boot-starter-test")
140+
testCompile("org.springframework.security:spring-security-test")
141+
testCompile("org.reflections:reflections:$reflectionsVersion")
142+
}
143+
144+
task<YarnTask>("ngBuild") {
145+
dependsOn("yarn_install")
146+
args = listOf("run", "build:prod")
147+
}
148+
149+
task<YarnTask>("ngTest") {
150+
dependsOn("yarn_install")
151+
args = listOf("run", "test")
152+
}
153+
154+
tasks.getByName("jacocoTestReport").dependsOn("test")
155+
tasks.getByName("yarn_install").dependsOn("yarnSetup")
156+
tasks.getByName("processResources").dependsOn("ngBuild")
157+
tasks.getByName("test").dependsOn("ngTest")
158+
tasks.getByName("check").finalizedBy("jacocoTestReport")
159+
tasks.getByName("clean").doLast {
160+
delete("node_modules")
161+
}
162+

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
rootProject.name = 'shardis'
2+
rootProject.buildFileName = 'build.gradle.kts'

0 commit comments

Comments
 (0)