This repository was archived by the owner on Feb 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
85 lines (72 loc) · 1.92 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
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'se.transmode.gradle:gradle-docker:1.2'
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.4'
}
}
apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'docker'
apply plugin: 'com.github.johnrengelman.shadow'
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
ext {
scalaVersion = '2.11'
}
group 'jvmbloggers'
version '0.1'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile 'com.typesafe.akka:akka-stream-kafka_2.11:0.12'
compile 'com.restfb:restfb:1.33.0'
compile 'org.projectlombok:lombok:1.16.10'
compile 'ch.qos.logback:logback-classic:1.1.7'
compile 'com.fasterxml.jackson.core:jackson-databind:2.8.4'
compile 'org.antlr:ST4:4.0.8'
compile 'net.jodah:failsafe:1.0.0'
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
testCompile 'com.github.charithe:kafka-junit:3.0.0'
testCompile 'cglib:cglib-nodep:3.2.4'
testCompile 'org.objenesis:objenesis:2.4'
}
String getTimestampWithGitHash() {
String timeStamp = new Date().format('yyyyMMdd-HHmmss')
String cmd = "git log --pretty=format:%h -n 1"
def proc = cmd.execute()
proc.waitFor()
return timeStamp + '-' + proc.in.text
}
task buildDocker(type: Docker, dependsOn: shadowJar) {
push = true
applicationName = jar.baseName
dockerfile = file('src/main/docker/Dockerfile')
tagVersion = jar.version + '-' + getTimestampWithGitHash()
doFirst {
copy {
from shadowJar
into stageDir
}
}
}
jar {
manifest {
attributes 'Main-Class': 'com.jvm_bloggers.facebook.client.Application'
}
}
shadowJar {
configurations = [project.configurations.compile]
append('reference.conf')
}