forked from qiniu/happy-dns-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
executable file
·67 lines (50 loc) · 1.55 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
import java.util.regex.Matcher
apply plugin: 'java'
sourceCompatibility = 1.6
targetCompatibility = 1.6
version = '1.0'
[compileJava,compileTestJava,javadoc]*.options*.encoding = 'UTF-8'
//[compileJava, compileTestJava]*.options.collect {options ->
// options.debug = true
// options.deprecation = true
// options.compilerArgs.add '-Xlint'
// options.compilerArgs.add '-Xlint:-unchecked'
// options.compilerArgs.add '-Xlint:-serial'
// options.compilerArgs.add '-Xlint:-rawtypes'
//}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked"
}
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
}
task getHomeDir << {
println gradle.gradleHomeDir
}
apply plugin: 'checkstyle'
def versionName() {
String config = 'src/main/java/qiniu/happydns/Version.java'
String fileContents = new File(config).text
Matcher myMatcher = fileContents =~ /VERSION = "(.+)";/
String version = myMatcher[0][1]
println(version)
return version
}
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