-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
122 lines (107 loc) · 3.79 KB
/
build.gradle.kts
File metadata and controls
122 lines (107 loc) · 3.79 KB
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
114
115
116
117
118
119
120
121
122
import org.asciidoctor.gradle.AsciidoctorTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.springframework.boot.gradle.tasks.bundling.BootJar
plugins {
kotlin("plugin.jpa") version "1.3.61"
id("org.springframework.boot") version "2.2.2.RELEASE"
id("io.spring.dependency-management") version "1.0.8.RELEASE"
kotlin("jvm") version "1.3.61"
kotlin("plugin.spring") version "1.3.61"
kotlin("plugin.allopen") version "1.3.61"
kotlin("kapt") version "1.3.61"
id("org.asciidoctor.convert") version "1.5.9.2"
}
group = "snc.smartchargingnetwork.node"
version = "1.0.0"
java.sourceCompatibility = JavaVersion.VERSION_1_8
val snippetsDir = "build/generated-snippets"
val developmentOnly by configurations.creating
configurations {
runtimeClasspath {
extendsFrom(developmentOnly)
}
}
repositories {
jcenter()
}
dependencies {
implementation("smartcharging.openchargingnetwork:notary:0.4.0-beta1")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("khttp:khttp:1.0.0")
implementation("org.web3j:core:4.5.5")
implementation("org.postgresql:postgresql:42.2.6")
runtimeOnly("com.h2database:h2")
kapt("org.springframework.boot:spring-boot-configuration-processor")
asciidoctor("org.springframework.restdocs:spring-restdocs-asciidoctor:2.0.3.RELEASE")
developmentOnly("org.springframework.boot:spring-boot-devtools")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude(module = "junit")
exclude(module = "junit-vintage-engine")
exclude(module = "mockito-core")
exclude(module = "android-json")
}
testImplementation("org.junit.jupiter:junit-jupiter-api")
testImplementation("com.ninja-squad:springmockk:1.1.2")
testImplementation("org.springframework.restdocs:spring-restdocs-mockmvc:2.0.3.RELEASE")
testImplementation("io.javalin:javalin:3.7.0")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3")
}
allOpen {
annotation("javax.persistence.Entity")
annotation("javax.persistence.Embeddable")
annotation("javax.persistence.MappedSuperClass")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "1.8"
}
}
val test: Test by tasks
test.apply {
dependsOn("unitTest", "integrationTest")
outputs.dir(snippetsDir)
}
tasks.register<Test>("unitTest") {
useJUnitPlatform()
exclude("**/integration/**")
}
tasks.register<Test>("integrationTest") {
useJUnitPlatform()
include("**/integration/**")
}
tasks.register<Exec>("ganache") {
commandLine(listOf("/usr/bin/env", "npm", "install", "-g", "ganache-cli"))
commandLine(listOf(
"/usr/bin/env",
"ganache-cli",
"-m=candy maple cake sugar pudding cream honey rich smooth crumble sweet treat",
"--port=8544",
"--accounts=20",
"--networkId=9",
"--gasLimit=10000000"))
}
val asciidoctor by tasks.getting(AsciidoctorTask::class) {
inputs.dir(snippetsDir)
dependsOn(test)
}
tasks {
"bootJar"(BootJar::class) {
dependsOn(asciidoctor)
from("${asciidoctor.get().outputDir}/html5") {
into("static/docs")
}
}
}
(tasks.getByName("processResources") as ProcessResources).apply {
val profile: String by project
include("**/application.$profile.properties")
rename {
"application.properties"
}
}