第二次提交

This commit is contained in:
tzdwindows 7
2025-02-06 20:49:46 +08:00
parent d06b32a92f
commit 4e2253df81
4 changed files with 150 additions and 0 deletions

View File

@@ -1,12 +1,24 @@
plugins {
id 'java'
id 'application'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'edu.sc.seis.launch4j' version '2.5.4'
}
def requiredJavaVersion = 20
def currentJavaVersion = JavaVersion.current().majorVersion.toInteger()
if (currentJavaVersion != requiredJavaVersion) {
throw new GradleException("构建需要 JDK ${requiredJavaVersion},但当前是 JDK ${currentJavaVersion}。请更换 JDK 环境。")
}
group = 'com.axis.innovators.box'
version = '1.0-SNAPSHOT'
repositories {
mavenLocal()
maven { url "https://maven.aliyun.com/repository/public" }
mavenCentral()
jcenter()
}
dependencies {
@@ -14,6 +26,28 @@ dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter'
}
application {
mainClass = 'com.axis.innovators.box.Main'
}
shadowJar {
archiveBaseName = 'app'
archiveClassifier = ''
archiveVersion = ''
}
launch4j {
mainClassName = 'com.axis.innovators.box.Main'
outfile = version + '.exe'
icon = "${projectDir}/logo.ico"
jar = shadowJar.archiveFile.get()
bundledJrePath = 'jre'
}
tasks.named('launch4j') {
dependsOn shadowJar
}
test {
useJUnitPlatform()
}