-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
124 lines (107 loc) · 3.22 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
plugins {
id 'org.springframework.boot' version '2.4.3'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id 'com.palantir.docker' version '0.26.0'
id "org.sonarqube" version "2.7"
id 'maven-publish'
}
ext {
openFeignVersion = '11.6'
}
group = 'com.iexec.blockchain'
sourceCompatibility = '11'
targetCompatibility = '11'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenLocal()
mavenCentral()
// iExec
maven {
url "https://nexus.iex.ec/repository/maven-public/"
}
maven {
url "https://jitpack.io"
}
}
configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
integrationTestImplementation.extendsFrom testImplementation
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.awaitility:awaitility:4.0.1'
implementation "io.springfox:springfox-boot-starter:3.0.0"
implementation "io.springfox:springfox-swagger-ui:3.0.0"
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
implementation 'org.springframework.boot:spring-boot-starter-validation'
// iexec
implementation files('libs/iexec-common-5.8.0-all.jar')
// web3j bug required
// NoSuchMethodError: 'okhttp3.RequestBody okhttp3.RequestBody.create(java.lang.String, okhttp3.MediaType)'
implementation 'com.squareup.okhttp3:okhttp:4.3.1' // Web3j issue: https://github.com/web3j/web3j/issues/1180
// NoSuchMethodError: 'byte[] kotlin.collections.ArraysKt.copyInto(byte[], byte[], int, int, int)'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.3.50' // https://stackoverflow.com/a/57907899
// feign
implementation "io.github.openfeign:feign-core:$openFeignVersion"
implementation "io.github.openfeign:feign-jackson:$openFeignVersion"
implementation "io.github.openfeign:feign-slf4j:$openFeignVersion"
}
sourceSets {
integrationTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir 'src/itest/java'
}
resources.srcDir 'src/itest/resources'
}
}
task itest(type: Test) {
setTestClassesDirs(sourceSets.integrationTest.output)
classpath = sourceSets.integrationTest.runtimeClasspath
useJUnitPlatform()
}
jar {
enabled = true
archiveClassifier.set('library')
from sourceSets.main.allSource
duplicatesStrategy = 'exclude'
}
publishing {
publications {
maven(MavenPublication) {
artifact bootJar
from components.java
}
}
repositories {
maven {
credentials {
username project.hasProperty("nexusUser")? project.nexusUser: ''
password project.hasProperty("nexusPassword")? project.nexusPassword: ''
}
url = project.hasProperty("nexusUrl")? project.nexusUrl: ''
}
}
}
test {
useJUnitPlatform()
}
def jar = rootProject.name + '-' + version + ".jar"
docker {
name 'docker.io/iexechub/' + rootProject.name + ':dev'
dockerfile file('docker/Dockerfile-local')
files('build/libs/' + jar)
buildArgs([JAR_PATH: jar ])
}
tasks.docker.dependsOn tasks.build