-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
114 lines (86 loc) · 2.86 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.owasp:dependency-check-gradle:6.5.1'
classpath 'org.postgresql:postgresql:42.3.1'
}
}
plugins {
id 'java'
id 'org.flywaydb.flyway' version '8.4.1'
}
apply plugin: 'org.owasp.dependencycheck'
group 'com.zacharytalis'
version '1.0'
var dbConnectionUrl = System.getenv('DB_URL')
var jdbiVersion = '3.41.3'
java {
sourceCompatibility = JavaVersion.VERSION_20
}
flyway {
url = dbConnectionUrl
user = 'alttextbot-migrator'
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.jetbrains:annotations:23.0.0'
implementation 'org.postgresql:postgresql:42.3.8'
implementation "org.jdbi:jdbi3-core:${jdbiVersion}"
implementation "org.jdbi:jdbi3-sqlobject:${jdbiVersion}"
implementation "org.jdbi:jdbi3-guava:${jdbiVersion}"
implementation "org.jdbi:jdbi3-postgres:${jdbiVersion}"
implementation "com.zaxxer:HikariCP:5.0.1"
implementation "org.flywaydb:flyway-core:8.4.1"
implementation 'org.javacord:javacord:3.8.0'
implementation 'org.apache.logging.log4j:log4j-core:2.17.1'
// implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.17.1'
implementation 'org.apache.logging.log4j:log4j-to-slf4j:2.17.1'
implementation 'ch.qos.logback:logback-classic:1.2.10'
implementation 'com.google.guava:guava:31.0.1-jre'
implementation 'javax.mail:mail:1.4.7'
testImplementation group: 'junit', name: 'junit', version: '4.13.1'
}
tasks.register('cleanSetupFiles', Delete) {
delete "${buildDir}/libs/lib"
}
tasks.register('copyToLib', Copy) {
into "${buildDir}/libs/lib"
from configurations.runtimeClasspath
}
tasks.register('copySetupFiles', Copy) {
into "${buildDir}/libs"
from("${rootDir}/entrypoint.sh")
}
tasks.register('zipBuild', Zip) {
dependsOn(copySetupFiles)
dependsOn(copyToLib)
from "${buildDir}/libs/"
include '*'
include '*/*'
archiveFileName = 'alt-text-bot.zip'
destinationDirectory = file("${buildDir}/distributions/")
}
tasks.copyToLib.shouldRunAfter(tasks.cleanSetupFiles)
tasks.copySetupFiles.shouldRunAfter(tasks.copyToLib)
tasks.zipBuild.shouldRunAfter(tasks.copySetupFiles)
jar {
dependsOn cleanSetupFiles
dependsOn zipBuild
manifest {
attributes "Main-Class": "com.zacharytalis.alttextbot.EntryPoint",
"Class-Path": configurations.runtimeClasspath.collect {"lib/$it.name" }.join(' ')
}
archiveBaseName.set('AltTextBot')
exclude "META-INF/*.MF"
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
tasks.withType(JavaCompile).each {
it.options.compilerArgs.add('--enable-preview')
}
check.dependsOn dependencyCheckAnalyze