-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathbuild.gradle
93 lines (75 loc) · 2.94 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
import java.text.SimpleDateFormat
plugins {
id 'java-library'
id 'org.ajoberstar.git-publish'
}
description 'web3j is a lightweight Java library for integration with Ethereum clients'
dependencies {
api project(':abi'),
project(':crypto'),
project(':tuples'),
"com.github.jnr:jnr-unixsocket:$jnr_unixsocketVersion",
"com.squareup.okhttp3:okhttp:$okhttpVersion",
"com.squareup.okhttp3:logging-interceptor:$okhttpVersion",
"io.reactivex.rxjava2:rxjava:$rxjavaVersion",
"org.java-websocket:Java-WebSocket:$javaWebSocketVersion",
"com.fasterxml.jackson.core:jackson-databind:$jacksonVersion",
"org.slf4j:slf4j-api:$slf4jVersion",
"io.github.adraffy:ens-normalize:$ensAdraffyVersion",
"io.tmio:tuweni-bytes:$tuweniVersion",
"io.tmio:tuweni-units:$tuweniVersion"
implementation "software.amazon.awssdk:kms:$awsSdkVersion"
testImplementation project(path: ':crypto', configuration: 'testArtifacts'),
"nl.jqno.equalsverifier:equalsverifier:$equalsverifierVersion",
"ch.qos.logback:logback-classic:$logbackVersion"
}
task createProperties(dependsOn: processResources) doLast {
// if resources dir is empty we need to create this ourselves
new File("$buildDir/resources/main/").mkdirs()
new File("$buildDir/resources/main/web3j-version.properties").withWriter { w ->
Properties p = new Properties()
p['version'] = project.version.toString()
p['timestamp'] = getTimestamp()
p.store w, null
}
}
def getTimestamp() {
Date today = new Date()
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S z")
df.setTimeZone(TimeZone.getTimeZone("UTC"))
return df.format(today)
}
ext {
docsPath = 'web3j/web3j-docs'
ghToken = System.getenv('GITHUB_TOKEN')
}
gitPublish {
if (ghToken) {
repoUri = "https://github.com/${docsPath}.git"
} else {
repoUri = "git@github.com:${docsPath}.git"
}
// branch will be created if it doesn't exist
branch = 'main'
def coreDocs = files("${buildDir.path}/docs/javadoc/")
contents {
from(coreDocs) {
into '/docs/javadoc-api'
}
}
// what to keep in the existing branch (include=keep)
preserve {
include '/**'
}
// message used when committing changes
commitMessage = 'Publishing a new page' // defaults to 'Generated by gradle-git-publish'
}
classes { dependsOn createProperties }
configurations { testArtifacts.extendsFrom testRuntime }
artifacts { testArtifacts testsJar }
tasks.named("spotlessJava").configure {
dependsOn("spotlessGroovyGradle", "compileJava", "compileTestJava", "javadoc", "test", "jacocoTestReport")
}
tasks.named("spotlessKotlin").configure {
dependsOn("compileJava", "spotlessJava", "spotlessGroovyGradle", "compileTestJava", "processTestResources", "javadoc", "test", "jacocoTestReport")
}