forked from twosigma/beakerx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
108 lines (88 loc) · 3.38 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
/*
* Copyright 2017 TWO SIGMA OPEN SOURCE, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
apply plugin: 'java'
apply plugin: 'maven-publish'
ext.kernelIdName = 'base'
repositories {
mavenCentral()
}
compileJava {
options.compilerArgs << '-Xlint:sunapi'
options.compilerArgs << '-XDenableSunApiLintControl'
options.encoding = "UTF-8"
}
dependencies {
compile group: 'com.opencsv', name: 'opencsv', version: '3.10'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.6.5'
compile group: 'com.github.jupyter', name: 'jvm-repr', version: '0.3.1'
compile group: 'com.google.inject', name: 'guice', version: '3.0'
compile group: "commons-codec", name: "commons-codec", version: "1.9"
compile group: 'commons-io', name: 'commons-io', version: '2.5'
compile group: 'commons-cli', name: 'commons-cli', version: '1.2'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.6'
compile group: 'org.apache.commons', name: 'commons-text', version: '1.1'
compile group: 'org.apache.maven.shared', name: 'maven-invoker', version: '3.0.0'
compile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.25'
compile group: "org.zeromq", name: "jeromq", version: "0.3.5"
compile group: 'org.apache.ivy', name: 'ivy', version: '2.4.0'
compile group: 'org.antlr', name: 'antlr4-runtime', version: '4.5'
compile group: 'junit', name: 'junit', version: '4.11'
compile group: 'org.assertj', name: 'assertj-core', version: '3.6.1'
compile group: 'com.google.code.gson', name: 'gson', version: '2.3.1'
compile group: 'net.sf.py4j', name: 'py4j', version: '0.10.7'
testCompile group: 'org.reflections', name: 'reflections', version: '0.9.10'
}
publishing {
publications {
maven(MavenPublication) {
groupId 'com.twosigma'
artifactId 'beaker-kernel-base'
version '2.0-SNAPSHOT'
from components.java
}
}
}
def gitGetHash() {
def name = "git log --pretty=format:%h -n 1".execute().text.trim()
return name
}
def resourceDir = file("./src/main/resources")
def gitGetCommitHash() {
return "git rev-list --tags --max-count=1".execute().text.trim()
}
def gitGetLatestTagVersion() {
def gitLatestTag = "git describe --tags " + gitGetCommitHash() + ""
return gitLatestTag.execute().text.trim()
}
def mainDir = file("../../")
task prepareBuildVersion() {
doLast {
new File(resourceDir, 'version').write(gitGetLatestTagVersion())
new File(resourceDir, 'hash').write(gitGetHash())
new File(resourceDir, 'build_time').write(new Date().format("yyyy-MM-dd HH:mm z"))
new File(mainDir, 'VERSION').write(gitGetLatestTagVersion())
}
}
compileJava.dependsOn prepareBuildVersion
task copyDependencies(type: Copy) {
from configurations.runtime
from jar
into new File(pathToStaticContent, 'base/lib')
}
jar.finalizedBy copyDependencies
staticContent {
ext.executeStaticContent = false
}