-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
99 lines (83 loc) · 2.52 KB
/
build.gradle
File metadata and controls
99 lines (83 loc) · 2.52 KB
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
buildscript {
repositories {
maven { url 'https://maven.aliyun.com/repository/central' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin/' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url = uri("https://maven.aliyun.com/repository/public") }
//google()
//gradlePluginPortal()
}
dependencies {
classpath 'org.javamodularity:moduleplugin:1.8.12'
classpath 'org.openjfx:javafx-plugin:0.0.13'
classpath 'org.beryx:badass-jlink-plugin:2.25.0'
classpath("com.gradleup.shadow:com.gradleup.shadow.gradle.plugin:8.3.0")
}
}
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'org.javamodularity.moduleplugin'
apply plugin: 'org.openjfx.javafxplugin'
apply plugin: 'org.beryx.jlink'
group 'com.xiaoming.desktop.filereceiver'
version '1.0'
repositories {
maven { url 'https://maven.aliyun.com/repository/central' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin/' }
}
ext {
junitVersion = '5.9.2'
}
sourceCompatibility = '9'
targetCompatibility = '9'
//sourceCompatibility = '17'
//targetCompatibility = '17'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
application {
mainModule = 'com.xiaoming.desktop.filereceiver.file_receiver'
mainClass = 'com.xiaoming.desktop.filereceiver.file_receiver.HelloApplication'
}
javafx {
version = '17.0.14'
modules = ['javafx.controls', 'javafx.fxml']
}
dependencies {
implementation "org.jetbrains:annotations:+"
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
}
test {
useJUnitPlatform()
}
jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
imageName = 'FileReceiverApp'
launcher {
name = 'FileReceiver'
}
// 只生成可运行应用
jpackage {
skipInstaller = true
imageName = 'FileReceiverApp'
}
}
jlink {
imageZip = project.file("${buildDir}/distributions/app-${javafx.platform.classifier}.zip")
//imageZip = project.file("${buildDir}/release/app-${javafx.platform.classifier}.zip")
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
name = 'app'
}
}
jlinkZip {
group = 'distribution'
}
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
task testJar2(type: ShadowJar) {
archiveBaseName.set('file-receiver-fat') // 自定义 jar 名字
archiveVersion.set('1.0') // 自定义版本
destinationDirectory.set(file("$buildDir/custom-jars")) // 自定义输出目录
archiveClassifier.set('')
}