This repository has been archived by the owner on May 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
81 lines (69 loc) · 2.32 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
/*
* This file was generated by the Gradle 'init' task.
*
* This is a general purpose Gradle build.
* Learn how to create Gradle builds at https://guides.gradle.org/creating-new-gradle-builds/
*/
import org.apache.tools.ant.filters.ReplaceTokens
import java.text.SimpleDateFormat
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'maven'
group = 'support.kajstech'
version = '2.5.8'
description = "Discord KajBot"
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
task fatJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Fat KajBot',
'Implementation-Version': version,
'Main-Class': 'support.kajstech.KajBot.KajBot'
}
baseName = project.name + '-with-dependencies'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
processResources {
filesMatching('**project.properties') {
filter ReplaceTokens, tokens: [
'version': version
]
}
}
private static def getCurrentTimestamp ()
{
Date today = new Date ()
SimpleDateFormat df = new SimpleDateFormat ("HH:mm:ss dd-MM-yyyy")
return df.format (today)
}
task createProperties(dependsOn: processResources) {
doLast {
new File("$buildDir/resources/main/app.properties").withWriter { w ->
Properties p = new Properties()
p['version'] = project.version.toString()
p['buildtimestamp'] = getCurrentTimestamp().toString() + " (GMT+1)"
p.store w, null
}
}
}
classes {
dependsOn createProperties
}
repositories {
maven { url "https://jitpack.io" }
maven { url "http://jcenter.bintray.com" }
maven { url "http://repo.maven.apache.org/maven2" }
}
dependencies {
compile group: 'ch.qos.logback', name: 'logback-access', version:'1.3.0-alpha4'
compile group: 'ch.qos.logback', name: 'logback-classic', version:'1.3.0-alpha4'
compile group: 'com.mashape.unirest', name: 'unirest-java', version:'1.4.9'
compile group: 'net.dv8tion', name: 'JDA', version:'3.5.1_348'
compile group: 'com.sedmelluq', name: 'lavaplayer', version:'1.2.56'
compile group: 'com.sedmelluq', name: 'jda-nas', version:'1.0.5'
compile group: 'org.reflections', name: 'reflections', version: '0.9.10'
}