Skip to content
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

Set source and target compatibility for KotlinCompile tasks #1000

Merged
merged 1 commit into from
Oct 20, 2020

Conversation

Egorand
Copy link
Collaborator

@Egorand Egorand commented Oct 15, 2020

Fixes #999

@JakeWharton
Copy link
Member

I don't think this affects the metadata, or at least i'm not sure. I would think that you would have to set it on the java convention / extension.

@Egorand
Copy link
Collaborator Author

Egorand commented Oct 15, 2020

I'll test it some time later.

@Egorand Egorand force-pushed the egorand/201015/source-target-compat branch from 11ee2a3 to 79e5dcd Compare October 20, 2020 15:10
@Egorand
Copy link
Collaborator Author

Egorand commented Oct 20, 2020

@JakeWharton PTAL, verified this locally.

@@ -44,6 +44,11 @@ subprojects {
freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn")
}
}
// Ensure "org.gradle.jvm.version" is set to "8" in Gradle metadata.
tasks.withType<JavaCompile> {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure you need toString(), but it doesn't really matter.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With Kotlin DSL you do, sadly. We need setter overloads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot use KotlinPoet version 1.7.0 with Java 8
2 participants