Skip to content

Commit

Permalink
[gradle] Update Kotlin to 2.0 (#5043)
Browse files Browse the repository at this point in the history
Integration tests: 
 - Kotlin -> 2.0.0
 - max AGP -> 8.5.0
 - max Gradle -> 8.8

Project with gradle plugins:
 - Kotlin -> 2.0.0
 - Gradle -> 8.8
  • Loading branch information
terrakok authored Jul 1, 2024
1 parent a307ddd commit c7b6403
Show file tree
Hide file tree
Showing 116 changed files with 674 additions and 698 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gradle-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-14, windows-2022]
gradle: [7.4, 8.7]
agp: [8.1.0, 8.4.0]
gradle: [7.4, 8.8]
agp: [8.1.0, 8.5.0]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down
8 changes: 1 addition & 7 deletions gradle-plugins/compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@ val embeddedDependencies by configurations.creating {
isTransitive = false
}

val kgpResourcesDevVersion = "2.0.0-dev-17632"
//KMP resources API available since ^kgpResourcesDevVersion
repositories {
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev/")
}

dependencies {
// By default, Gradle resolves plugins only via Gradle Plugin Portal.
// To avoid declaring an additional repo, all dependencies must:
Expand All @@ -63,7 +57,7 @@ dependencies {

compileOnly(gradleApi())
compileOnly(localGroovy())
compileOnly(kotlin("gradle-plugin", kgpResourcesDevVersion))
compileOnly(kotlin("gradle-plugin"))
compileOnly(kotlin("native-utils"))
compileOnly(libs.plugin.android)
compileOnly(libs.plugin.android.api)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
package org.jetbrains.compose.resources

import org.gradle.api.DefaultTask
import org.gradle.api.Project
import org.gradle.api.file.Directory
import org.gradle.api.plugins.ExtensionAware
import org.gradle.api.provider.Property
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.Copy
import org.gradle.api.tasks.TaskAction
import org.jetbrains.compose.desktop.application.internal.ComposeProperties
import org.jetbrains.compose.internal.utils.*
import org.jetbrains.compose.internal.utils.dependsOn
import org.jetbrains.compose.internal.utils.joinLowerCamelCase
import org.jetbrains.compose.internal.utils.registerOrConfigure
import org.jetbrains.compose.internal.utils.uppercaseFirstChar
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.plugin.cocoapods.CocoapodsExtension
import org.jetbrains.kotlin.gradle.plugin.mpp.*
import org.jetbrains.kotlin.gradle.plugin.mpp.Framework
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.kotlin.gradle.plugin.mpp.TestExecutable
import org.jetbrains.kotlin.konan.target.KonanTarget
import java.io.File

Expand Down Expand Up @@ -137,7 +139,7 @@ private fun KotlinNativeTarget.isIosSimulatorTarget(): Boolean =
konanTarget === KonanTarget.IOS_X64 || konanTarget === KonanTarget.IOS_SIMULATOR_ARM64

private fun KotlinNativeTarget.isIosDeviceTarget(): Boolean =
konanTarget === KonanTarget.IOS_ARM64 || konanTarget === KonanTarget.IOS_ARM32
konanTarget === KonanTarget.IOS_ARM64

private fun KotlinNativeTarget.isIosTarget(): Boolean =
isIosSimulatorTarget() || isIosDeviceTarget()
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ import org.gradle.api.DefaultTask
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.file.FileCollection
import org.gradle.api.model.ObjectFactory
import org.gradle.api.provider.*
import org.gradle.api.tasks.*
import org.gradle.api.provider.MapProperty
import org.gradle.api.provider.Provider
import org.gradle.api.provider.ProviderFactory
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.PathSensitive
import org.gradle.api.tasks.PathSensitivity
import org.gradle.api.tasks.TaskAction
import org.jetbrains.kotlin.konan.target.KonanTarget
import javax.inject.Inject

Expand Down Expand Up @@ -95,7 +103,6 @@ private fun getRequestedKonanTargetsByXcode(platform: String, archs: List<String
targets.addAll(archs.map { arch ->
when (arch) {
"arm64", "arm64e" -> KonanTarget.IOS_ARM64
"armv7", "armv7s" -> KonanTarget.IOS_ARM32
else -> error("Unknown iOS device arch: '$arch'")
}
})
Expand Down
Loading

0 comments on commit c7b6403

Please sign in to comment.