-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
172 lines (150 loc) · 5.1 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
plugins {
id 'com.github.sherter.google-java-format' version '0.8'
id 'org.ajoberstar.grgit' version '4.0.1'
}
// Apply the java-library plugin to add support for Java Library
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'java'
//apply plugin: 'war'
apply plugin: 'jacoco'
// In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url 'https://maven.aliyun.com/repository/public' }
mavenCentral()
}
sourceCompatibility = 1.8
version '1.4.0'
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
exclude group: 'org.yaml', module: 'snakeyaml'
}
def log4j_version = "2.19.0"
List logger = [
"org.apache.logging.log4j:log4j-api:$log4j_version",
"org.apache.logging.log4j:log4j-slf4j-impl:$log4j_version"
]
dependencies {
compile logger
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
compile 'com.fasterxml.jackson.core:jackson-databind:2.14.2'
compile 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359'
compile ('com.moandjiezana.toml:toml4j:0.7.2') {
exclude group: 'com.google.code.gson', module: 'gson'
}
compile 'com.google.code.gson:gson:2.8.9'
compile ('org.springframework.boot:spring-boot-starter-web:2.7.18'){
exclude group: 'org.yaml', module: 'snakeyaml'
}
compile 'org.springframework.boot:spring-boot-starter-security:2.7.18'
compile 'org.springframework.boot:spring-boot-starter-data-jpa:2.7.18'
compile 'org.apache.tomcat.embed:tomcat-embed-core:9.0.83'
compile 'org.springframework:spring-core:5.3.32'
compile 'mysql:mysql-connector-java:8.0.33'
compile 'com.auth0:java-jwt:3.19.1'
compile 'io.netty:netty-all:4.1.107.Final'
compile 'org.bouncycastle:bcprov-jdk18on:1.77'
compile 'com.alibaba:druid:1.2.9'
compile 'commons-codec:commons-codec:1.15'
compile 'javax.mail:mail:1.4.7'
configurations.compile.exclude(group: 'ch.qos.logback')
configurations.compile.exclude(group: 'org.apache.logging.log4j', module: 'log4j-to-slf4j')
// Use JUnit test framework
testImplementation 'junit:junit:4.13.2'
testImplementation('org.springframework.boot:spring-boot-starter-test:2.7.18') {
exclude group: 'org.yaml', module: 'snakeyaml'
exclude group: 'org.springframework.boot', module: 'spring-boot-starter'
exclude group: 'org.springframework.boot', module: 'spring-beans'
}
testImplementation 'net.minidev:json-smart:2.4.9'
testImplementation 'com.jayway.jsonpath:json-path:2.9.0'
testImplementation 'org.springframework:spring-beans:5.3.20'
testImplementation ('org.springframework.boot:spring-boot-starter') {
exclude group: 'org.yaml', module: 'snakeyaml'
}
}
sourceSets {
main {
resources {
//exclude 'contracts/*'
}
}
}
googleJavaFormat {
options style: 'AOSP'
source = sourceSets*.allJava
include '**/*.java'
exclude '**/temp/*.java'
}
verifyGoogleJavaFormat {
source = sourceSets*.allJava
include '**/*.java'
exclude '**/temp/*.java'
}
jar {
destinationDir file('dist/apps')
archiveName project.name + "-" + project.version + '.jar'
exclude '**/*.xml'
exclude '**/*.toml'
exclude '**/*.properties'
exclude '**/*.yml'
exclude '**/*.crt'
exclude '**/*.key'
exclude '**/*.sql'
exclude '**/*.pem'
manifest {
try {
def repo = grgit.open(dir: file('.').canonicalPath)
if (repo != null) {
def date = new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
def branch = repo.branch.getCurrent().getName()
def commit = repo.head().getAbbreviatedId(40)
attributes(["Implementation-Timestamp": date,
"Git-Branch" : branch,
"Git-Commit" : commit
])
logger.info(" Commit : ")
logger.info(" => date: {}", date)
logger.info(" => branch: {}", branch)
logger.info(" => commit: {}", commit)
}
} catch (Exception e) {
// logger.warn(' .git not exist, cannot found commit info')
}
}
doLast {
copy {
from file('src/main/resources/')
into 'dist/conf'
}
copy {
from configurations.runtime
into 'dist/lib'
}
copy {
from file('.').listFiles().findAll { File f -> (f.name.endsWith('.sh') || f.name.endsWith('.env')) }
into 'dist'
}
copy {
from file('scripts/')
into 'dist'
}
}
}
test {
testLogging.showStandardStreams = true
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}