-
Notifications
You must be signed in to change notification settings - Fork 326
android build: Migrate to kotlin.compilerOptions
from kotlinOptions
#1829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
842aceb
to
29e9482
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Small comment below.
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { | ||
kotlin { | ||
compilerOptions { | ||
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8 | ||
} | ||
} | ||
|
||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile).configureEach { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason to change org.jetbrains.kotlin.gradle.tasks.KotlinCompile
to org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KotlinCompile
(not sure why it's documentation is in org.jetbrains.kotlin.gradle.dsl
package and not org.jetbrains.kotlin.gradle.tasks
) is deprecated in favor of one-of the KotlinCompilationTask
, and KotlinJvmCompile
is a subclass of KotlinCompilationTask
.
Also the migration guide (expand the "Migrate from kotlinOptions {}
to compilerOptions {}
" section) has a handy migration example for this "compilation unit level" configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I think you mean KotlinCompile
is the deprecated thing?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes!
Thanks! LGTM, marking for Greg's review. |
See:
https://kotlinlang.org/docs/gradle-compiler-options.html#migrate-from-kotlinoptions-to-compileroptions
Fixes: #1804