This repository has been archived by the owner on Sep 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
135 lines (119 loc) · 4.01 KB
/
build.gradle
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
123
124
125
126
127
128
129
130
131
132
133
134
135
/*
* Copyright D3 Ledger, Inc. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
buildscript {
ext.kotlin_version = '1.3.10'
ext.notary_version = 'b44ce46930425da0efe6e129bca61068c899faee'
repositories {
mavenCentral()
jcenter()
// gradle plugins repository
gradlePluginPortal()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.1'
}
}
plugins {
id 'jp.co.soramitsu.sora-plugin' version '0.1.2'
id "com.github.dolgopolovwork.testreport" version "1"
}
testReport {
testFolders = Arrays.asList("src/integration-test")
}
repositories {
mavenCentral()
jcenter()
maven { url = 'https://dl.bintray.com/kotlin/ktor' }
maven { url 'https://jitpack.io' }
}
apply plugin: "kotlin-spring" // See https://kotlinlang.org/docs/reference/compiler-plugins.html#kotlin-spring-compiler-plugin
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'kotlin'
apply plugin: 'maven'
apply plugin: 'application'
mainClassName = 'com.d3.chainadapter.ChainAdapterMain'
group 'com.d3.chainadapter'
shadowDistZip.classifier = 'shadow'
shadowDistTar.classifier = 'shadow'
// name of jar file that the shadowJar plugin generates
shadowJar.archiveName = 'app.jar'
// sora-plugin configs
soramitsu {
projectGroup = 'd3-deploy'
docker {
// docker tag
tag = System.getenv("TAG")
// jar file that is used in the generated Dockerfile
jar = new File("build/libs/app.jar")
// the rest in configured using env variables
}
}
sourceSets {
integrationTest {
kotlin {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDirs += 'src/integration-test/kotlin'
}
resources {
srcDirs = ["src/integration-test/resources"]
}
}
}
wrapper {
gradleVersion = 4.10
}
task integrationTest(type: Test) {
group = LifecycleBasePlugin.VERIFICATION_GROUP
description = 'Runs chain-adapter integration tests'
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
// Enable JUnit5 tests
useJUnitPlatform {
}
}
configurations {
integrationTestImplementation.extendsFrom testImplementation
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
}
task runIrohaChainAdapter(type: JavaExec) {
main = 'com.d3.chainadapter.ChainAdapterMain'
classpath = sourceSets.main.runtimeClasspath
}
dependencies {
// https://mvnrepository.com/artifact/org.springframework/spring-context
compile group: 'org.springframework', name: 'spring-context', version: '5.1.4.RELEASE'
//TODO change version after D3 release
compile "com.github.d3ledger.notary:notary-commons:$notary_version"
testCompile "com.github.d3ledger.notary:notary-iroha-integration-test:$notary_version"
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
compile "com.rabbitmq:amqp-client:5.6.0"
// unit tests
testCompile('org.junit.jupiter:junit-jupiter-api:5.2.0')
testRuntime('org.junit.jupiter:junit-jupiter-engine:5.2.0')
// https://mvnrepository.com/artifact/org.mockito/mockito-all
testCompile group: 'org.mockito', name: 'mockito-all', version: '2.0.2-beta'
testCompile('com.nhaarman:mockito-kotlin:1.5.0') {
exclude group: 'org.jetbrains.kotlin'
exclude group: 'org.mockito'
}
// to run both junit4 and junit5 tests
testRuntime("org.junit.vintage:junit-vintage-engine:5.2.0")
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
project.afterEvaluate {
dockerfileCreate.dependsOn(shadowJar)
integrationTest.dependsOn(dockerfileCreate)
integrationTest.finalizedBy(d3TestReport)
test.finalizedBy(integrationTest)
}