-
Notifications
You must be signed in to change notification settings - Fork 22
/
build.gradle
71 lines (58 loc) · 1.52 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
buildscript {
repositories {
jcenter()
}
}
plugins {
id 'base'
}
clean.doFirst {
delete "${rootDir}/build"
println "${rootDir}/build"
}
subprojects {
configurations {
publishArchives
}
repositories {
jcenter()
}
apply plugin: 'java'
group 'ai.h2o'
archivesBaseName = project.name
if (project.findProperty('archivesNameSuffix')) {
archivesBaseName += "-${project.findProperty('archivesNameSuffix')}"
}
compileJava {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
}
javadoc {
options.locale = 'en_US'
}
task checkJavaVersion {
doLast {
def prop = System.getenv('CHECK_JAVA_VERSION');
if (prop != "false" && !JavaVersion.current().isJava7()) {
String message = "ERROR: Java 7 required but " +
JavaVersion.current() +
" found. Change your JAVA_HOME environment variable."
throw new IllegalStateException(message)
}
}
}
compileJava.dependsOn checkJavaVersion
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives jar
publishArchives sourcesJar
publishArchives javadocJar
}
}