-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
129 lines (100 loc) · 3.21 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
apply plugin: 'eclipse'
apply plugin: 'java'
version = "0.1"
def projectName = "UnitTest"
description = "${projectName}"
sourceCompatibility = 1.8
targetCompatibility = 1.8
def defaultEncoding = 'UTF-8'
[compileJava, compileTestJava]*.options*.encoding = defaultEncoding
configurations {
implementation.exclude module: 'slf4j-log4j12'
implementation.exclude module: 'log4j'
implementation.exclude module: 'commons-logging'
}
project.buildDir = 'build'
repositories {
mavenCentral()
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'src/main/resources'
}
}
test {
java {
srcDir 'src/test/java'
}
resources {
srcDir 'src/test/resources'
}
}
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
def spring_version = "4.3.26.RELEASE"
List spring = [
"org.springframework:spring-aop:$spring_version",
"org.springframework:spring-aspects:$spring_version",
"org.springframework:spring-beans:$spring_version",
"org.springframework:spring-context:$spring_version",
"org.springframework:spring-context-support:$spring_version",
"org.springframework:spring-core:$spring_version",
"org.springframework:spring-jdbc:$spring_version",
"org.springframework:spring-orm:$spring_version",
"org.springframework:spring-test:$spring_version",
"org.springframework:spring-tx:$spring_version"
]
List druid = ["com.alibaba:druid:1.0.9"]
List mybatis = [
"org.mybatis:mybatis:3.2.8",
"org.mybatis:mybatis-spring:1.2.2"
]
List mysql = ["mysql:mysql-connector-java:5.1.32"]
List logger = [
"org.apache.logging.log4j:log4j-api:2.11.1",
"org.apache.logging.log4j:log4j-core:2.11.1",
"org.apache.logging.log4j:log4j-slf4j-impl:2.11.1",
"org.slf4j:jcl-over-slf4j:1.7.28"
]
List junit = ["junit:junit:4.13"]
List powermock = [
"org.powermock:powermock-module-junit4:2.0.7",
"org.powermock:powermock-api-mockito2:2.0.7"
]
List mockito = [
"org.mockito:mockito-core:3.4.6"
]
List h2database = ["com.h2database:h2:1.4.200"]
List lombok = ["org.projectlombok:lombok:1.18.12"]
List hibernate = [
"javax.persistence:javax.persistence-api:2.2",
"org.hibernate:hibernate-core:5.4.12.Final"
]
List jpa_entity_gen = [
"com.github.adrninistrator:jpa-entity-generator-enhance:0.0.1"
]
dependencies {
implementation spring, druid, mybatis, mysql, logger
testImplementation junit, powermock, mockito, h2database, lombok, hibernate, jpa_entity_gen
// test模块中使用了Lombok
testAnnotationProcessor lombok
}
compileJava.dependsOn clean
// jpa-entity-generator配置
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.github.adrninistrator:jpa-entity-generator-enhance:0.0.1'
//连接MySQL数据库需要的驱动
classpath 'mysql:mysql-connector-java:5.1.32'
}
}
apply from: 'unittest.gradle'