【发布时间】:2017-06-07 06:54:29
【问题描述】:
如标题所示,我想知道如何修改gradle.build.kts,以便创建一个独特的jar,其中包含所有依赖项(包括kotlin lib)。
我在 Groovy 中找到了这个示例:
//create a single Jar with all dependencies
task fatJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Gradle Jar File Example',
'Implementation-Version': version,
'Main-Class': 'com.mkyong.DateUtils'
}
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
但我不知道如何在 kotlin 中编写它,除了:
task("fatJar") {
}
【问题讨论】:
标签: kotlin build.gradle gradle-kotlin-dsl build.gradle.kts