-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
89 lines (73 loc) · 2.77 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
plugins {
id 'java'
}
version = "${project_version}" + (isSnapshot() ? '+' + getBuildNumber() : '')
description = 'A library for Diluv\'s databases.'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.14.1'
implementation group: 'com.zaxxer', name: 'HikariCP', version: '4.0.3'
implementation group: 'org.flywaydb', name: 'flyway-core', version: '7.12.0'
implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.7.3'
implementation group: 'org.hibernate', name: 'hibernate-hikaricp', version: '5.5.6.Final'
implementation group: 'org.hibernate', name: 'hibernate-core', version: '5.5.6.Final'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: '5.7.2'
testImplementation group: 'org.testcontainers', name: 'testcontainers', version: '1.16.0'
testImplementation group: 'org.testcontainers', name: 'mariadb', version: '1.16.0'
testImplementation group: 'org.testcontainers', name: 'junit-jupiter', version: '1.16.0'
}
test {
useJUnitPlatform()
}
task sourcesJar(type: Jar, dependsOn: classes) {
description = 'Creates a JAR containing the source code.'
from sourceSets.main.allSource
archiveClassifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
description = 'Creates a JAR containing the JavaDocs.'
from javadoc.destinationDir
archiveClassifier = 'javadoc'
}
task testJar(type: Jar, dependsOn: testClasses) {
description = 'Creates a JAR containing the Tests.'
from sourceSets.test.output
archiveClassifier = 'test'
}
configurations {
testOutput.extendsFrom(testCompile)
}
artifacts {
archives sourcesJar
archives javadocJar
testOutput testJar
}
jar {
manifest {
attributes([
'Timestamp' : System.currentTimeMillis(),
'Specification-Title' : project.archivesBaseName,
'Specification-Vendor' : project.vendor,
'Specification-Version' : project.version,
'Implementation-Title' : project.archivesBaseName,
'Implementation-Version' : project.version,
'Implementation-Vendor' : project.vendor,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})"
])
}
}
static String getBuildNumber() {
return System.getenv("GITHUB_RUN_NUMBER") ?: "0"
}
static boolean isSnapshot() {
String ref = System.getenv("GITHUB_REF");
if (ref != null && ref.startsWith("refs/tags/v")) {
return false
}
return true
}