This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
/
build.gradle
151 lines (130 loc) · 4.33 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'org.web3j:web3j-gradle-plugin:4.3.0'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.31'
classpath 'org.unbroken-dome.gradle-plugins:gradle-testsets-plugin:2.1.1'
classpath 'com.diffplug.spotless:spotless-plugin-gradle:3.23.0'
classpath 'com.adarshr:gradle-test-logger-plugin:1.7.0'
}
}
group = 'org.web3j.aion'
version = '1.0.0-SNAPSHOT'
//apply from: 'maven.gradle'
ext {
loadPropsFromFile = { String path ->
def props = new Properties()
def propsFile = file(path)
if (propsFile.exists()) {
propsFile.withReader { reader ->
props.load(reader)
}
}
props
}
versions = loadPropsFromFile("$rootDir/versions.properties")
}
subprojects {
apply plugin: 'maven'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'org.web3j'
apply plugin: 'maven-publish'
apply plugin: 'org.unbroken-dome.test-sets'
apply plugin: 'com.diffplug.gradle.spotless'
apply plugin: 'com.adarshr.test-logger'
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
mavenContent {
snapshotsOnly()
}
}
flatDir {
dirs "$rootProject.projectDir/lib"
}
}
testSets {
integrationTest {
dirName = 'integration-test'
}
}
tasks.withType(Test) {
useJUnitPlatform()
reports.html.enabled = false
reports.junitXml.enabled = false
systemProperties = [
'junit.jupiter.extensions.autodetection.enabled': 'true',
'junit.jupiter.testinstance.lifecycle.default' : 'per_class'
]
}
configurations {
testOutput.extendsFrom (testCompile)
integrationTestOutput.extendsFrom (integrationTestCompile)
}
artifacts {
testOutput testJar
integrationTestOutput integrationTestJar
}
testlogger {
showStandardStreams true
}
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
testImplementation(group: 'org.web3j', name: 'core', version: versions.web3j, classifier: 'tests')
testImplementation "org.junit.jupiter:junit-jupiter-api:${versions.junit5}"
testImplementation "com.willowtreeapps.assertk:assertk-jvm:${versions.assertk}"
testImplementation "junit:junit:${versions.junit4}"
testImplementation("io.mockk:mockk:${versions.mockk}") {
exclude group: 'org.jetbrains.kotlin'
}
runtimeOnly "com.github.schnitker.logmanager:logmgr-logback:${versions.logmanager}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${versions.junit5}"
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:${versions.junit5}"
integrationTestImplementation "org.testcontainers:testcontainers:${versions.testcontainers}"
integrationTestImplementation "org.testcontainers:junit-jupiter:${versions.testcontainers}"
}
sourceCompatibility = JavaVersion.VERSION_1_8
compileKotlin {
kotlinOptions {
jvmTarget = '1.8'
}
dependsOn 'generateContractWrappers'
}
compileTestKotlin {
kotlinOptions {
jvmTarget = '1.8'
}
dependsOn 'generateTestContractWrappers'
}
compileIntegrationTestKotlin {
kotlinOptions {
jvmTarget = '1.8'
}
dependsOn 'generateIntegrationTestContractWrappers'
}
sourceSets {
main.kotlin.srcDirs += "${web3j.generatedFilesBaseDir}/main/java"
test.kotlin.srcDirs += "${web3j.generatedFilesBaseDir}/test/java"
integrationTest.kotlin.srcDirs += "${web3j.generatedFilesBaseDir}/integrationTest/java"
}
spotless {
kotlin {
// This path needs to be relative to each project
target fileTree('.') {
include '**/*.kt'
exclude '**/.gradle/**'
}
ktlint(versions.ktlint)
trimTrailingWhitespace()
endWithNewline()
}
}
}