1 Star 0 Fork 34

mslsoftware / RoomIt

forked from Rococy / RoomIt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
build.gradle 2.62 KB
一键复制 编辑 原始数据 按行查看 历史
Rococy 提交于 2022-10-22 15:52 . 更新版本号
plugins {
id 'java'
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.10'
id 'org.beryx.jlink' version '2.24.1'
}
group 'org.rococy'
version '1.1'
repositories {
mavenCentral()
}
ext {
junitVersion = '5.9.0'
}
sourceCompatibility = "17"
targetCompatibility = "17"
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
jpackageImage {
// 先删除原来打包的东西
dependsOn(clean)
}
task renamePackage(type: Exec) {
commandLine 'cmd', "/c", "ren ${buildDir}\\jpackage\\RoomIt RoomIt-win-x64"
}
task copyConfigDir(type: Exec) {
dependsOn(renamePackage)
commandLine 'cmd', "/c", "echo d | xcopy ${projectDir}\\config ${buildDir}\\jpackage\\RoomIt-win-x64\\config /s /f"
}
task zipPackage(type: Exec) {
dependsOn(copyConfigDir)
commandLine 'cmd', "/c", "start /b 360zip -ar ${buildDir}\\jpackage\\RoomIt-win-x64 ${buildDir}\\jpackage\\RoomIt-win-x64.zip"
}
task movePackage(type: Exec) {
commandLine 'cmd', "/c", "move ${buildDir}\\jpackage\\RoomIt-win-x64.zip ${projectDir}\\dist"
}
task deleteOldZip(type: Exec) {
commandLine 'cmd', "/c", "if exist ${projectDir}\\dist\\RoomIt-win-x64.zip (del ${projectDir}\\dist\\RoomIt-win-x64.zip)"
}
clean {
dependsOn(deleteOldZip)
}
zipPackage.finalizedBy(movePackage)
jpackageImage.finalizedBy(zipPackage)
application {
mainModule = 'org.rococy.roomit'
mainClass = 'org.rococy.roomit.Launcher'
}
javafx {
version = '11.0.2'
modules = ['javafx.controls', 'javafx.fxml']
}
dependencies {
implementation("com.google.code.gson:gson:2.9.1")
implementation('net.java.dev.jna:jna:5.12.1')
implementation('net.java.dev.jna:jna-platform:5.12.1')
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
}
test {
useJUnitPlatform()
}
jar {
manifest {
attributes "Implementation-Title": project.name
attributes "Implementation-Version": project.version
attributes 'Main-Class': 'org.rococy.roomit.Launcher'
}
}
jlink {
imageZip = project.file("${buildDir}/distributions/app-${javafx.platform.classifier}.zip") as RegularFile
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
name = 'RoomIt'
jvmArgs = ["-Djava.library.path=C:/"]
}
jpackage {
appVersion = project.version
icon = "icon/logo16x16.ico"
imageName = "RoomIt"
imageOptions = ["--vendor", "Rococy", "--description", "基于JavaFx开源的屏幕画笔工具"]
}
}
jlinkZip {
group = 'distribution'
}
Java
1
https://gitee.com/jsmth/RoomIt.git
git@gitee.com:jsmth/RoomIt.git
jsmth
RoomIt
RoomIt
master

搜索帮助