-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathbuild.gradle.kts
92 lines (76 loc) · 2.2 KB
/
build.gradle.kts
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
import java.time.LocalDate
import java.time.format.DateTimeFormatter
group = "com.wisecoders.dbschema"
version = "4.8.3"
plugins {
`java-library`
distribution
}
repositories {
mavenCentral()
}
dependencies {
implementation(libs.mongodbDriverSync)
implementation(libs.graal.js)
implementation(libs.graal.jsScriptEngine)
implementation(libs.gson)
testRuntimeOnly(libs.junit.platformLauncher)
testImplementation(libs.junit.jupiter)
testImplementation(libs.assertj.core)
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = sourceCompatibility
withJavadocJar()
withSourcesJar()
}
tasks.named<Test>("test") {
useJUnitPlatform()
}
tasks.javadoc {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
tasks.jar {
archiveFileName.set("mongojdbc${project.version}.jar")
manifest {
attributes(
"Main-Class" to "com.wisecoders.dbschema.mongodb.JdbcDriver",
"Class-Path" to configurations.runtimeClasspath.get().files.joinToString(separator = " ") { it.name },
"Specification-Version" to project.version,
"Specification-Vendor" to "Wise Coders",
"Implementation-Vendor-Id" to "dbschema.com",
"Implementation-Vendor" to "Wise Coders",
"Implementation-Version" to LocalDate.now().format(DateTimeFormatter.ofPattern("yyMMdd")),
)
}
}
distributions {
main {
contents {
from(tasks.jar)
from(configurations.runtimeClasspath)
from(project.layout.projectDirectory.dir("lib"))
into("/")
}
}
}
tasks.distZip {
archiveFileName = "MongoDbJdbcDriver.zip"
}
tasks.distTar {
enabled = false
}
artifacts {
archives(tasks.javadoc)
archives(tasks.named("sourcesJar"))
}
val deleteFromUserHome: TaskProvider<Delete> = tasks.register<Delete>("deleteFromUserHome") {
delete {
delete("${System.getProperty("user.home")}/.DbSchema/drivers/MongoDb/")
}
}
tasks.register<Copy>("copyToUserHome") {
dependsOn(deleteFromUserHome)
from(tasks.distZip.get().inputs.files)
into("${System.getProperty("user.home")}/.DbSchema/drivers/MongoDb/")
}