-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
60 lines (51 loc) · 1.57 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
import io.netifi.flatbuffers.plugin.tasks.FlatBuffers
plugins {
id 'java'
id "io.netifi.flatbuffers" version "1.0.6"
id 'com.github.gmazzo.buildconfig' version "2.0.1"
}
group 'com.github.ahmadsalim'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
maven { url 'https://raw.github.com/idsc-frazzoli/tensor/mvn-repo/' }
}
flatbuffers {
flatcPath = 'flatc'
language = 'java'
}
task createFlatBuffers(type: FlatBuffers) {
inputDir = file("src/main/ppx")
outputDir = file("src/main/java")
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
implementation 'org.zeromq:jeromq:0.5.2'
implementation 'ch.ethz.idsc:tensor:0.8.1'
implementation 'com.google.flatbuffers:flatbuffers-java:1.12.0'
implementation 'org.slf4j:slf4j-api:1.7.30'
implementation 'org.slf4j:slf4j-log4j12:1.7.30'
}
def getGitHash = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}
def getGitBranch = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--abbrev-ref', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}
buildConfig {
useJavaOutput()
buildConfigField 'String', 'APP_NAME', "\"${project.name}\""
buildConfigField 'String', 'APP_VERSION', "\"${project.version}\""
buildConfigField 'String', 'GIT_BRANCH', "\"$getGitBranch\""
buildConfigField 'String', 'GIT_COMMIT_HASH', "\"$getGitHash\""
}