-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
85 lines (74 loc) · 2.12 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
buildscript {
repositories {
mavenLocal()
// https://maven.aliyun.com/mvn/view
maven { url 'https://maven.aliyun.com/repository/public' }
jcenter()
mavenCentral()
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven { url 'https://plugins.gradle.org/m2/' }
}
}
import java.nio.file.Files
import java.nio.file.Paths;
plugins {
id 'java'
id 'application'
id 'checkstyle'
id 'com.github.sherter.google-java-format' version '0.8'
id 'org.springframework.boot' version '2.1.4.RELEASE'
id "io.freefair.lombok" version "3.5.2"
id "io.spring.dependency-management" version "1.0.7.RELEASE"
}
allprojects {
repositories {
mavenLocal()
maven { url 'https://maven.aliyun.com/repository/public' }
jcenter()
mavenCentral()
maven { url 'http://repo.spring.io/release' }
maven { url 'http://repo.spring.io/milestone' }
maven { url 'http://repo.spring.io/snapshot' }
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'io.freefair.lombok'
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-logging:2.1.4.RELEASE'
implementation 'org.projectlombok:lombok:1.18.8'
implementation 'org.apache.httpcomponents:httpclient:4.5'
implementation 'commons-lang:commons-lang:2.6'
}
}
googleJavaFormat {
toolVersion = "1.7"
}
checkstyle {
toolVersion '8.21'
}
/**
* checkstyle all java files
*
* @note - Task[Checkstyle] depends on Plugin[checkstyle]
* - Checkstyle does not have functionality of auto-fixing
*/
// noinspection GroovyAssignabilityCheck
task checkJava(type: Checkstyle) {
configFile = file('config/checkstyle/checkstyle.xml')
classpath = files()
source './'
if (System.properties.checkJavaInclude != null) {
def s = ((String)System.properties.checkJavaInclude).split(',')
def i = Arrays.asList(s)
include i
}
}
try {
// Copy git pre-commit hook
if (Files.exists(Paths.get('.git')) && !Files.exists(Paths.get('.git/hooks/pre-commit'))) {
Files.copy(Paths.get('config/hooks/pre-commit-stub'), Paths.get('.git/hooks/pre-commit'));
}
}
catch (e) {}