-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
build.gradle
137 lines (120 loc) · 3.75 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
buildscript {
ext.kotlinVersion = "1.3.61"
ext.jooqPluginVersion = "4.1"
ext.flywayPluginVersion = "6.2.4"
ext.shadowPluginVersion = "5.2.0"
dependencies {
classpath "com.github.jengelman.gradle.plugins:shadow:$shadowPluginVersion"
classpath "nu.studer:gradle-jooq-plugin:$jooqPluginVersion"
}
repositories {
mavenCentral()
jcenter()
maven { url = "https://jitpack.io" }
}
}
plugins {
id "java"
id "org.jetbrains.kotlin.jvm" version "$kotlinVersion"
id "org.flywaydb.flyway" version "$flywayPluginVersion"
id "com.github.johnrengelman.shadow" version "$shadowPluginVersion"
id "nu.studer.jooq" version "$jooqPluginVersion"
}
repositories {
mavenCentral()
jcenter()
maven { url = "https://jitpack.io" }
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
def dbUrl = "jdbc:mariadb://localhost:3306/pooldb"
def dbUsername = "root"
def jooqVersion = "3.12.3"
def bundleSource = "$projectDir/client/build/bundle/main.bundle.js"
def bundleTarget = "$projectDir/src/main/resources/html/js/"
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
implementation 'io.reactivex.rxjava2:rxjava:2.2.14'
implementation 'com.github.burst-apps-team:burstkit4j:0.15.1'
implementation 'org.nanohttpd:nanohttpd:2.3.1'
implementation "org.flywaydb:flyway-core:5.2.4"
implementation "org.jooq:jooq:$jooqVersion"
implementation "org.jooq:jooq-meta:$jooqVersion"
implementation "org.jooq:jooq-codegen:$jooqVersion"
def log4jVersion = "2.12.1"
implementation "org.apache.logging.log4j:log4j-api:$log4jVersion"
implementation "org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion"
implementation "org.slf4j:slf4j-api:1.7.29"
implementation 'com.zaxxer:HikariCP:3.4.1'
implementation 'com.google.code.gson:gson:2.8.6'
implementation "org.ehcache:ehcache:3.8.1"
def mariaDbVersion = "2.5.1"
implementation "org.mariadb.jdbc:mariadb-java-client:$mariaDbVersion"
jooqRuntime "org.mariadb.jdbc:mariadb-java-client:$mariaDbVersion"
}
flyway {
url = dbUrl
user = dbUsername
locations = ["filesystem:"+project.projectDir.toString()+"/src/main/resources/db/migration"]
}
jooq {
version = jooqVersion
edition = "OSS"
burstPool(sourceSets.main) {
jdbc {
url = dbUrl
user = dbUsername
}
generator {
name = 'org.jooq.codegen.JavaGenerator'
database {
includes = ".*"
name = "org.jooq.meta.mariadb.MariaDBDatabase"
inputSchema = "pooldb"
outputSchemaToDefault = true
}
target {
packageName = "burst.pool.db"
directory = "src/main/java"
}
}
}
}
generateBurstPoolJooqSchemaSource.dependsOn flywayMigrate
generateBurstPoolJooqSchemaSource.onlyIf {System.getProperty("generateSchema") == "true"}
flywayMigrate.onlyIf {System.getProperty("generateSchema") == "true"}
task removeJsBundle {
doLast {
delete {
"$bundleSource"
"$bundleTarget"
}
}
}
task copyJsBundle {
doLast {
copy {
from "$bundleSource"
into "$bundleTarget"
}
}
}
copyJsBundle.dependsOn(removeJsBundle, ':client:bundle')
processResources.dependsOn copyJsBundle
jar {
manifest {
attributes 'Main-Class': 'burst.pool.Launcher'
}
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs += ["-Xuse-experimental=kotlin.Experimental", "-progressive"]
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}