Skip to content

Commit

Permalink
Update build.gradle.kts.hbs to fix Kotlin incorrect version usage (#122)
Browse files Browse the repository at this point in the history
* Update build.gradle.kts.hbs to fix Kotlin incorrect version usage

* Create build.gradle.kts.hbs.md
  • Loading branch information
simonhyll authored Mar 25, 2023
1 parent f022acd commit fee2f07
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/build.gradle.kts.hbs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri-mobile": patch
---

This change manually instructs Java and Kotlin to use/generate code for the same JVM target.
14 changes: 14 additions & 0 deletions templates/platforms/android-studio/build.gradle.kts.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

// https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support
tasks.withType(JavaCompile::class.java) {
sourceCompatibility = "11"
targetCompatibility = "11"
}

tasks.withType(KotlinCompile::class.java) {
kotlinOptions {
jvmTarget = "11"
}
}

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
Expand Down

0 comments on commit fee2f07

Please sign in to comment.