-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
87 lines (78 loc) · 2.28 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
plugins {
id 'java'
id "org.openjfx.javafxplugin" version "0.0.11"
id "io.codearte.nexus-staging" version "0.30.0" apply false
}
sourceSets {
main {
output.resourcesDir = java.classesDirectory
resources {
exclude '**/*.scss'
}
}
}
allprojects {
group = 'com.unclezs'
version = property("app.version")
description = "openjfx launcher"
apply from: "${rootDir}/gradle/publications.gradle"
repositories {
mavenLocal()
mavenCentral()
}
}
def compileScss = {
def scssDir = file("${sourceSets.main.resources.srcDirs[0]}/css")
for (final def file in fileTree(scssDir)) {
if (file.isDirectory()) {
continue
}
if (file.name.endsWith("scss") && !file.name.startsWith("_")) {
try {
exec(new Action<ExecSpec>() {
@Override
void execute(ExecSpec es) {
es.executable("sass")
es.args("--no-source-map", "--no-charset", file.absolutePath, file.absolutePath.replace("scss", "css"))
}
})
} catch (ignored) {
println "编译 scss 失败,请确认是否已经安装了 sass"
return
}
println "compile scss to css: $file.name"
} else if (file.name.endsWith(".map")) {
file.delete()
}
}
}
tasks.withType(JavaCompile) {
doFirst {
compileScss()
}
options.encoding = "UTF-8"
options.fork = true
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
options.compilerArgs += ['-Xdoclint:none', '-Xlint:none', '-nowarn']
}
dependencies {
annotationProcessor 'org.projectlombok:lombok:1.18.24'
compileOnly 'org.projectlombok:lombok:1.18.24'
implementation 'com.google.code.gson:gson:2.9.0'
// test
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
}
test {
useJUnitPlatform()
include(["**/*Tests.class", "**/*Test.class"])
}
javafx {
version = "17.0.2"
modules = ["javafx.base", "javafx.controls", "javafx.fxml"]
configuration = "compileOnly"
}
jar {
exclude "**/scss/**"
}