-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
build.gradle
114 lines (101 loc) · 3.19 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
plugins {
id 'java'
id 'java-gradle-plugin'
id 'idea'
id 'maven-publish'
id 'jacoco'
id 'com.diffplug.spotless' version '6.25.0'
id 'com.gradle.plugin-publish' version '1.2.1'
id 'de.undercouch.download' version '4.1.2'
}
description = 'Gradle plugin providing tasks to generate Web3j contracts from Solidity.'
sourceCompatibility = 17
ext {
web3jVersion = version
}
apply {
[
'jacoco',
'java',
'javadoc',
'repositories',
'spotless',
'junit'
].each { buildScript ->
download {
src "https://raw.githubusercontent.com/hyperledger-web3j/web3j-build-tools/main/gradle/$buildScript/build.gradle"
dest "$rootDir/gradle/$buildScript/build.gradle"
overwrite true
quiet true
onlyIfModified true
}
from("$rootDir/gradle/$buildScript/build.gradle")
}
}
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
implementation "org.web3j.solidity:solidity-gradle-plugin:$solidityPluginVersion"
implementation("org.web3j:core:$web3jVersion") {
exclude group: 'org.slf4j', module: 'slf4j-nop'
}
implementation("org.web3j:codegen:$web3jVersion") {
exclude group: 'org.slf4j', module: 'slf4j-nop'
}
configurations.all {
resolutionStrategy {
force(group: "org.jetbrains.kotlin", name: "kotlin-reflect", version: kotlinVersion)
force(group: "org.jetbrains.kotlin", name: "kotlin-stdlib", version: kotlinVersion)
force(group: "org.jetbrains.kotlin", name: "kotlin-stdlib-common", version: kotlinVersion)
force(group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk7", version: kotlinVersion)
force(group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk8", version: kotlinVersion)
}
}
}
gradlePlugin {
website = 'https://web3j.io/'
vcsUrl = 'https://github.com/hyperledger-web3j/web3j-gradle-plugin'
plugins {
web3j {
description = 'Gradle plugin providing tasks to generate web3j contracts from Solidity.'
displayName = description
tags.set([
'solidity',
'ethereum',
'web3.js',
'web3j'
])
id = 'org.web3j'
implementationClass = 'org.web3j.gradle.plugin.Web3jPlugin'
}
}
}
def generatedResources = "$buildDir/generated-resources/main"
sourceSets {
main {
output.dir(generatedResources, builtBy: 'generateVersionProperties')
}
}
task generateVersionProperties {
doLast {
new File(generatedResources).mkdirs()
def generated = new File(generatedResources, "version.properties")
generated.text = "version=$rootProject.version"
}
}
tasks.withType(Test) {
reports.html.destination file("${reporting.baseDir}/${name}")
}
tasks.named('spotlessKotlin') {
dependsOn tasks.named('compileTestJava')
dependsOn tasks.named('javadoc')
dependsOn tasks.named('test')
}
tasks.named('spotlessJava') {
dependsOn tasks.named('compileTestJava')
dependsOn tasks.named('javadoc')
dependsOn tasks.named('test')
}