-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathbuild.gradle
47 lines (43 loc) · 1.95 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
description 'web3j project code generators'
dependencies {
implementation project(':core'),
"com.squareup:kotlinpoet:$kotlinPoetVersion",
"com.squareup:javapoet:$javaPoetVersion",
"info.picocli:picocli:$picocliVersion"
testImplementation project(':core').sourceSets.test.output,
"ch.qos.logback:logback-core:$logbackVersion",
"ch.qos.logback:logback-classic:$logbackVersion"
implementation("org.junit.platform:junit-platform-launcher:$junitPlatformLauncherVersion")
implementation("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
implementation("org.junit.vintage:junit-vintage-engine:$junitVersion")
}
file("src/test/resources/solidity").listFiles().each { File file ->
def contractFile = file.listFiles().find({
it.getName().endsWith(".sol")
})
if (contractFile != null) {
def contractName = contractFile.name.substring(0, contractFile.name.length() - 4)
def generateTask = tasks.register("generate${contractName}Wrapper", JavaExec) {
classpath = sourceSets.test.runtimeClasspath
main = 'org.web3j.codegen.SolidityFunctionWrapperGenerator'
args = [
'generate',
'--abiFile',
"${contractFile.parent}/build/${contractName}.abi",
'--binFile',
"${contractFile.parent}/build/${contractName}.bin",
'--outputDir',
'build/resources/test/java',
'--package',
'org.web3j.test.contract'
]
}
test.dependsOn generateTask
}
}
tasks.named("spotlessJava").configure {
dependsOn("spotlessGroovyGradle", "compileJava", "compileTestJava", "javadoc", "test", "jacocoTestReport")
}
tasks.named("spotlessKotlin").configure {
dependsOn("compileJava", "spotlessJava", "spotlessGroovyGradle", "compileTestJava", "processTestResources", "javadoc", "test", "jacocoTestReport")
}