This repository has been archived by the owner on Sep 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
74 lines (63 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
apply plugin: 'java'
group 'gk.tweetsched'
version '1.' + System.getProperty("buildNumber")
def fatJarFolder = 'build/libs/'
def distFolder = 'build/dist'
def tempDistFolder = 'build/tmp-dist/'
def configFolder = 'config/'
def startupShFileName = 'startup.sh'
def startupScript =
"""#!/bin/bash
nohup java -jar tweetsched-cron-${version}.jar &
PID=\$!
echo \$PID > pid.txt
"""
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
test {
useTestNG() {
useDefaultListeners = true
suites 'src/test/resources/testng.xml'
}
}
task fatJar(type: Jar, dependsOn: test) {
manifest {
attributes 'Main-Class': 'gk.tweetsched.cron.TweetschedCronTrigger'
}
baseName = project.name
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
task copyJar(dependsOn: fatJar, type: Copy) {
from fatJarFolder
into tempDistFolder
}
task copyConf(dependsOn: copyJar, type: Copy) {
from configFolder
into tempDistFolder
}
task release(dependsOn: copyConf, type: Zip) {
doFirst {
def startupFile = new File(tempDistFolder + startupShFileName)
startupFile.text = startupScript
}
from tempDistFolder
into project.name
destinationDir file(distFolder)
}
dependencies {
compile 'org.springframework:spring-core:5.0.6.RELEASE'
compile 'org.springframework:spring-context:5.0.6.RELEASE'
compile 'redis.clients:jedis:2.9.0'
compile 'com.google.code.gson:gson:2.8.5'
compile 'org.apache.logging.log4j:log4j-core:2.11.0'
compile 'org.apache.logging.log4j:log4j-api:2.11.0'
compile 'org.glassfish.jersey.core:jersey-client:2.26'
compile 'org.glassfish.jersey.core:jersey-common:2.26'
compile 'org.glassfish.jersey.inject:jersey-hk2:2.26'
compile 'com.github.Tweetsched:tweetsched-dto:1.33'
testCompile 'org.testng:testng:6.14.3'
testCompile 'org.mockito:mockito-all:1.10.19'
}