-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
140 lines (120 loc) · 3.57 KB
/
build.gradle
File metadata and controls
140 lines (120 loc) · 3.57 KB
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
import org.apache.tools.ant.taskdefs.condition.Os
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'application'
mainClassName = 'com.rp.Wave'
ext {
junitVersion = '4.11'
h2oProjectVersion = "$h2oMajorVersion.$h2oBuild"
}
def getOsSpecificCommandLine(args) { return Os.isFamily(Os.FAMILY_WINDOWS) ? ['cmd', '/c' ] + args : args }
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3' // useful for making uberjar
}
}
repositories {
if (h2oBuild == '99999') mavenLocal()
mavenCentral()
maven {
url "http://h2o-release.s3.amazonaws.com/h2o/master/3682/maven/repo/"
}
}
sourceSets {
main {
resources {
srcDirs = ['src/main/java', 'web']
}
}
}
dependencies {
compile "ai.h2o:h2o-algos:${h2oProjectVersion}"
compile "ai.h2o:h2o-app:${h2oProjectVersion}"
compile "ai.h2o:h2o-core:${h2oProjectVersion}"
compile "ai.h2o:h2o-genmodel:${h2oProjectVersion}"
// compile "ai.h2o:h2o-persist-hdfs:${h2oProjectVersion}"
compile "ai.h2o:h2o-web:${h2oProjectVersion}"
// Groovy
compile 'org.codehaus.groovy:groovy-all:2.4.5'
compile 'org.fusesource.jansi:jansi:1.11'
compile 'jline:jline:2.13'
// to json
compile 'com.fasterxml.jackson.core:jackson-databind:2.7.2'
compile 'com.fasterxml.jackson.module:jackson-module-jsonSchema:2.7.1'
testCompile 'junit:junit:4.11'
}
// uncomment for test printout
//test {
// afterTest { desc, result ->
// println "Executing test ${desc.name} [${desc.className}] with result: ${result.resultType}"
// }
// testLogging.showStandardStreams = true
//}
// Setup group ID for this project
group = "com.rp"
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileJava {
options.debug = true
}
task wrapper(type: Wrapper) {
gradleVersion = '2.13'
}
task buildElm << {
ProcessBuilder builder = new ProcessBuilder(Arrays.asList('elm', "make",
'WebSocketExample.elm',
'--output=../../../web/www/wave/index.html',
'--warn'
))
builder.directory(new File("src/main/elm"));
builder.redirectErrorStream(true)
//builder.directory(new File('/home/tony/git-projects/guru-api/src/main/elm/'))
Process process = builder.start()
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line = null;
while( (line = reader.readLine())!=null ) System.out.println(line);
}
shadowJar {
mergeServiceFiles()
classifier = ''
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.SF'
exclude 'synchronize.properties'
exclude 'uploader.properties'
exclude 'test.properties'
exclude 'cockpitlite.properties'
exclude 'devpay_products.properties'
manifest {
attributes 'Main-Class': 'com.rp.Wave'
}
append 'web/www'
}
task cleanElm(type: Exec) {
commandLine getOsSpecificCommandLine(["rm", "src/main/elm/index.html"])
commandLine getOsSpecificCommandLine(["rm", "web/www/wave/index.html"])
}
clean.dependsOn cleanElm
artifacts {
archives shadowJar
}
def assembly = "wave-0.1.0-SNAPSHOT.jar"
def allInOne = "wave.jar"
task copyJar(type: Copy) {
from ("build/libs"){
include assembly
}
into "build"
rename { it.replace(assembly, allInOne) }
}
// Execute always copyJar
shadowJar.finalizedBy copyJar
// Run shadowJar as par of build
jar.finalizedBy shadowJar
build.dependsOn buildElm