-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
126 lines (108 loc) · 3.17 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
plugins {
id("application")
id("de.undercouch.download") version "5.6.0"
}
group = "no.nr"
version = "1.2.2"
java {
sourceCompatibility = "11"
targetCompatibility = "11"
}
repositories {
mavenCentral().content {
// https://stackoverflow.com/a/68564179
excludeModule("javax.media", "jai_core")
}
maven {
name = "ImmortalVM"
url = uri("https://maven.pkg.github.com/immortalvm/tree-sitter-ng-dbspec")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
flatDir{
dirs("libs")
}
}
tasks.register("download_siardcmd.zip", Download) {
// outputs.file("download/siardcmd.zip")
src("https://github.com/sfa-siard/SiardCmd/releases/download/2.2.1/siardcmd.zip")
dest {
File dir = file("download")
dir.mkdirs()
dir
}
onlyIfModified(true)
overwrite(true)
}
tasks.register("extract_siardcmd.zip", Copy) {
dependsOn("download_siardcmd.zip")
from(zipTree("download/siardcmd.zip")) {
include("siardcmd/siardcmd-2.2.1.zip")
eachFile { fcd ->
//noinspection GroovyAccessibility
fcd.relativePath = new RelativePath(true, fcd.relativePath.segments.drop(1))
}
includeEmptyDirs = false
}
into("download")
}
tasks.register("extract_siardcmd-2.2.1-libs", Copy) {
dependsOn("extract_siardcmd.zip")
from(zipTree("download/siardcmd-2.2.1.zip")) {
include("siardcmd/lib/**")
eachFile { fcd ->
//noinspection GroovyAccessibility
fcd.relativePath = new RelativePath(true, fcd.relativePath.segments.drop(2))
}
includeEmptyDirs = false
}
into("libs")
}
compileJava.dependsOn("extract_siardcmd-2.2.1-libs")
tasks.register("extract_siardcmd-2.2.1-etc", Copy) {
dependsOn("extract_siardcmd.zip")
from(zipTree("download/siardcmd-2.2.1.zip")) {
include("siardcmd/etc/**")
}
into("build")
}
compileJava.dependsOn("extract_siardcmd-2.2.1-etc")
dependencies {
implementation("io.github.bonede:tree-sitter:0.22.6.1")
implementation("no.nr:tree-sitter-ng-dbspec:1.0")
implementation("commons-cli:commons-cli:1.7.0")
implementation("org.apache.commons:commons-text:1.12.0")
// From libs:
implementation(fileTree(dir: "libs", include: "*.jar"))
testImplementation(platform("org.junit:junit-bom:5.10.2"))
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("com.h2database:h2:2.2.224")
testImplementation("org.json:json:20240303")
// https://stackoverflow.com/a/77605392
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
application {
mainClass = "no.nr.dbspec.Main"
applicationDefaultJvmArgs = [
"-Dfile.encoding=UTF-8"
]
applicationDistribution.from("build/siardcmd/etc") {
into("etc")
}
}
// Skip dbspec-<version> top level directory
distributions {
main {
contents {
into("/")
}
}
}
run {
classpath += files("build/siardcmd")
}
test {
useJUnitPlatform()
}