forked from qiniu/java-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
executable file
·92 lines (75 loc) · 2.32 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
import java.util.regex.Matcher
apply plugin: 'java'
apply plugin: 'jacoco'
sourceCompatibility = 1.7
targetCompatibility = 1.7
version = '1.0'
[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
repositories {
mavenCentral()
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}
dependencies {
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.14.4'
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'org.projectlombok:lombok:1.18.22'
testImplementation group: 'com.qiniu', name: 'happy-dns-java', version: '0.1.6'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
compileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22'
testCompileOnly 'org.projectlombok:lombok:1.18.22'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
}
test {
useJUnitPlatform()
}
task unitTest(type: Test) {
useJUnitPlatform {
includeTags 'UnitTest'
}
}
task getHomeDir {
doLast {
println gradle.gradleHomeDir
}
}
apply plugin: 'checkstyle'
task apiJavadocs(type: Javadoc) {
source = sourceSets.main.allJava
classpath = sourceSets.main.runtimeClasspath
title = "七牛 Java SDK API 文档"
options {
memberLevel = JavadocMemberLevel.PUBLIC
setEncoding 'UTF-8'
setWindowTitle "七牛 Java SDK API 文档"
}
}
def versionName() {
String config = getProjectDir().getPath() + '/src/main/java/com/qiniu/common/Constants.java'
String fileContents = new File(config).text
Matcher myMatcher = fileContents =~ /VERSION = "(.+)";/
String version = myMatcher[0][1]
println(version)
return version
}
static def versionNameToCode(String version) {
String v = version.replaceAll(/\./, '')
return v.toLong()
}
String version = versionName()
int code = versionNameToCode(version)
setProperty('VERSION_NAME', version)
setProperty('VERSION_CODE', code)
apply from: 'mvn_push.gradle'
apply plugin: 'eclipse'
task gen_eclipse(dependsOn: [
'cleanEclipseProject', 'cleanEclipseClasspath',
'eclipseProject', 'eclipseClasspath'])
eclipseProject.mustRunAfter cleanEclipseProject
eclipseClasspath.mustRunAfter cleanEclipseClasspath