-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
82 lines (71 loc) · 2.27 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import java.time.OffsetDateTime
import java.time.ZoneOffset
import java.time.format.DateTimeFormatter
plugins {
id 'application'
id 'maven-publish'
id 'eclipse'
id 'idea'
// id 'checkstyle'
id 'java'
alias(libs.plugins.shadow)
alias(libs.plugins.flyway)
}
group = 'io.github.themoddinginquisition.theinquisitor'
application {
mainClassName 'io.github.themoddinginquisition.theinquisitor.TheInquisitor'
}
configurations {
shade
implementation.extendsFrom(shade)
}
repositories {
mavenCentral()
maven {
url "https://m2.chew.pro/snapshots"
}
}
dependencies {
shade libs.jda
shade libs.flyway
shade libs.sqlite
shade libs.dotenv
shade libs.logback
shade libs.github.api
shade libs.jasypt
shade libs.gson
shade libs.chewtils
shade libs.nightconfig
shade libs.jdahelper
shade libs.guava
shade libs.cfapi
shade libs.jdbi.core
shade libs.jdbi.sqlobject
compileOnly libs.annotations
}
tasks.named('shadowJar', ShadowJar).configure {
configurations = [project.configurations.shade]
manifest.attributes(makeManifestAttributes(application.getMainClass().get()))
classifier 'all'
group 'build'
description 'Builds the whole project with its dependencies.'
}
def makeManifestAttributes(String mainClass) {
final var actualDateTime = OffsetDateTime.now(ZoneOffset.UTC).withNano(0)
final var currentDateTime = DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(actualDateTime)
return [
'Maven-Artifact' : "${project.group}:${archivesBaseName}:${project.version}",
'Timestamp' : currentDateTime,
'Specification-Title' : archivesBaseName,
'Specification-Vendor' : 'TheModdingInquisition',
'Specification-Version' : '1',
'Implementation-Title' : archivesBaseName,
'Implementation-Version' : "${project.version}",
'Implementation-Vendor' : 'TheModdingInquisition',
'Implementation-Timestamp': currentDateTime,
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
'Built-On-JDA' : "${project.libs.versions.jda.get()}",
'Main-Class' : mainClass
]
}