forked from dreamhead/moco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
163 lines (141 loc) · 5.23 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
allprojects {
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'signing'
}
idea {
project {
jdkName = JavaVersion.VERSION_1_7
languageLevel = JavaVersion.VERSION_1_7
vcs = "Git"
}
workspace.iws.withXml { provider ->
def junitDefaults = provider.node.component.find { it.@name == 'RunManager' }.configuration.find {
it.@type == 'JUnit'
}
junitDefaults.option.find { it.@name == 'WORKING_DIRECTORY' }.@value = '$MODULE_DIR$'
}
}
subprojects {
apply plugin: 'java'
group = 'com.github.dreamhead'
version = '0.12.1-SNAPSHOT'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
repositories {
jcenter()
mavenCentral()
}
project.uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/content/repositories/snapshots") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
pom.project {
name project.name
packaging 'jar'
description 'Moco is an easy setup stub framework, mainly focusing on testing and integration.'
url 'https://github.com/dreamhead/moco'
scm {
url 'https://github.com/dreamhead/moco'
connection 'https://github.com/dreamhead/moco.git'
developerConnection 'git@github.com:dreamhead/moco.git'
}
licenses {
license {
name 'MIT Licence'
url 'https://raw.github.com/dreamhead/moco/master/MIT-LICENSE.txt'
distribution 'repo'
}
}
developers {
developer {
id 'dreamhead'
name 'Zheng Ye'
}
}
}
}
}
}
project.ext {
guavaVersion = '20.0'
nettyVersion = '4.1.36.Final'
slf4jVersion = '1.7.26'
jacksonVersion = '2.9.9'
junitVersion = '4.12'
hamcrestVersion = '2.1'
mockitoVersion = '2.28.2'
httpComponentVersion = '4.5.8'
jsonpathVersion = '2.4.0'
freemarkerVersion = '2.3.28'
jsonAssertVersion = '1.5.0'
}
project.jar {
manifest {
attributes 'Package': "com.github.dreamhead",
'Implementation-Title': "${project.name}",
'Implementation-Version': "${version}",
'Implementation-Vendor': 'Zheng Ye',
'Built-By': 'Zheng Ye',
'Built-Date': new Date().getDateTimeString(),
'Built-With': "gradle-${project.getGradle().getGradleVersion()}, groovy-${GroovySystem.getVersion()}",
'Created-By': 'Java ' + System.getProperty('java.version') + ' (' + System.getProperty('java.vendor') + ')'
}
}
project.dependencies {
implementation(
"com.google.guava:guava:$guavaVersion",
"io.netty:netty-codec-http:$nettyVersion",
"io.netty:netty-handler:$nettyVersion",
"com.fasterxml.jackson.core:jackson-databind:$jacksonVersion",
"org.apache.httpcomponents:httpclient:$httpComponentVersion",
"com.jayway.jsonpath:json-path:$jsonpathVersion",
"org.freemarker:freemarker:$freemarkerVersion",
"org.slf4j:slf4j-api:$slf4jVersion"
)
testImplementation(
"junit:junit:$junitVersion",
"org.hamcrest:hamcrest-core:$hamcrestVersion",
"org.hamcrest:hamcrest-library:$hamcrestVersion",
"org.mockito:mockito-core:$mockitoVersion",
"org.apache.httpcomponents:fluent-hc:$httpComponentVersion",
"org.skyscreamer:jsonassert:$jsonAssertVersion"
)
}
test {
testLogging {
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
println "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
}
}
}
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked"
options.compilerArgs << "-Xlint:deprecation"
}
}
wrapper {
gradleVersion = '4.10.2'
}