forked from tronprotocol/wallet-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
250 lines (217 loc) · 8.25 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.3'
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
}
}
plugins {
id "application"
}
version = '1.0.1'
sourceCompatibility = 1.8
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
mainClassName = 'org.tron.walletcli.Client'
apply plugin: 'java'
apply plugin: 'com.google.protobuf'
//apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'maven-publish'
//compileJava.options*.compilerArgs = [
// "-Xlint:serial", "-Xlint:varargs", "-Xlint:classfile", "-Xlint:dep-ann",
// "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally", "-Xlint:overrides",
// "-Xlint:path", "-Xlint:static", "-Xlint:try", "-Xlint:fallthrough",
// "-Xlint:deprecation", "-Xlint:unchecked", "-Xlint:-options"
//]
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar {
classifier "sources"
}
}
}
repositories {
mavenLocal()
}
}
//task sourceJar(type: Jar, dependsOn: classes) {
// classifier 'sources'
// from sourceSets.main.allSource
//}
// Maven Publish Begin
task sourceJar(type: Jar) {
from sourceSets.main.allJava
}
repositories {
mavenLocal()
mavenCentral()
maven { url 'http://repo.spring.io/plugins-release' }
}
task wrapper(type: Wrapper) {
gradleVersion = '4.10'
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile group: 'com.beust', name: 'jcommander', version: '1.72'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
compile group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.25'
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
compile 'com.maxmind.geoip2:geoip2:2.10.0'
// google grpc
compile group: 'io.grpc', name: 'grpc-netty', version: '1.9.0'
compile group: 'io.grpc', name: 'grpc-protobuf', version: '1.9.0'
compile group: 'io.grpc', name: 'grpc-stub', version: '1.9.0'
compile group: 'com.googlecode.protobuf-java-format', name: 'protobuf-java-format', version: '1.4'
compile "com.madgag.spongycastle:core:1.53.0.0"
compile "com.madgag.spongycastle:prov:1.53.0.0"
compile group: 'com.typesafe', name: 'config', version: '1.3.2'
// compile "com.google.code.findbugs:jsr305:3.0.0"
compile group: 'org.springframework', name: 'spring-context', version: '4.2.0.RELEASE'
compile group: 'org.springframework', name: 'spring-tx', version: '4.2.0.RELEASE'
// https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-consul-discovery
compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-consul-discovery', version: '1.3.5.RELEASE'
// compile "org.springframework.cloud:spring-cloud-starter-consul-discovery:${springCloudConsulVersion}"
compile "org.apache.commons:commons-collections4:4.0"
compile group: 'com.google.api.grpc', name: 'googleapis-common-protos', version: '0.0.3'
// compile group: 'ch.qos.logback', name: 'logback-classic', version:'1.2.3'
compile group: 'redis.clients', name: 'jedis', version: '2.9.0'
compile group: 'mysql', name: 'mysql-connector-java', version:'5.1.18'
compile group: 'commons-dbcp', name: 'commons-dbcp', version:'1.4'
compile group: 'commons-pool', name: 'commons-pool', version:'1.6'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version:'4.3.5'
testCompile group: 'junit', name: 'junit', version:'4.7'
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.7'
// https://mvnrepository.com/artifact/com.alibaba/fastjson
compile group: 'com.alibaba', name: 'fastjson', version: '1.2.47'
// https://mvnrepository.com/artifact/org.quartz-scheduler/quartz
compile group: 'org.quartz-scheduler', name: 'quartz', version: '2.3.0'
compile "io.vavr:vavr:0.9.2"
}
tasks.matching { it instanceof Test }.all {
testLogging.events = ["failed", "passed", "skipped"]
}
if (project.hasProperty("mainClass")) {
mainClassName = mainClass
}
sourceSets {
main {
proto {
srcDir 'src/main/protos'
}
java {
srcDir 'src/main/gen'
srcDir 'src/main/java'
}
}
}
protobuf {
generatedFilesBaseDir = "$projectDir/src/"
protoc {
artifact = "com.google.protobuf:protoc:3.5.1-1"
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.9.0'
}
}
generateProtoTasks {
all().each { task ->
task.builtins {
java {
outputSubDir = "gen"
}
}
}
all()*.plugins {
grpc {
outputSubDir = "gen"
}
}
}
}
run {
standardInput = System.in
mainClassName = 'org.tron.script.QuartzTasks'
}
shadowJar {
baseName = 'QuartzTasks'
classifier = null
version = null
}
//
def binaryRelease(taskName, jarName, mainClass) {
return tasks.create("${taskName}", Jar) {
baseName = jarName
version = null
from(sourceSets.main.output) {
include "/**"
}
from {
configurations.compile.collect {
it.isDirectory() ? it : zipTree(it)
}
}
manifest {
attributes "Main-Class": "${mainClass}"
}
}
}
artifacts {
archives(binaryRelease('buildYYester', 'YYesterScript', 'org.tron.walletcli.YYester'),
binaryRelease('buildQuartzTasks', 'QuartzTasks', 'org.tron.script.QuartzTasks'),
)
}
//task shadowJarTwo(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
// classifier = 'all2'
// from sourceSets.main.output
// configurations = [project.configurations.runtime]
// exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA')
// manifest.attributes 'Main-Class': 'org.tron.script.YYester' // The main attraction! Be sure to update this line
// archiveName = 'YYester.jar'
//}
//dependencies {
// compile subprojects
//}
//
//subprojects {
// apply plugin: 'java'
// repositories {
// mavenCentral()
// maven { url "http://repository.cloudera.com/artifactory/cloudera-repos/" }
//
// }
// dependencies {
// compile group: 'org.apache.hadoop', name: 'hadoop-core', version:'2.5.0-mr1-cdh5.3.3'
// testCompile group: 'org.mockito', name: 'mockito-all', version:'1.10.19'
// testCompile group: 'junit', name: 'junit', version:'4.11'
// }
//}
//jar {
// def manifestClasspath = configurations.runtime.collect { it.getName() }.join(' ')
// archiveName = 'CTScript.jar'
// manifest {
// attributes 'Implementation-Title': "Test thing",
// 'Implementation-Version': '0.0.1',
// 'Built-By': System.getProperty('user.name'),
// 'Built-Date': new Date(),
// 'Built-JDK': System.getProperty('java.version'),
// 'Built-Gradle': gradle.gradleVersion,
// 'Class-Path': manifestClasspath,
// 'Main-Class': 'org.tron.script.CTScript'
// }
//}
//task bootstrapNodeJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
// mergeServiceFiles()
// manifest.attributes 'Main-Class': 'org.tron.script.YYester' // The main attraction! Be sure to update this line
// classifier = null // General jar task property - see more about it in the Gradle manual
// from(project.convention.getPlugin(JavaPluginConvention).sourceSets.main.output) // Leave as is
// configurations = [project.configurations.runtime] // Same as the above
// exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA') // This one is actually really important!
// archiveName = 'YYester.jar'
//}