-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
100 lines (77 loc) · 2.84 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
import java.text.SimpleDateFormat
buildscript {
ext.kotlin_version = '1.3.0'
ext.koin_version = '2.0.0-GA'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'kotlin'
apply plugin: 'application'
version = '1.7.0'
sourceCompatibility = 1.8
targetCompatibility = 1.8
mainClassName = 'com.timcastelijns.room15bot.MainKt'
repositories {
jcenter()
maven { url = "https://jitpack.io" }
// Database
maven { url = "https://dl.bintray.com/kotlin/exposed" }
maven { url = 'https://mvnrepository.com/artifac/' }
}
dependencies {
implementation 'org.slf4j:slf4j-log4j12:1.7.5'
implementation 'com.github.TimCastelijns:ChatExchange:1.0.0-beta3'
implementation 'org.jetbrains:annotations:16.0.2'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
implementation "io.reactivex.rxjava2:rxjava:2.1.3"
implementation 'org.jsoup:jsoup:1.11.3'
implementation "org.koin:koin-core:$koin_version"
implementation "org.koin:koin-core-ext:$koin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.30.2-eap13'
implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2'
// Database
implementation 'org.jetbrains.exposed:exposed:0.10.4'
implementation "mysql:mysql-connector-java:5.1.46"
implementation 'org.mariadb.jdbc:mariadb-java-client:2.2.6'
// Testing
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testImplementation "org.koin:koin-test:$koin_version"
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.0.0-RC3"
}
task writeBuildConfig() {
def sdf = new SimpleDateFormat("dd-MM-yyyy HH:mm")
sdf.setTimeZone(TimeZone.getTimeZone("UTC"))
def formattedTimestamp = sdf.format(new Date())
def text = """|version: $version
|branch: ${getGitBranch()}
|commit: ${getGitHash()}
|buildtime: $formattedTimestamp
|""".stripMargin()
new File("$projectDir/gen").mkdir()
new File("$projectDir/gen/buildconfig.properties").text = text
}
def getGitBranch() {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--abbrev-ref', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}
def getGitHash() {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}
tasks.run.dependsOn(writeBuildConfig)