第二次提交
This commit is contained in:
34
build.gradle
34
build.gradle
@@ -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()
|
||||
}
|
||||
Reference in New Issue
Block a user