forked from tronprotocol/trident
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
185 lines (155 loc) · 4.26 KB
/
build.gradle
File metadata and controls
185 lines (155 loc) · 4.26 KB
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
def VERSION = '0.11.0'
group 'io.github.tronprotocol'
buildscript {
repositories {
mavenLocal()
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url "https://cdn.lfrs.sl/repository.liferay.com/nexus/content/groups/public"
}
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'
classpath 'com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:8.1.1'
}
}
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'maven-publish'
ext {
bouncycastleVersion = '1.78.1'
junitJupiterVersion = '5.4.2'
googleGuavaVersion = '33.0.0-jre'
}
allprojects {
version = VERSION
repositories {
mavenCentral()
}
tasks.withType(Javadoc).tap {
configureEach {
options.encoding = 'UTF-8'
options.charSet = 'UTF-8'
options.addStringOption('Xdoclint:none', '-quiet')
options {
tags = [
'apiNote:a:API Note:',
'implSpec:a:Implementation Requirements:',
'implNote:a:Implementation Note:'
]
}
exclude '**/internal/**'
exclude '**/impl/**'
failOnError = false
logging.captureStandardError LogLevel.INFO
logging.captureStandardOutput LogLevel.INFO
}
}
configurations.configureEach {
resolutionStrategy {
force "com.google.guava:guava:$googleGuavaVersion"
}
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'checkstyle'
tasks.withType(Jar).configureEach {
destinationDirectory = rootProject.file("build/libs")
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.current()
}
dependencies {
testImplementation "org.junit.jupiter:junit-jupiter:$junitJupiterVersion"
compileOnly 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.projectlombok:lombok:1.18.34'
testCompileOnly 'org.projectlombok:lombok:1.18.34'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.34'
}
test {
useJUnitPlatform()
testLogging {
events 'passed', 'skipped', 'failed'
}
}
tasks.register('sourcesJar', Jar) {
dependsOn classes
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
tasks.register('javadocJar', Jar) {
dependsOn javadoc
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
tasks.withType(JavaCompile).configureEach {
//options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
configurations {
checkstyleConfig
}
configurations.named('checkstyleConfig') {
transitive = false
}
checkstyle {
toolVersion = "8.29"
configFile = file("../config/checkstyle/checkStyleAll.xml")
}
checkstyleMain {
source = 'src/main/java'
exclude '**/trident/api/**'
exclude '**/trident/proto/**'
}
checkstyleTest {
source = files() //use empty files to ignore test class
}
}
shadowJar {
zip64 = true
}
javadoc {
source subprojects.collect { project ->
project.sourceSets.main.allJava
}
classpath = files(subprojects.collect { project ->
project.sourceSets.main.compileClasspath
})
}
tasks.register('javadocJar', Jar) {
archiveClassifier = 'javadoc'
archiveVersion = VERSION
from javadoc
}
tasks.register('sourcesJar', Jar) {
archiveClassifier = 'sources'
archiveVersion = VERSION
from subprojects.collect { project ->
project.sourceSets.main.allSource
}
}
tasks.register('buildLib', Jar) {
archiveVersion = VERSION
from subprojects.collect { project ->
project.sourceSets.main.output
}
}
tasks.named('build') {
dependsOn javadocJar, sourcesJar, buildLib
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}