-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.gradle
174 lines (147 loc) · 5.02 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
group 'io.github.tronprotocol'
version '2.2.1'
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "io.github.gradle-nexus:publish-plugin:1.1.0"
}
}
apply plugin: 'java'
apply plugin: 'com.google.protobuf'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'application'
def protobufVersion = "3.21.12"
def grpcVersion = "1.52.1"
mainClassName = 'org.tron.p2p.example.StartApp'
repositories {
mavenLocal()
mavenCentral()
}
sourceSets {
main {
proto {
srcDir 'src/main/protos'
}
java {
srcDir 'src/main/java'
}
}
}
buildscript {
repositories {
mavenLocal()
maven {
url "https://cdn.lfrs.sl/repository.liferay.com/nexus/content/groups/public"
}
mavenCentral()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:5.2.0'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.12'
}
}
dependencies {
testImplementation group: 'junit', name: 'junit', version: '4.12'
implementation group: 'org.xerial.snappy', name: 'snappy-java', version: '1.1.10.5'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.9'
implementation group: 'ch.qos.logback', name: 'logback-core', version: '1.2.9'
implementation group: 'com.google.protobuf', name: 'protobuf-java', version: protobufVersion
implementation group: 'com.google.protobuf', name: 'protobuf-java-util', version: protobufVersion
implementation group: 'io.grpc', name: 'grpc-netty', version: grpcVersion
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.69'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.4'
implementation group: 'commons-cli', name: 'commons-cli', version: '1.5.0'
compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.12'
testImplementation group: 'org.projectlombok', name: 'lombok', version: '1.18.12'
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.12'
implementation group: 'dnsjava', name: 'dnsjava', version: '3.5.2'
implementation group: 'org.web3j', name: 'crypto', version: '5.0.0'
implementation('software.amazon.awssdk:route53:2.18.41', {
exclude group: 'io.netty', module: 'netty-codec-http2'
exclude group: 'io.netty', module: 'netty-codec-http'
exclude group: 'io.netty', module: 'netty-common'
exclude group: 'io.netty', module: 'netty-buffer'
exclude group: 'io.netty', module: 'netty-transport'
exclude group: 'io.netty', module: 'netty-codec'
exclude group: 'io.netty', module: 'netty-handler'
exclude group: 'io.netty', module: 'netty-resolver'
exclude group: 'io.netty', module: 'netty-transport-classes-epoll'
exclude group: 'io.netty', module: 'netty-transport-native-unix-common'
})
implementation group: 'com.aliyun', name: 'alidns20150109', version: '3.0.1'
}
tasks.matching { it instanceof Test }.all {
testLogging.events = ["failed", "passed", "skipped"]
}
protobuf {
generatedFilesBaseDir = "$projectDir/src"
protoc {
artifact = "com.google.protobuf:protoc:$protobufVersion"
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:$grpcVersion"
}
}
generateProtoTasks {
all().each { task ->
task.builtins {
java { outputSubDir = "java" }
}
}
all()*.plugins {
grpc {
outputSubDir = "java"
}
}
}
}
shadowJar {
baseName = 'libp2p'
classifier = null
version = null
zip64 = true
}
clean.doFirst {
delete "src/main/java/org/tron/p2p/protos"
}
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
[compileJava]*.options*.encoding = 'UTF-8'
}
compileTestJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
[compileTestJava]*.options*.encoding = 'UTF-8'
}
task sourcesJar(type: Jar) {
archiveClassifier.set('sources')
from sourceSets.main.allJava
}
task javadocJar(type: Jar) {
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
javadoc {
description = "Generates project-level javadoc for use in -javadoc jar"
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.version = true
options.header = project.name
options.addStringOption('Xdoclint:none', '-quiet')
// suppress warnings due to cross-module @see and @link references;
// note that global 'api' task does display all warnings.
logging.captureStandardError LogLevel.INFO
logging.captureStandardOutput LogLevel.INFO // suppress "## warnings" message
options.encoding = "UTF-8"
options.charSet = 'UTF-8'
}
artifacts {
archives javadocJar, sourcesJar
}