Gradle Kotlin DSL 打包带上依赖

Gradle version

Gradle 8.2.1

build.gradle.kts

Kotlin 复制代码
tasks.jar.configure {
    duplicatesStrategy = DuplicatesStrategy.INCLUDE
    manifest.attributes["Main-Class"] = "com.pub.Main"
    from(configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) })
}

参考

https://blog.csdn.net/setlilei/article/details/123173339

相关推荐
pengyu9 小时前
【Kotlin 协程修仙录 · 渡劫境 · 中阶】 | 造化神兵:自定义 CoroutineDispatcher 与调度器的终极定制
android·kotlin
pengyu9 小时前
【Kotlin 协程修仙录 · 渡劫境 · 初阶】 | 飞升雷劫:CPS 变换与挂起函数字节码终极透视
android·kotlin
hunterandroid15 小时前
Android 多渠道打包与 Gradle 构建优化实战
android·前端·kotlin
pengyu17 小时前
【Kotlin 协程修仙录 · 大乘境 · 后阶】 | 死锁天劫:协程同步原语与 ThreadLocal 迁移之道
android·kotlin
天空之城--18 小时前
过去一周Android行业动态:编码技术与综合趋势精选
android·flutter·性能优化·kotlin·android jetpack
海兰2 天前
【 Python 量化交易】第10章:八大经典策略
android·python·kotlin
JMchen1232 天前
【Android 性能优化实战 60 讲】04 Memory Profiler 高阶玩法:深剖堆内存原理,实战定位 Kotlin 闭包隐式泄漏
android·性能优化·kotlin·实战·源码分析·内存泄漏·memory profiler
Kapaseker2 天前
我为什么喜欢 Compose ?
android·kotlin
limuyang22 天前
PDF Viewer KMP(基于 chrome 的 PDFium 内核)
android·kotlin
pengyu2 天前
【Kotlin 协程修仙录 · 大乘境 · 初阶】 | 跳出三界:协程在 KMP 与后端开发中的跨平台之道
android·kotlin