This commit is contained in:
2026-02-11 10:22:09 +08:00
parent 2cf0d55afa
commit ee2b3a80ce
44 changed files with 3213 additions and 15 deletions

View File

@@ -6,6 +6,12 @@ plugins {
group = 'org.example'
version = '1.0-SNAPSHOT'
// 设置 Java 版本兼容性
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
repositories {
mavenCentral()
}
@@ -27,5 +33,39 @@ test {
}
application {
mainClass = 'com.org.fisco.AccountGenerator'
}
mainClass = 'com.org.fisco.TPSTest'
}
// 创建 Fat JAR包含所有依赖的可执行jar
tasks.register('fatJar', Jar) {
archiveClassifier = 'all'
archiveFileName = 'tps-test.jar'
manifest {
attributes(
'Main-Class': 'com.org.fisco.TPSTest',
'Implementation-Title': 'FISCO BCOS TPS Test Tool',
'Implementation-Version': version
)
}
// 包含编译后的类
from sourceSets.main.output
// 包含所有运行时依赖
from {
configurations.runtimeClasspath.collect {
it.isDirectory() ? it : zipTree(it)
}
}
// 排除签名文件
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
// 让 build 任务依赖 fatJar
build.dependsOn fatJar