kotlin - Enforcing JDK package usage in kotlinc
问题描述
I need to use JDK11 to build a certain Gradle project but this project needs target JDK 8 as minimum. So I'd like to ensure that no one accidentally checks in code using classes from newer JDKs. I am working in a mixed mode project and for java this works:
compileJava {
options.release = 8
}
I can't find the switch for Kotlin, does kotlinc just not have this support ?
Note: this does not work.
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
解决方案
推荐阅读
- android - 使用电子邮件/密码在 API 上实施 OAuth 以进行身份验证
- mongodb - MongoDB $switch 聚合总是落在默认情况下
- algorithm - Probabilistic Perspective 是一种很好的商业预测客户偏好趋势的方法吗?
- php - PHP:关闭 SoapClient 连接会更好吗?
- sql - Postgres 日期差异
- python - AWS EC2 中的 jupyter / Anaconda3 路径
- scala - 安装 scala 源而不更改 pom
- sql - Oracle - 如何在分层查询中使用连接并避免笛卡尔积
- uwp - PropertyChange 在 UWP 中总是返回 NULL?
- jenkins - 关于用户认证的建议