forked from uncle-novel/uncle-novel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
81 lines (66 loc) · 2.11 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
plugins {
id "org.openjfx.javafxplugin" version "0.0.9" apply false
id "io.spring.dependency-management" version "1.0.9.RELEASE" apply false
id "com.unclezs.gradle.sass" version "1.0.10" apply false
}
ext {
jfxProject = ['app', 'app-framework']
jfxProject = subprojects.findAll { jfxProject.contains(it.name) }
}
allprojects {
group = "com.unclezs.novel.app"
version = property("app.version")
description = "Uncle Novel Project"
repositories {
mavenLocal()
mavenCentral()
google()
}
}
subprojects { project ->
apply plugin: "java"
apply from: "${rootDir}/gradle/publications.gradle"
apply from: "${rootDir}/gradle/dependency-management.gradle"
sourceSets {
main.output.resourcesDir = main.java.classesDirectory
}
ext.compilerArgs = []
// 模块化编译参数
File vmArgs = file("$projectDir/${project.name}.modularity")
if (vmArgs.exists()) {
vmArgs.readLines().each {
if (!it.isBlank() && !it.startsWith("//") && !it.startsWith("--add-opens")) {
ext.compilerArgs.add(it)
}
}
}
tasks.withType(JavaCompile) {
options.fork = true
options.encoding = "UTF-8"
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
// 模块化编译参数
options.compilerArgs.addAll(compilerArgs)
}
dependencies {
compileOnly "org.projectlombok:lombok"
annotationProcessor "org.projectlombok:lombok"
testImplementation "org.junit.jupiter:junit-jupiter-api"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
}
test {
useJUnitPlatform()
include(["**/*Tests.class", "**/*Test.class"])
}
}
configure(jfxProject) { project ->
apply plugin: "org.openjfx.javafxplugin"
apply plugin: "com.unclezs.gradle.sass"
javafx {
version = "16"
modules = ["javafx.base", "javafx.controls", "javafx.fxml", "javafx.graphics", "javafx.media", "javafx.swing", "javafx.web"]
}
jar {
exclude "**/scss/**"
}
}