Browse Source

[gradle] Update Kotlin to 2.0 (#5043)

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
support/1.7.0
Konstantin 5 months ago committed by GitHub
parent
commit
c7b640348e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      .github/workflows/gradle-plugin.yml
  2. 8
      gradle-plugins/compose/build.gradle.kts
  3. 14
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/IosResources.kt
  4. 13
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/IosResourcesTasks.kt
  5. 125
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/DesktopApplicationTest.kt
  6. 16
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/GradlePluginTest.kt
  7. 61
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/KotlinCompatibilityTest.kt
  8. 121
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/ResourcesTest.kt
  9. 9
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/unit/ComposeCompilerArtifactProviderTest.kt
  10. 2
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/GradleTestNameGenerator.kt
  11. 6
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/TestProject.kt
  12. 33
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/TestProjects.kt
  13. 10
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/TestProperties.kt
  14. 34
      gradle-plugins/compose/src/test/test-projects/application/customCompilerUnsupportedPlatformsWarning/build.gradle
  15. 2
      gradle-plugins/compose/src/test/test-projects/application/customCompilerUnsupportedPlatformsWarning/gradle.properties
  16. 19
      gradle-plugins/compose/src/test/test-projects/application/customCompilerUnsupportedPlatformsWarning/src/commonMain/kotlin/App.kt
  17. 1
      gradle-plugins/compose/src/test/test-projects/application/defaultArgs/build.gradle
  18. 1
      gradle-plugins/compose/src/test/test-projects/application/defaultArgs/settings.gradle
  19. 1
      gradle-plugins/compose/src/test/test-projects/application/defaultArgsOverride/build.gradle
  20. 1
      gradle-plugins/compose/src/test/test-projects/application/defaultArgsOverride/settings.gradle
  21. 1
      gradle-plugins/compose/src/test/test-projects/application/javaLogger/build.gradle
  22. 1
      gradle-plugins/compose/src/test/test-projects/application/javaLogger/settings.gradle
  23. 1
      gradle-plugins/compose/src/test/test-projects/application/jvm/build.gradle
  24. 1
      gradle-plugins/compose/src/test/test-projects/application/jvm/settings.gradle
  25. 1
      gradle-plugins/compose/src/test/test-projects/application/jvmKotlinDsl/build.gradle.kts
  26. 1
      gradle-plugins/compose/src/test/test-projects/application/jvmKotlinDsl/settings.gradle
  27. 3
      gradle-plugins/compose/src/test/test-projects/application/macOptions/build.gradle
  28. 1
      gradle-plugins/compose/src/test/test-projects/application/macOptions/settings.gradle
  29. 3
      gradle-plugins/compose/src/test/test-projects/application/macSign/build.gradle
  30. 1
      gradle-plugins/compose/src/test/test-projects/application/macSign/settings.gradle
  31. 3
      gradle-plugins/compose/src/test/test-projects/application/moduleClashCli/app/build.gradle
  32. 1
      gradle-plugins/compose/src/test/test-projects/application/moduleClashCli/settings.gradle
  33. 12
      gradle-plugins/compose/src/test/test-projects/application/mpp/build.gradle
  34. 1
      gradle-plugins/compose/src/test/test-projects/application/mpp/settings.gradle
  35. 3
      gradle-plugins/compose/src/test/test-projects/application/newAndroidTarget/build.gradle
  36. 1
      gradle-plugins/compose/src/test/test-projects/application/newAndroidTarget/settings.gradle
  37. 1
      gradle-plugins/compose/src/test/test-projects/application/optionsWithSpaces/build.gradle
  38. 1
      gradle-plugins/compose/src/test/test-projects/application/optionsWithSpaces/settings.gradle
  39. 1
      gradle-plugins/compose/src/test/test-projects/application/proguard/build.gradle
  40. 4
      gradle-plugins/compose/src/test/test-projects/application/proguard/main-methods.expected.txt
  41. 1
      gradle-plugins/compose/src/test/test-projects/application/proguard/settings.gradle
  42. 1
      gradle-plugins/compose/src/test/test-projects/application/resources/build.gradle
  43. 1
      gradle-plugins/compose/src/test/test-projects/application/resources/settings.gradle
  44. 1
      gradle-plugins/compose/src/test/test-projects/application/unpackSkiko/build.gradle
  45. 1
      gradle-plugins/compose/src/test/test-projects/application/unpackSkiko/settings.gradle
  46. 0
      gradle-plugins/compose/src/test/test-projects/beforeKotlin2/custom-compiler-args/build.gradle
  47. 0
      gradle-plugins/compose/src/test/test-projects/beforeKotlin2/custom-compiler-args/main-image.expected.png
  48. 0
      gradle-plugins/compose/src/test/test-projects/beforeKotlin2/custom-compiler-args/settings.gradle
  49. 0
      gradle-plugins/compose/src/test/test-projects/beforeKotlin2/custom-compiler-args/src/desktopMain/kotlin/Main.kt
  50. 0
      gradle-plugins/compose/src/test/test-projects/beforeKotlin2/custom-compiler-args/src/jsMain/kotlin/Main.js.kt
  51. 0
      gradle-plugins/compose/src/test/test-projects/beforeKotlin2/custom-compiler/build.gradle
  52. 0
      gradle-plugins/compose/src/test/test-projects/beforeKotlin2/custom-compiler/main-image.expected.png
  53. 0
      gradle-plugins/compose/src/test/test-projects/beforeKotlin2/custom-compiler/settings.gradle
  54. 0
      gradle-plugins/compose/src/test/test-projects/beforeKotlin2/custom-compiler/src/main/kotlin/Main.kt
  55. 27
      gradle-plugins/compose/src/test/test-projects/beforeKotlin2/jsMpp/build.gradle
  56. 5
      gradle-plugins/compose/src/test/test-projects/beforeKotlin2/jsMpp/settings.gradle
  57. 1
      gradle-plugins/compose/src/test/test-projects/beforeKotlin2/jsMpp/src/commonMain/kotlin/platform.kt
  58. 1
      gradle-plugins/compose/src/test/test-projects/beforeKotlin2/jsMpp/src/jsMain/kotlin/platform.kt
  59. 1
      gradle-plugins/compose/src/test/test-projects/beforeKotlin2/jsMpp/src/jvmMain/kotlin/platform.kt
  60. 73
      gradle-plugins/compose/src/test/test-projects/beforeKotlin2/mpp/build.gradle
  61. 1
      gradle-plugins/compose/src/test/test-projects/beforeKotlin2/mpp/gradle.properties
  62. 9
      gradle-plugins/compose/src/test/test-projects/beforeKotlin2/mpp/settings.gradle
  63. 3
      gradle-plugins/compose/src/test/test-projects/beforeKotlin2/mpp/src/jvmMain/kotlin/main.kt
  64. 1
      gradle-plugins/compose/src/test/test-projects/misc/bundledKotlinPoet/app/build.gradle.kts
  65. 1
      gradle-plugins/compose/src/test/test-projects/misc/bundledKotlinPoet/build.gradle.kts
  66. 1
      gradle-plugins/compose/src/test/test-projects/misc/bundledKotlinPoet/settings.gradle.kts
  67. 7
      gradle-plugins/compose/src/test/test-projects/misc/commonResources/build.gradle.kts
  68. 4
      gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected-open-res/androidMainResourceAccessors/my/lib/res/String0.androidMain.kt
  69. 24
      gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected-open-res/commonMainResourceAccessors/my/lib/res/Drawable0.commonMain.kt
  70. 5
      gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected-open-res/commonMainResourceAccessors/my/lib/res/Font0.commonMain.kt
  71. 4
      gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected-open-res/commonMainResourceAccessors/my/lib/res/Plurals0.commonMain.kt
  72. 32
      gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected-open-res/commonMainResourceAccessors/my/lib/res/String0.commonMain.kt
  73. 5
      gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected-open-res/commonResClass/my/lib/res/Res.kt
  74. 2
      gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected-open-res/desktopMainResourceAccessors/my/lib/res/String0.desktopMain.kt
  75. 5
      gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected/androidMainResourceAccessors/app/group/resources_test/generated/resources/String0.androidMain.kt
  76. 26
      gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected/commonMainResourceAccessors/app/group/resources_test/generated/resources/Drawable0.commonMain.kt
  77. 6
      gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected/commonMainResourceAccessors/app/group/resources_test/generated/resources/Font0.commonMain.kt
  78. 5
      gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected/commonMainResourceAccessors/app/group/resources_test/generated/resources/Plurals0.commonMain.kt
  79. 40
      gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected/commonMainResourceAccessors/app/group/resources_test/generated/resources/String0.commonMain.kt
  80. 6
      gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected/commonResClass/app/group/resources_test/generated/resources/Res.kt
  81. 3
      gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected/desktopMainResourceAccessors/app/group/resources_test/generated/resources/String0.desktopMain.kt
  82. 1
      gradle-plugins/compose/src/test/test-projects/misc/commonResources/settings.gradle.kts
  83. 1
      gradle-plugins/compose/src/test/test-projects/misc/emptyResources/build.gradle.kts
  84. 6
      gradle-plugins/compose/src/test/test-projects/misc/emptyResources/expected/Res.kt
  85. 1
      gradle-plugins/compose/src/test/test-projects/misc/emptyResources/settings.gradle.kts
  86. 1
      gradle-plugins/compose/src/test/test-projects/misc/iosResources/build.gradle.kts
  87. 4
      gradle-plugins/compose/src/test/test-projects/misc/iosResources/expected/iosResources.podspec
  88. 1
      gradle-plugins/compose/src/test/test-projects/misc/iosResources/settings.gradle.kts
  89. 3
      gradle-plugins/compose/src/test/test-projects/misc/jsMpp/build.gradle
  90. 1
      gradle-plugins/compose/src/test/test-projects/misc/jsMpp/settings.gradle
  91. 1
      gradle-plugins/compose/src/test/test-projects/misc/jvmOnlyResources/build.gradle.kts
  92. 1
      gradle-plugins/compose/src/test/test-projects/misc/jvmOnlyResources/settings.gradle.kts
  93. 1
      gradle-plugins/compose/src/test/test-projects/misc/jvmPreview/common/build.gradle
  94. 1
      gradle-plugins/compose/src/test/test-projects/misc/jvmPreview/jvm/build.gradle
  95. 1
      gradle-plugins/compose/src/test/test-projects/misc/jvmPreview/mpp/build.gradle
  96. 1
      gradle-plugins/compose/src/test/test-projects/misc/jvmPreview/settings.gradle
  97. 27
      gradle-plugins/compose/src/test/test-projects/misc/nativeCacheKind/build.gradle
  98. 2
      gradle-plugins/compose/src/test/test-projects/misc/nativeCacheKind/gradle.properties
  99. 27
      gradle-plugins/compose/src/test/test-projects/misc/nativeCacheKind/settings.gradle
  100. 10
      gradle-plugins/compose/src/test/test-projects/misc/nativeCacheKind/src/commonMain/kotlin/App.kt
  101. Some files were not shown because too many files have changed in this diff Show More

4
.github/workflows/gradle-plugin.yml

@ -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

8
gradle-plugins/compose/build.gradle.kts

@ -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:
@ -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)

14
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/IosResources.kt

@ -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
@ -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()

13
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/IosResourcesTasks.kt

@ -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
@ -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'")
}
})

125
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/DesktopApplicationTest.kt

@ -12,20 +12,31 @@ import org.jetbrains.compose.internal.utils.currentArch
import org.jetbrains.compose.internal.utils.currentOS
import org.jetbrains.compose.internal.utils.currentTarget
import org.jetbrains.compose.internal.utils.uppercaseFirstChar
import org.jetbrains.compose.test.utils.*
import java.io.File
import java.util.*
import org.jetbrains.compose.test.utils.GradlePluginTestBase
import org.jetbrains.compose.test.utils.JDK_11_BYTECODE_VERSION
import org.jetbrains.compose.test.utils.ProcessRunResult
import org.jetbrains.compose.test.utils.TestProject
import org.jetbrains.compose.test.utils.assertEqualTextFiles
import org.jetbrains.compose.test.utils.assertNotEqualTextFiles
import org.jetbrains.compose.test.utils.checkContains
import org.jetbrains.compose.test.utils.checkExists
import org.jetbrains.compose.test.utils.checkNotExists
import org.jetbrains.compose.test.utils.checks
import org.jetbrains.compose.test.utils.modify
import org.jetbrains.compose.test.utils.readClassFileVersion
import org.jetbrains.compose.test.utils.runProcess
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertFalse
import org.junit.jupiter.api.Assumptions
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import java.io.File
import java.util.*
import java.util.jar.JarFile
class DesktopApplicationTest : GradlePluginTestBase() {
@Test
fun smokeTestRunTask() = with(testProject(TestProjects.jvm)) {
fun smokeTestRunTask() = with(testProject("application/jvm")) {
file("build.gradle").modify {
it + """
afterEvaluate {
@ -62,7 +73,7 @@ class DesktopApplicationTest : GradlePluginTestBase() {
}
@Test
fun testRunMpp() = with(testProject(TestProjects.mpp)) {
fun testRunMpp() = with(testProject("application/mpp")) {
val logLine = "Kotlin MPP app is running!"
gradle("run").checks {
check.taskSuccessful(":run")
@ -84,60 +95,8 @@ class DesktopApplicationTest : GradlePluginTestBase() {
}
}
/**
* Test the version of Compose Compiler published by Google.
* See https://developer.android.com/jetpack/androidx/releases/compose-kotlin
*/
@Test
fun testAndroidxCompiler() = testProject(
TestProjects.customCompiler, defaultTestEnvironment.copy(
kotlinVersion = "1.8.0",
composeCompilerPlugin = "\"androidx.compose.compiler:compiler:1.4.0\""
)
).checkCustomComposeCompiler()
@Test
fun testSettingLatestCompiler() = testProject(
TestProjects.customCompiler, defaultTestEnvironment.copy(
kotlinVersion = "1.8.20",
composeCompilerPlugin = "dependencies.compiler.forKotlin(\"1.8.20\")",
)
).checkCustomComposeCompiler()
@Test
fun testSettingAutoCompiler() = testProject(
TestProjects.customCompiler, defaultTestEnvironment.copy(
kotlinVersion = "1.8.10",
composeCompilerPlugin = "dependencies.compiler.auto",
)
).checkCustomComposeCompiler()
@Test
fun testKotlinCheckDisabled() = testProject(
TestProjects.customCompilerArgs, defaultTestEnvironment.copy(
kotlinVersion = "1.9.21",
composeCompilerPlugin = "dependencies.compiler.forKotlin(\"1.9.20\")",
composeCompilerArgs = "\"suppressKotlinVersionCompatibilityCheck=1.9.21\""
)
).checkCustomComposeCompiler(checkKJS = true)
private fun TestProject.checkCustomComposeCompiler(checkKJS: Boolean = false) {
gradle(":runDistributable").checks {
val actualMainImage = file("main-image.actual.png")
val expectedMainImage = file("main-image.expected.png")
assert(actualMainImage.readBytes().contentEquals(expectedMainImage.readBytes())) {
"The actual image '$actualMainImage' does not match the expected image '$expectedMainImage'"
}
}
if (checkKJS) {
gradle(":jsBrowserProductionWebpack").checks {
check.taskSuccessful(":jsBrowserProductionWebpack")
}
}
}
@Test
fun kotlinDsl(): Unit = with(testProject(TestProjects.jvmKotlinDsl)) {
fun kotlinDsl(): Unit = with(testProject("application/jvmKotlinDsl")) {
gradle(":packageDistributionForCurrentOS", "--dry-run")
gradle(":packageReleaseDistributionForCurrentOS", "--dry-run")
}
@ -145,7 +104,7 @@ class DesktopApplicationTest : GradlePluginTestBase() {
@Test
fun proguard(): Unit = with(
testProject(
TestProjects.proguard,
"application/proguard",
testEnvironment = defaultTestEnvironment.copy(composeVerbose = false))
) {
val enableObfuscation = """
@ -188,12 +147,12 @@ class DesktopApplicationTest : GradlePluginTestBase() {
}
@Test
fun joinOutputJarsJvm() = with(testProject(TestProjects.jvm)) {
fun joinOutputJarsJvm() = with(testProject("application/jvm")) {
joinOutputJars()
}
@Test
fun joinOutputJarsMpp() = with(testProject(TestProjects.mpp)) {
fun joinOutputJarsMpp() = with(testProject("application/mpp")) {
joinOutputJars()
}
@ -220,7 +179,7 @@ class DesktopApplicationTest : GradlePluginTestBase() {
}
@Test
fun gradleBuildCache() = with(testProject(TestProjects.jvm)) {
fun gradleBuildCache() = with(testProject("application/jvm")) {
modifyGradleProperties {
setProperty("org.gradle.caching", "true")
}
@ -246,12 +205,12 @@ class DesktopApplicationTest : GradlePluginTestBase() {
}
@Test
fun packageJvm() = with(testProject(TestProjects.jvm)) {
fun packageJvm() = with(testProject("application/jvm")) {
testPackageJvmDistributions()
}
@Test
fun packageMpp() = with(testProject(TestProjects.mpp)) {
fun packageMpp() = with(testProject("application/mpp")) {
testPackageJvmDistributions()
}
@ -305,7 +264,7 @@ class DesktopApplicationTest : GradlePluginTestBase() {
}
private fun customJdkProject(javaVersion: Int): TestProject =
testProject(TestProjects.jvm).apply {
testProject("application/jvm").apply {
appendText("build.gradle") {
"""
compose.desktop.application {
@ -318,22 +277,22 @@ class DesktopApplicationTest : GradlePluginTestBase() {
}
@Test
fun packageUberJarForCurrentOSJvm() = with(testProject(TestProjects.jvm)) {
fun packageUberJarForCurrentOSJvm() = with(testProject("application/jvm")) {
testPackageUberJarForCurrentOS(false)
}
@Test
fun packageUberJarForCurrentOSMpp() = with(testProject(TestProjects.mpp)) {
fun packageUberJarForCurrentOSMpp() = with(testProject("application/mpp")) {
testPackageUberJarForCurrentOS(false)
}
@Test
fun packageReleaseUberJarForCurrentOSJvm() = with(testProject(TestProjects.jvm)) {
fun packageReleaseUberJarForCurrentOSJvm() = with(testProject("application/jvm")) {
testPackageUberJarForCurrentOS(true)
}
@Test
fun packageReleaseUberJarForCurrentOSMpp() = with(testProject(TestProjects.mpp)) {
fun packageReleaseUberJarForCurrentOSMpp() = with(testProject("application/mpp")) {
testPackageUberJarForCurrentOS(true)
}
@ -366,7 +325,7 @@ class DesktopApplicationTest : GradlePluginTestBase() {
}
@Test
fun testModuleClash() = with(testProject(TestProjects.moduleClashCli)) {
fun testModuleClash() = with(testProject("application/moduleClashCli")) {
gradle(":app:runDistributable").checks {
check.taskSuccessful(":app:createDistributable")
check.taskSuccessful(":app:runDistributable")
@ -376,7 +335,7 @@ class DesktopApplicationTest : GradlePluginTestBase() {
}
@Test
fun testJavaLogger() = with(testProject(TestProjects.javaLogger)) {
fun testJavaLogger() = with(testProject("application/javaLogger")) {
gradle(":runDistributable").checks {
check.taskSuccessful(":runDistributable")
check.logContains("Compose Gradle plugin test log warning!")
@ -393,7 +352,7 @@ class DesktopApplicationTest : GradlePluginTestBase() {
Assumptions.assumeTrue(currentOS == OS.MacOS)
with(testProject(TestProjects.macOptions)) {
with(testProject("application/macOptions")) {
gradle(":runDistributable").checks {
check.taskSuccessful(":runDistributable")
check.logContains("Hello, from Mac OS!")
@ -411,7 +370,7 @@ class DesktopApplicationTest : GradlePluginTestBase() {
fun testMacSignConfiguration() {
Assumptions.assumeTrue(currentOS == OS.MacOS)
with(testProject(TestProjects.macSign)) {
with(testProject("application/macSign")) {
gradle("--dry-run", ":createDistributable")
}
}
@ -444,7 +403,7 @@ class DesktopApplicationTest : GradlePluginTestBase() {
}
}
with(testProject(TestProjects.macSign)) {
with(testProject("application/macSign")) {
val keychain = file("compose.test.keychain")
val password = "compose.test"
@ -474,7 +433,7 @@ class DesktopApplicationTest : GradlePluginTestBase() {
@Test
fun testOptionsWithSpaces() {
with(testProject(TestProjects.optionsWithSpaces)) {
with(testProject("application/optionsWithSpaces")) {
fun testRunTask(runTask: String) {
gradle(runTask).checks {
check.taskSuccessful(runTask)
@ -496,7 +455,7 @@ class DesktopApplicationTest : GradlePluginTestBase() {
@Test
fun testDefaultArgs() {
with(testProject(TestProjects.defaultArgs)) {
with(testProject("application/defaultArgs")) {
fun testRunTask(runTask: String) {
gradle(runTask).checks {
check.taskSuccessful(runTask)
@ -515,7 +474,7 @@ class DesktopApplicationTest : GradlePluginTestBase() {
@Test
fun testDefaultArgsOverride() {
with(testProject(TestProjects.defaultArgsOverride)) {
with(testProject("application/defaultArgsOverride")) {
fun testRunTask(runTask: String) {
gradle(runTask).checks {
check.taskSuccessful(runTask)
@ -534,7 +493,7 @@ class DesktopApplicationTest : GradlePluginTestBase() {
@Test
fun testSuggestModules() {
with(testProject(TestProjects.jvm)) {
with(testProject("application/jvm")) {
gradle(":suggestRuntimeModules").checks {
check.taskSuccessful(":suggestRuntimeModules")
check.logContains("Suggested runtime modules to include:")
@ -544,12 +503,12 @@ class DesktopApplicationTest : GradlePluginTestBase() {
}
@Test
fun testUnpackSkiko() = with(testProject(TestProjects.unpackSkiko)) {
fun testUnpackSkiko() = with(testProject("application/unpackSkiko")) {
testUnpackSkiko(":runDistributable")
}
@Test
fun testUnpackSkikoFromUberJar() = with(testProject(TestProjects.unpackSkiko)) {
fun testUnpackSkikoFromUberJar() = with(testProject("application/unpackSkiko")) {
enableJoinOutputJars()
testUnpackSkiko(":runReleaseDistributable")
}
@ -576,7 +535,7 @@ class DesktopApplicationTest : GradlePluginTestBase() {
}
@Test
fun resources() = with(testProject(TestProjects.resources)) {
fun resources() = with(testProject("application/resources")) {
gradle(":run").checks {
check.taskSuccessful(":run")
}
@ -590,7 +549,7 @@ class DesktopApplicationTest : GradlePluginTestBase() {
fun testWixUnzip() {
Assumptions.assumeTrue(currentOS == OS.Windows) { "The test is only relevant for Windows" }
with(testProject(TestProjects.jvm)) {
with(testProject("application/jvm")) {
gradle(":unzipWix").checks {
check.taskSuccessful(":unzipWix")

16
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/GradlePluginTest.kt

@ -11,7 +11,8 @@ import org.gradle.util.GradleVersion
import org.jetbrains.compose.desktop.ui.tooling.preview.rpc.PreviewLogger
import org.jetbrains.compose.desktop.ui.tooling.preview.rpc.RemoteConnection
import org.jetbrains.compose.desktop.ui.tooling.preview.rpc.receiveConfigFromGradle
import org.jetbrains.compose.test.utils.*
import org.jetbrains.compose.test.utils.GradlePluginTestBase
import org.jetbrains.compose.test.utils.checkExists
import org.jetbrains.compose.test.utils.checks
import org.junit.jupiter.api.Assumptions
import org.junit.jupiter.api.Test
@ -27,7 +28,7 @@ class GradlePluginTest : GradlePluginTestBase() {
@Test
fun skikoWasm() = with(
testProject(
TestProjects.skikoWasm,
"misc/skikoWasm",
// TODO: enable the configuration cache after moving all test projects to kotlin 2.0 or newer
defaultTestEnvironment.copy(useGradleConfigurationCache = false)
)
@ -66,7 +67,7 @@ class GradlePluginTest : GradlePluginTestBase() {
@Test
fun newAndroidTarget() {
Assumptions.assumeTrue(defaultTestEnvironment.parsedGradleVersion >= GradleVersion.version("8.0.0"))
with(testProject(TestProjects.newAndroidTarget)) {
with(testProject("application/newAndroidTarget")) {
gradle("build", "--dry-run").checks {
}
}
@ -75,12 +76,7 @@ class GradlePluginTest : GradlePluginTestBase() {
@Test
fun jsMppIsNotBroken() =
with(
testProject(
TestProjects.jsMpp,
testEnvironment = defaultTestEnvironment.copy(
kotlinVersion = TestProperties.composeJsCompilerCompatibleKotlinVersion
)
)
testProject("misc/jsMpp")
) {
gradle(":compileKotlinJs").checks {
check.taskSuccessful(":compileKotlinJs")
@ -145,7 +141,7 @@ class GradlePluginTest : GradlePluginTestBase() {
private fun testConfigureDesktopPreviewImpl(port: Int) {
check(port > 0) { "Invalid port: $port" }
with(testProject(TestProjects.jvmPreview)) {
with(testProject("misc/jvmPreview")) {
val portProperty = "-Pcompose.desktop.preview.ide.port=$port"
val previewTargetProperty = "-Pcompose.desktop.preview.target=PreviewKt.ExamplePreview"
val jvmTask = ":jvm:configureDesktopPreview"

61
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/KotlinCompatibilityTest.kt

@ -5,10 +5,9 @@
package org.jetbrains.compose.test.tests.integration
import org.jetbrains.compose.newCompilerIsAvailableVersion
import org.jetbrains.compose.newComposeCompilerError
import org.jetbrains.compose.test.utils.GradlePluginTestBase
import org.jetbrains.compose.test.utils.TestProjects
import org.jetbrains.compose.test.utils.TestProject
import org.jetbrains.compose.test.utils.checks
import org.junit.jupiter.api.Test
@ -27,7 +26,7 @@ class KotlinCompatibilityTest : GradlePluginTestBase() {
private fun testMpp(kotlinVersion: String) = with(
testProject(
TestProjects.mpp,
"beforeKotlin2/mpp",
testEnvironment = defaultTestEnvironment.copy(kotlinVersion = kotlinVersion)
)
) {
@ -40,7 +39,7 @@ class KotlinCompatibilityTest : GradlePluginTestBase() {
private fun testJsMpp(kotlinVersion: String) = with(
testProject(
TestProjects.jsMpp,
"beforeKotlin2/jsMpp",
testEnvironment = defaultTestEnvironment.copy(kotlinVersion = kotlinVersion)
)
) {
@ -52,11 +51,63 @@ class KotlinCompatibilityTest : GradlePluginTestBase() {
@Test
fun testNewCompilerPluginError() {
val testProject = testProject(
TestProjects.mpp,
"beforeKotlin2/mpp",
testEnvironment = defaultTestEnvironment.copy(kotlinVersion = "2.0.0")
)
testProject.gradleFailure("tasks").checks {
check.logContains(newComposeCompilerError)
}
}
/**
* Test the version of Compose Compiler published by Google.
* See https://developer.android.com/jetpack/androidx/releases/compose-kotlin
*/
@Test
fun testAndroidxCompiler() = testProject(
"beforeKotlin2/custom-compiler", defaultTestEnvironment.copy(
kotlinVersion = "1.8.0",
composeCompilerPlugin = "\"androidx.compose.compiler:compiler:1.4.0\""
)
).checkCustomComposeCompiler()
@Test
fun testSettingLatestCompiler() = testProject(
"beforeKotlin2/custom-compiler", defaultTestEnvironment.copy(
kotlinVersion = "1.8.20",
composeCompilerPlugin = "dependencies.compiler.forKotlin(\"1.8.20\")",
)
).checkCustomComposeCompiler()
@Test
fun testSettingAutoCompiler() = testProject(
"beforeKotlin2/custom-compiler", defaultTestEnvironment.copy(
kotlinVersion = "1.8.10",
composeCompilerPlugin = "dependencies.compiler.auto",
)
).checkCustomComposeCompiler()
@Test
fun testKotlinCheckDisabled() = testProject(
"beforeKotlin2/custom-compiler-args", defaultTestEnvironment.copy(
kotlinVersion = "1.9.21",
composeCompilerPlugin = "dependencies.compiler.forKotlin(\"1.9.20\")",
composeCompilerArgs = "\"suppressKotlinVersionCompatibilityCheck=1.9.21\""
)
).checkCustomComposeCompiler(checkKJS = true)
private fun TestProject.checkCustomComposeCompiler(checkKJS: Boolean = false) {
gradle(":runDistributable").checks {
val actualMainImage = file("main-image.actual.png")
val expectedMainImage = file("main-image.expected.png")
assert(actualMainImage.readBytes().contentEquals(expectedMainImage.readBytes())) {
"The actual image '$actualMainImage' does not match the expected image '$expectedMainImage'"
}
}
if (checkKJS) {
gradle(":jsBrowserProductionWebpack").checks {
check.taskSuccessful(":jsBrowserProductionWebpack")
}
}
}
}

121
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/ResourcesTest.kt

@ -2,15 +2,30 @@ package org.jetbrains.compose.test.tests.integration
import org.gradle.util.GradleVersion
import org.jetbrains.compose.desktop.application.internal.ComposeProperties
import org.jetbrains.compose.internal.utils.*
import org.jetbrains.compose.internal.utils.Arch
import org.jetbrains.compose.internal.utils.OS
import org.jetbrains.compose.internal.utils.currentArch
import org.jetbrains.compose.internal.utils.currentOS
import org.jetbrains.compose.resources.XmlValuesConverterTask
import org.jetbrains.compose.test.utils.*
import org.jetbrains.compose.test.utils.GradlePluginTestBase
import org.jetbrains.compose.test.utils.TestProject
import org.jetbrains.compose.test.utils.assertEqualTextFiles
import org.jetbrains.compose.test.utils.assertNotEqualTextFiles
import org.jetbrains.compose.test.utils.checkExists
import org.jetbrains.compose.test.utils.checks
import org.jetbrains.compose.test.utils.modify
import org.junit.jupiter.api.Assumptions
import org.junit.jupiter.api.Test
import java.io.File
import java.util.zip.ZipFile
import kotlin.io.path.Path
import kotlin.io.path.invariantSeparatorsPathString
import kotlin.io.path.relativeTo
import kotlin.test.*
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertNotNull
import kotlin.test.assertNull
import kotlin.test.assertTrue
class ResourcesTest : GradlePluginTestBase() {
@Test
@ -244,38 +259,31 @@ class ResourcesTest : GradlePluginTestBase() {
val resDir = file("cmplib/src/commonMain/composeResources")
val resourcesFiles = resDir.walkTopDown()
.filter { !it.isDirectory && !it.isHidden }
.getConvertedResources(resDir)
val subdir = "me.sample.library.resources"
.getConvertedResources(resDir, "composeResources/me.sample.library.resources")
fun libpath(target: String, ext: String) =
"my-mvn/me/sample/library/cmplib-$target/1.0/cmplib-$target-1.0$ext"
val aar = file(libpath("android", ".aar"))
assertTrue(aar.exists(), "File not found: " + aar.path)
ZipFile(aar).use { zip -> resourcesFiles.forEach { fontRes ->
assertNotNull(
zip.getEntry("assets/composeResources/$subdir/$fontRes"),
"Resource not found: '$fontRes' in aar '${aar.path}'"
)
} }
checkResourcesZip(aar, resourcesFiles, true)
val jar = file(libpath("jvm", ".jar"))
checkResourcesZip(jar, resourcesFiles, subdir)
checkResourcesZip(jar, resourcesFiles, false)
if (currentOS == OS.MacOS) {
val iosx64ResZip = file(libpath("iosx64", "-kotlin_resources.kotlin_resources.zip"))
checkResourcesZip(iosx64ResZip, resourcesFiles, subdir)
checkResourcesZip(iosx64ResZip, resourcesFiles, false)
val iosarm64ResZip = file(libpath("iosarm64", "-kotlin_resources.kotlin_resources.zip"))
checkResourcesZip(iosarm64ResZip, resourcesFiles, subdir)
checkResourcesZip(iosarm64ResZip, resourcesFiles, false)
val iossimulatorarm64ResZip = file(
libpath("iossimulatorarm64", "-kotlin_resources.kotlin_resources.zip")
)
checkResourcesZip(iossimulatorarm64ResZip, resourcesFiles, subdir)
checkResourcesZip(iossimulatorarm64ResZip, resourcesFiles, false)
}
val jsResZip = file(libpath("js", "-kotlin_resources.kotlin_resources.zip"))
checkResourcesZip(jsResZip, resourcesFiles, subdir)
checkResourcesZip(jsResZip, resourcesFiles, false)
val wasmjsResZip = file(libpath("wasm-js", "-kotlin_resources.kotlin_resources.zip"))
checkResourcesZip(wasmjsResZip, resourcesFiles, subdir)
checkResourcesZip(wasmjsResZip, resourcesFiles, false)
}
file("settings.gradle.kts").modify { content ->
@ -323,14 +331,19 @@ class ResourcesTest : GradlePluginTestBase() {
}
}
private fun checkResourcesZip(zipFile: File, resourcesFiles: Sequence<String>, subdir: String) {
private fun checkResourcesZip(zipFile: File, resourcesFiles: Sequence<String>, isAndroid: Boolean) {
println("check ZIP: '${zipFile.path}'")
assertTrue(zipFile.exists(), "File not found: " + zipFile.path)
ZipFile(zipFile).use { zip ->
resourcesFiles.forEach { res ->
assertNotNull(
zip.getEntry("composeResources/$subdir/$res"),
"Resource not found: '$res' in zip '${zipFile.path}'"
)
println("check '$res' file")
if (isAndroid) {
//android resources should be only in assets
assertNull(zip.getEntry(res), "file = '$res'")
assertNotNull(zip.getEntry("assets/$res"), "file = 'assets/$res'")
} else {
assertNotNull(zip.getEntry(res), "file = '$res'")
}
}
}
}
@ -369,50 +382,51 @@ class ResourcesTest : GradlePluginTestBase() {
file("src/jsMain/composeResources/files/platform.txt").writeNewFile("js")
val commonResourcesDir = file("src/commonMain/composeResources")
val repackDir = "composeResources/app.group.resources_test.generated.resources"
val commonResourcesFiles = commonResourcesDir.walkTopDown()
.filter { !it.isDirectory && !it.isHidden }
.getConvertedResources(commonResourcesDir)
.getConvertedResources(commonResourcesDir, repackDir)
gradle("build").checks {
check.taskSuccessful(":copyDemoDebugResourcesToAndroidAssets")
check.taskSuccessful(":copyDemoReleaseResourcesToAndroidAssets")
check.taskSuccessful(":copyFullDebugResourcesToAndroidAssets")
check.taskSuccessful(":copyFullReleaseResourcesToAndroidAssets")
check.taskSuccessful(":demoDebugAssetsCopyForAGP")
check.taskSuccessful(":demoReleaseAssetsCopyForAGP")
check.taskSuccessful(":fullDebugAssetsCopyForAGP")
check.taskSuccessful(":fullReleaseAssetsCopyForAGP")
getAndroidApk("demo", "debug", "Resources-Test").let { apk ->
checkResourcesInZip(apk, commonResourcesFiles, true)
checkResourcesZip(apk, commonResourcesFiles, true)
assertEquals(
"android demo-debug",
readFileInZip(apk, "assets/files/platform.txt").decodeToString()
readFileInZip(apk, "assets/$repackDir/files/platform.txt").decodeToString()
)
}
getAndroidApk("demo", "release", "Resources-Test").let { apk ->
checkResourcesInZip(apk, commonResourcesFiles, true)
checkResourcesZip(apk, commonResourcesFiles, true)
assertEquals(
"android demo-release",
readFileInZip(apk, "assets/files/platform.txt").decodeToString()
readFileInZip(apk, "assets/$repackDir/files/platform.txt").decodeToString()
)
}
getAndroidApk("full", "debug", "Resources-Test").let { apk ->
checkResourcesInZip(apk, commonResourcesFiles, true)
checkResourcesZip(apk, commonResourcesFiles, true)
assertEquals(
"android full-debug",
readFileInZip(apk, "assets/files/platform.txt").decodeToString()
readFileInZip(apk, "assets/$repackDir/files/platform.txt").decodeToString()
)
}
getAndroidApk("full", "release", "Resources-Test").let { apk ->
checkResourcesInZip(apk, commonResourcesFiles, true)
checkResourcesZip(apk, commonResourcesFiles, true)
assertEquals(
"android full-release",
readFileInZip(apk, "assets/files/platform.txt").decodeToString()
readFileInZip(apk, "assets/$repackDir/files/platform.txt").decodeToString()
)
}
file("build/libs/Resources-Test-desktop.jar").let { jar ->
checkResourcesInZip(jar, commonResourcesFiles, false)
checkResourcesZip(jar, commonResourcesFiles, false)
assertEquals(
"desktop",
readFileInZip(jar, "files/platform.txt").decodeToString()
readFileInZip(jar, "$repackDir/files/platform.txt").decodeToString()
)
}
@ -420,11 +434,11 @@ class ResourcesTest : GradlePluginTestBase() {
commonResourcesFiles.forEach { res ->
assertTrue(jsBuildDir.resolve(res).exists())
}
assertEquals("js", jsBuildDir.resolve("files/platform.txt").readText())
assertEquals("js", jsBuildDir.resolve("$repackDir/files/platform.txt").readText())
}
}
private fun Sequence<File>.getConvertedResources(baseDir: File) = map { file ->
private fun Sequence<File>.getConvertedResources(baseDir: File, repackDir: String) = map { file ->
val newFile = if (
file.parentFile.name.startsWith("value") &&
file.extension.equals("xml", true)
@ -434,7 +448,7 @@ class ResourcesTest : GradlePluginTestBase() {
} else {
file
}
newFile.relativeTo(baseDir).invariantSeparatorsPath
Path(repackDir, newFile.relativeTo(baseDir).path).invariantSeparatorsPathString
}
private fun File.writeNewFile(text: String) {
@ -451,23 +465,6 @@ class ResourcesTest : GradlePluginTestBase() {
}
}
private fun checkResourcesInZip(file: File, commonResourcesFiles: Sequence<String>, isAndroid: Boolean) {
println("check ZIP: '${file.path}'")
assertTrue(file.exists())
ZipFile(file).use { zip ->
commonResourcesFiles.forEach { res ->
println("check '$res' file")
if (isAndroid) {
//android resources should be only in assets
assertNull(zip.getEntry(res), "file = '$res'")
assertNotNull(zip.getEntry("assets/$res"), "file = 'assets/$res'")
} else {
assertNotNull(zip.getEntry(res), "file = '$res'")
}
}
}
}
private fun readFileInZip(file: File, path: String): ByteArray = ZipFile(file).use { zip ->
val platformTxt = zip.getEntry(path)
assertNotNull(platformTxt, "file = '$path'")
@ -654,8 +651,8 @@ class ResourcesTest : GradlePluginTestBase() {
check.taskNoSource(":prepareComposeResourcesTaskForIosX64Main")
check.taskSkipped(":generateResourceAccessorsForIosX64Main")
file("build/compose/cocoapods/compose-resources/drawable/compose-multiplatform.xml").checkExists()
file("build/compose/cocoapods/compose-resources/drawable/icon.xml").checkExists()
file("build/compose/cocoapods/compose-resources/composeResources/iosresources.generated.resources/drawable/compose-multiplatform.xml").checkExists()
file("build/compose/cocoapods/compose-resources/composeResources/iosresources.generated.resources/drawable/icon.xml").checkExists()
}
gradle(":podspec", "-Pkotlin.native.cocoapods.generate.wrapper=true").checks {
@ -676,8 +673,8 @@ class ResourcesTest : GradlePluginTestBase() {
check.taskSkipped(":linkDebugTestIosX64")
}
gradle(":copyTestComposeResourcesForIosX64").checks {
file("build/bin/iosX64/debugTest/compose-resources/drawable/compose-multiplatform.xml").checkExists()
file("build/bin/iosX64/debugTest/compose-resources/drawable/icon.xml").checkExists()
file("build/bin/iosX64/debugTest/compose-resources/composeResources/iosresources.generated.resources/drawable/compose-multiplatform.xml").checkExists()
file("build/bin/iosX64/debugTest/compose-resources/composeResources/iosresources.generated.resources/drawable/icon.xml").checkExists()
}
}
}

9
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/unit/ComposeCompilerArtifactProviderTest.kt

@ -7,12 +7,10 @@ package org.jetbrains.compose.test.tests.unit
import org.jetbrains.compose.internal.ComposeCompilerArtifactProvider
import org.jetbrains.compose.internal.copy
import org.jetbrains.compose.test.utils.TestProperties
import org.jetbrains.kotlin.gradle.plugin.SubpluginArtifact
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.Assertions.*
internal class ComposeCompilerArtifactProviderTest {
@Test
fun customVersion() {
@ -69,12 +67,9 @@ internal class ComposeCompilerArtifactProviderTest {
get() = SubpluginArtifact(
groupId = "org.jetbrains.compose.compiler",
artifactId = "compiler",
version = TestProperties.composeCompilerVersion
version = "1.9.20"
)
val jbCompilerHosted: SubpluginArtifact
get() = jbCompiler.copy(artifactId = "compiler-hosted")
val googleCompiler: SubpluginArtifact
get() = jbCompiler.copy(groupId = "androidx.compose.compiler")
}

2
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/GradleTestNameGenerator.kt

@ -13,7 +13,7 @@ class GradleTestNameGenerator : DisplayNameGenerator.Standard() {
override fun generateDisplayNameForMethod(testClass: Class<*>, testMethod: Method) =
testMethod.name + with(TestProperties) {
mutableListOf<String>().apply {
muteException { add("kotlin=$composeCompilerCompatibleKotlinVersion") }
muteException { add("kotlin=$kotlinVersion") }
muteException { add("gradle=$gradleVersion") }
muteException { add("agp=$agpVersion") }
}.joinToString(prefix = "(", separator = ", ", postfix = ")")

6
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/TestProject.kt

@ -9,14 +9,12 @@ import org.gradle.testkit.runner.BuildResult
import org.gradle.testkit.runner.GradleRunner
import org.gradle.util.GradleVersion
import org.jetbrains.compose.desktop.application.internal.ComposeProperties
import org.junit.jupiter.params.provider.Arguments
import java.io.File
import java.util.Properties
import java.util.stream.Stream
import java.util.*
data class TestEnvironment(
val workingDir: File,
val kotlinVersion: String = TestProperties.composeCompilerCompatibleKotlinVersion,
val kotlinVersion: String = TestProperties.kotlinVersion,
val gradleVersion: String = TestProperties.gradleVersion,
val agpVersion: String = TestProperties.agpVersion,
val composeGradlePluginVersion: String = TestProperties.composeGradlePluginVersion,

33
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/TestProjects.kt

@ -1,33 +0,0 @@
/*
* Copyright 2020-2022 JetBrains s.r.o. and respective authors and developers.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/
package org.jetbrains.compose.test.utils
object TestProjects {
const val jvm = "application/jvm"
const val mpp = "application/mpp"
const val newAndroidTarget = "application/newAndroidTarget"
const val proguard = "application/proguard"
const val customCompiler = "application/custom-compiler"
const val customCompilerArgs = "application/custom-compiler-args"
const val customCompilerUnsupportedPlatformsWarning = "application/customCompilerUnsupportedPlatformsWarning"
const val jvmKotlinDsl = "application/jvmKotlinDsl"
const val moduleClashCli = "application/moduleClashCli"
const val javaLogger = "application/javaLogger"
const val macOptions = "application/macOptions"
const val macSign = "application/macSign"
const val optionsWithSpaces = "application/optionsWithSpaces"
const val defaultArgs = "application/defaultArgs"
const val defaultArgsOverride = "application/defaultArgsOverride"
const val unpackSkiko = "application/unpackSkiko"
const val resources = "application/resources"
const val jsMpp = "misc/jsMpp"
const val skikoWasm = "misc/skikoWasm"
const val jvmPreview = "misc/jvmPreview"
const val iosResources = "misc/iosResources"
const val iosMokoResources = "misc/iosMokoResources"
const val nativeCacheKind = "misc/nativeCacheKind"
const val nativeCacheKindError = "misc/nativeCacheKindError"
}

10
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/utils/TestProperties.kt

@ -8,14 +8,8 @@ package org.jetbrains.compose.test.utils
import java.io.File
object TestProperties {
val composeCompilerVersion: String
get() = notNullSystemProperty("compose.tests.compiler.version")
val composeCompilerCompatibleKotlinVersion: String
get() = notNullSystemProperty("compose.tests.compiler.compatible.kotlin.version")
val composeJsCompilerCompatibleKotlinVersion: String
get() = notNullSystemProperty("compose.tests.js.compiler.compatible.kotlin.version")
val kotlinVersion: String
get() = notNullSystemProperty("compose.tests.kotlin.version")
val composeGradlePluginVersion: String
get() = notNullSystemProperty("compose.tests.compose.gradle.plugin.version")

34
gradle-plugins/compose/src/test/test-projects/application/customCompilerUnsupportedPlatformsWarning/build.gradle

@ -1,34 +0,0 @@
plugins {
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.compose"
}
kotlin {
def platforms = project.property("platforms").split(",")
if (platforms.contains("jvm")) {
jvm()
}
if (platforms.contains("js")) {
js(IR) {
browser()
binaries.executable()
}
}
if (platforms.contains("ios")) {
ios()
}
sourceSets {
commonMain {
dependencies {
implementation compose.runtime
implementation compose.material
implementation compose.foundation
}
}
}
}
compose {
kotlinCompilerPlugin.set(COMPOSE_COMPILER_PLUGIN_PLACEHOLDER)
}

2
gradle-plugins/compose/src/test/test-projects/application/customCompilerUnsupportedPlatformsWarning/gradle.properties

@ -1,2 +0,0 @@
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.uikit.enabled=true

19
gradle-plugins/compose/src/test/test-projects/application/customCompilerUnsupportedPlatformsWarning/src/commonMain/kotlin/App.kt

@ -1,19 +0,0 @@
import androidx.compose.material.Button
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
@Composable
fun App() {
MaterialTheme {
var message by remember { mutableStateOf("Press the button!") }
Button(
onClick = { message = "Welcome to Compose Multiplatform!" }
) {
Text(message)
}
}
}

1
gradle-plugins/compose/src/test/test-projects/application/defaultArgs/build.gradle

@ -2,6 +2,7 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
id "org.jetbrains.kotlin.jvm"
id "org.jetbrains.kotlin.plugin.compose"
id "org.jetbrains.compose"
}

1
gradle-plugins/compose/src/test/test-projects/application/defaultArgs/settings.gradle

@ -1,6 +1,7 @@
pluginManagement {
plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.kotlin.plugin.compose' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
}
repositories {

1
gradle-plugins/compose/src/test/test-projects/application/defaultArgsOverride/build.gradle

@ -2,6 +2,7 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
id "org.jetbrains.kotlin.jvm"
id "org.jetbrains.kotlin.plugin.compose"
id "org.jetbrains.compose"
}

1
gradle-plugins/compose/src/test/test-projects/application/defaultArgsOverride/settings.gradle

@ -1,6 +1,7 @@
pluginManagement {
plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.kotlin.plugin.compose' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
}
repositories {

1
gradle-plugins/compose/src/test/test-projects/application/javaLogger/build.gradle

@ -1,5 +1,6 @@
plugins {
id "org.jetbrains.kotlin.jvm"
id "org.jetbrains.kotlin.plugin.compose"
id "org.jetbrains.compose"
}

1
gradle-plugins/compose/src/test/test-projects/application/javaLogger/settings.gradle

@ -1,6 +1,7 @@
pluginManagement {
plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.kotlin.plugin.compose' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
}
repositories {

1
gradle-plugins/compose/src/test/test-projects/application/jvm/build.gradle

@ -2,6 +2,7 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
id "org.jetbrains.kotlin.jvm"
id "org.jetbrains.kotlin.plugin.compose"
id "org.jetbrains.compose"
}

1
gradle-plugins/compose/src/test/test-projects/application/jvm/settings.gradle

@ -1,6 +1,7 @@
pluginManagement {
plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.kotlin.plugin.compose' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
}
repositories {

1
gradle-plugins/compose/src/test/test-projects/application/jvmKotlinDsl/build.gradle.kts

@ -3,6 +3,7 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
id("org.jetbrains.kotlin.jvm")
id("org.jetbrains.kotlin.plugin.compose")
id("org.jetbrains.compose")
}

1
gradle-plugins/compose/src/test/test-projects/application/jvmKotlinDsl/settings.gradle

@ -1,6 +1,7 @@
pluginManagement {
plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.kotlin.plugin.compose' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
}
repositories {

3
gradle-plugins/compose/src/test/test-projects/application/macOptions/build.gradle

@ -1,7 +1,6 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
id "org.jetbrains.kotlin.jvm"
id "org.jetbrains.kotlin.plugin.compose"
id "org.jetbrains.compose"
}

1
gradle-plugins/compose/src/test/test-projects/application/macOptions/settings.gradle

@ -1,6 +1,7 @@
pluginManagement {
plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.kotlin.plugin.compose' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
}
repositories {

3
gradle-plugins/compose/src/test/test-projects/application/macSign/build.gradle

@ -1,7 +1,6 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
id "org.jetbrains.kotlin.jvm"
id "org.jetbrains.kotlin.plugin.compose"
id "org.jetbrains.compose"
}

1
gradle-plugins/compose/src/test/test-projects/application/macSign/settings.gradle

@ -1,6 +1,7 @@
pluginManagement {
plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.kotlin.plugin.compose' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
}
repositories {

3
gradle-plugins/compose/src/test/test-projects/application/moduleClashCli/app/build.gradle

@ -1,7 +1,6 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
id "org.jetbrains.kotlin.jvm"
id "org.jetbrains.kotlin.plugin.compose"
id "org.jetbrains.compose"
}

1
gradle-plugins/compose/src/test/test-projects/application/moduleClashCli/settings.gradle

@ -1,6 +1,7 @@
pluginManagement {
plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.kotlin.plugin.compose' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
}
repositories {

12
gradle-plugins/compose/src/test/test-projects/application/mpp/build.gradle

@ -3,6 +3,7 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
id "com.android.application"
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.kotlin.plugin.compose"
id "org.jetbrains.compose"
}
@ -21,6 +22,9 @@ kotlin {
}
}
}
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
android {
@ -33,14 +37,6 @@ android {
}
}
kotlin {
jvm {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
}
compose.desktop {
application {
mainClass = "MainKt"

1
gradle-plugins/compose/src/test/test-projects/application/mpp/settings.gradle

@ -1,6 +1,7 @@
pluginManagement {
plugins {
id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.kotlin.plugin.compose' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
id 'com.android.application' version 'AGP_VERSION_PLACEHOLDER'
}

3
gradle-plugins/compose/src/test/test-projects/application/newAndroidTarget/build.gradle

@ -1,7 +1,6 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.kotlin.plugin.compose"
id "com.android.kotlin.multiplatform.library"
id "org.jetbrains.compose"
}

1
gradle-plugins/compose/src/test/test-projects/application/newAndroidTarget/settings.gradle

@ -1,6 +1,7 @@
pluginManagement {
plugins {
id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.kotlin.plugin.compose' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
id 'com.android.kotlin.multiplatform.library' version '8.2.0-alpha13'
}

1
gradle-plugins/compose/src/test/test-projects/application/optionsWithSpaces/build.gradle

@ -2,6 +2,7 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
id "org.jetbrains.kotlin.jvm"
id "org.jetbrains.kotlin.plugin.compose"
id "org.jetbrains.compose"
}

1
gradle-plugins/compose/src/test/test-projects/application/optionsWithSpaces/settings.gradle

@ -1,6 +1,7 @@
pluginManagement {
plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.kotlin.plugin.compose' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
}
repositories {

1
gradle-plugins/compose/src/test/test-projects/application/proguard/build.gradle

@ -3,6 +3,7 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
id "org.jetbrains.kotlin.jvm"
id "org.jetbrains.kotlin.plugin.compose"
id "org.jetbrains.compose"
}

4
gradle-plugins/compose/src/test/test-projects/application/proguard/main-methods.expected.txt

@ -1,3 +1,5 @@
keptByKeepRule
keptByKeepRule$lambda$5
main
mainShape
mainShape
mainShape$lambda$2

1
gradle-plugins/compose/src/test/test-projects/application/proguard/settings.gradle

@ -1,6 +1,7 @@
pluginManagement {
plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.kotlin.plugin.compose' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
}
repositories {

1
gradle-plugins/compose/src/test/test-projects/application/resources/build.gradle

@ -2,6 +2,7 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
id "org.jetbrains.kotlin.jvm"
id "org.jetbrains.kotlin.plugin.compose"
id "org.jetbrains.compose"
}

1
gradle-plugins/compose/src/test/test-projects/application/resources/settings.gradle

@ -1,6 +1,7 @@
pluginManagement {
plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.kotlin.plugin.compose' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
}
repositories {

1
gradle-plugins/compose/src/test/test-projects/application/unpackSkiko/build.gradle

@ -2,6 +2,7 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
id "org.jetbrains.kotlin.jvm"
id "org.jetbrains.kotlin.plugin.compose"
id "org.jetbrains.compose"
}

1
gradle-plugins/compose/src/test/test-projects/application/unpackSkiko/settings.gradle

@ -1,6 +1,7 @@
pluginManagement {
plugins {
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.kotlin.plugin.compose' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
}
repositories {

0
gradle-plugins/compose/src/test/test-projects/application/custom-compiler-args/build.gradle → gradle-plugins/compose/src/test/test-projects/beforeKotlin2/custom-compiler-args/build.gradle

0
gradle-plugins/compose/src/test/test-projects/application/custom-compiler-args/main-image.expected.png → gradle-plugins/compose/src/test/test-projects/beforeKotlin2/custom-compiler-args/main-image.expected.png

Before

Width:  |  Height:  |  Size: 137 B

After

Width:  |  Height:  |  Size: 137 B

0
gradle-plugins/compose/src/test/test-projects/application/custom-compiler-args/settings.gradle → gradle-plugins/compose/src/test/test-projects/beforeKotlin2/custom-compiler-args/settings.gradle

0
gradle-plugins/compose/src/test/test-projects/application/custom-compiler-args/src/desktopMain/kotlin/Main.kt → gradle-plugins/compose/src/test/test-projects/beforeKotlin2/custom-compiler-args/src/desktopMain/kotlin/Main.kt

0
gradle-plugins/compose/src/test/test-projects/application/custom-compiler-args/src/jsMain/kotlin/Main.js.kt → gradle-plugins/compose/src/test/test-projects/beforeKotlin2/custom-compiler-args/src/jsMain/kotlin/Main.js.kt

0
gradle-plugins/compose/src/test/test-projects/application/custom-compiler/build.gradle → gradle-plugins/compose/src/test/test-projects/beforeKotlin2/custom-compiler/build.gradle

0
gradle-plugins/compose/src/test/test-projects/application/custom-compiler/main-image.expected.png → gradle-plugins/compose/src/test/test-projects/beforeKotlin2/custom-compiler/main-image.expected.png

Before

Width:  |  Height:  |  Size: 137 B

After

Width:  |  Height:  |  Size: 137 B

0
gradle-plugins/compose/src/test/test-projects/application/custom-compiler/settings.gradle → gradle-plugins/compose/src/test/test-projects/beforeKotlin2/custom-compiler/settings.gradle

0
gradle-plugins/compose/src/test/test-projects/application/custom-compiler/src/main/kotlin/Main.kt → gradle-plugins/compose/src/test/test-projects/beforeKotlin2/custom-compiler/src/main/kotlin/Main.kt

27
gradle-plugins/compose/src/test/test-projects/beforeKotlin2/jsMpp/build.gradle

@ -0,0 +1,27 @@
plugins {
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.compose"
}
kotlin {
js(IR) {
browser()
}
jvm {}
sourceSets {
named("commonMain") {
}
named("jsMain") {
dependencies {
implementation(compose.html.core)
implementation(compose.runtime)
}
}
named("jvmMain") {
dependencies {
implementation(compose.desktop.currentOs)
}
}
}
}

5
gradle-plugins/compose/src/test/test-projects/misc/nativeCacheKindError/settings.gradle → gradle-plugins/compose/src/test/test-projects/beforeKotlin2/jsMpp/settings.gradle

@ -15,13 +15,12 @@ pluginManagement {
}
dependencyResolutionManagement {
repositories {
mavenCentral()
mavenLocal()
mavenCentral()
google()
maven {
url 'https://maven.pkg.jetbrains.space/public/p/compose/dev'
}
}
}
rootProject.name = "nativeCacheKind"
include(":subproject")
rootProject.name = "jsMpp"

1
gradle-plugins/compose/src/test/test-projects/beforeKotlin2/jsMpp/src/commonMain/kotlin/platform.kt

@ -0,0 +1 @@
expect fun getPlatformName(): String

1
gradle-plugins/compose/src/test/test-projects/beforeKotlin2/jsMpp/src/jsMain/kotlin/platform.kt

@ -0,0 +1 @@
actual fun getPlatformName(): String = "js"

1
gradle-plugins/compose/src/test/test-projects/beforeKotlin2/jsMpp/src/jvmMain/kotlin/platform.kt

@ -0,0 +1 @@
actual fun getPlatformName(): String = "jvm"

73
gradle-plugins/compose/src/test/test-projects/beforeKotlin2/mpp/build.gradle

@ -0,0 +1,73 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
id "com.android.application"
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.compose"
}
kotlin {
// empty stub (no actual android app) to detect configuration conflicts
// like https://github.com/JetBrains/compose-jb/issues/2345
android()
jvm()
sourceSets {
jvmMain {
dependsOn(commonMain)
dependencies {
implementation(compose.desktop.currentOs)
}
}
}
}
android {
namespace = "org.jetbrains.compose.testapp"
compileSdk = 31
defaultConfig {
minSdk = 21
targetSdk = 31
}
}
kotlin {
jvm {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
}
compose.desktop {
application {
mainClass = "MainKt"
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageVersion = "1.0.0"
packageName = "TestPackage"
description = "Test description"
copyright = "Test Copyright Holder"
vendor = "Test Vendor"
linux {
shortcut = true
packageName = "test-package"
debMaintainer = "example@example.com"
menuGroup = "menu-group"
}
windows {
console = true
dirChooser = true
perUserInstall = true
shortcut = true
menu = true
menuGroup = "compose"
upgradeUuid = "2d6ff464-75be-40ad-a256-56420b9cc374"
}
}
}
}

1
gradle-plugins/compose/src/test/test-projects/beforeKotlin2/mpp/gradle.properties

@ -0,0 +1 @@
android.useAndroidX=true

9
gradle-plugins/compose/src/test/test-projects/application/customCompilerUnsupportedPlatformsWarning/settings.gradle → gradle-plugins/compose/src/test/test-projects/beforeKotlin2/mpp/settings.gradle

@ -2,6 +2,7 @@ pluginManagement {
plugins {
id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
id 'com.android.application' version 'AGP_VERSION_PLACEHOLDER'
}
repositories {
mavenLocal()
@ -11,6 +12,9 @@ pluginManagement {
maven {
url 'https://maven.pkg.jetbrains.space/public/p/compose/dev'
}
maven {
url 'https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev/'
}
}
}
dependencyResolutionManagement {
@ -21,6 +25,9 @@ dependencyResolutionManagement {
maven {
url 'https://maven.pkg.jetbrains.space/public/p/compose/dev'
}
maven {
url 'https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev/'
}
}
}
rootProject.name = "customCompilerUnsupportedPlatformsWarning"
rootProject.name = "mpp"

3
gradle-plugins/compose/src/test/test-projects/beforeKotlin2/mpp/src/jvmMain/kotlin/main.kt

@ -0,0 +1,3 @@
fun main() {
println("Kotlin MPP app is running!")
}

1
gradle-plugins/compose/src/test/test-projects/misc/bundledKotlinPoet/app/build.gradle.kts

@ -1,5 +1,6 @@
plugins {
kotlin("multiplatform")
kotlin("plugin.compose")
id("org.jetbrains.compose")
id("com.github.gmazzo.buildconfig")
}

1
gradle-plugins/compose/src/test/test-projects/misc/bundledKotlinPoet/build.gradle.kts

@ -1,4 +1,5 @@
plugins {
kotlin("multiplatform").apply(false)
kotlin("plugin.compose").apply(false)
id("org.jetbrains.compose").apply(false)
}

1
gradle-plugins/compose/src/test/test-projects/misc/bundledKotlinPoet/settings.gradle.kts

@ -9,6 +9,7 @@ pluginManagement {
}
plugins {
id("org.jetbrains.kotlin.multiplatform").version("KOTLIN_VERSION_PLACEHOLDER")
id("org.jetbrains.kotlin.plugin.compose").version("KOTLIN_VERSION_PLACEHOLDER")
id("org.jetbrains.compose").version("COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER")
id("com.github.gmazzo.buildconfig").version("5.3.5")
}

7
gradle-plugins/compose/src/test/test-projects/misc/commonResources/build.gradle.kts

@ -1,5 +1,6 @@
plugins {
kotlin("multiplatform")
kotlin("plugin.compose")
id("com.android.application")
id("org.jetbrains.compose")
}
@ -9,8 +10,10 @@ group = "app.group"
kotlin {
androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = "11"
compileTaskProvider {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11)
}
}
}
}

4
gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected-open-res/androidMainResourceAccessors/my/lib/res/String0.androidMain.kt

@ -16,7 +16,7 @@ public val Res.string.android_str: StringResource
private fun init_android_str(): StringResource = org.jetbrains.compose.resources.StringResource(
"string:android_str", "android_str",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "values/strings.androidMain.cvr", 10,
39),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/my.lib.res/values/strings.androidMain.cvr", 10, 39),
)
)

24
gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected-open-res/commonMainResourceAccessors/my/lib/res/Drawable0.commonMain.kt

@ -29,7 +29,8 @@ private fun init__3_strange_name(): DrawableResource =
org.jetbrains.compose.resources.DrawableResource(
"drawable:_3_strange_name",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "drawable/3-strange-name.xml", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/my.lib.res/drawable/3-strange-name.xml", -1, -1),
)
)
@ -40,7 +41,8 @@ private fun init_camelCaseName(): DrawableResource =
org.jetbrains.compose.resources.DrawableResource(
"drawable:camelCaseName",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "drawable/camelCaseName.xml", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/my.lib.res/drawable/camelCaseName.xml", -1, -1),
)
)
@ -50,7 +52,8 @@ public val Res.drawable.`is`: DrawableResource
private fun init_is(): DrawableResource = org.jetbrains.compose.resources.DrawableResource(
"drawable:is",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "drawable/is.xml", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/my.lib.res/drawable/is.xml", -1, -1),
)
)
@ -62,18 +65,20 @@ private fun init_vector(): DrawableResource = org.jetbrains.compose.resources.Dr
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(org.jetbrains.compose.resources.LanguageQualifier("ast"),
), "drawable-ast/vector.xml", -1, -1),
), "composeResources/my.lib.res/drawable-ast/vector.xml", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(org.jetbrains.compose.resources.LanguageQualifier("au"),
org.jetbrains.compose.resources.RegionQualifier("US"), ), "drawable-au-rUS/vector.xml", -1, -1),
org.jetbrains.compose.resources.RegionQualifier("US"), ),
"composeResources/my.lib.res/drawable-au-rUS/vector.xml", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(org.jetbrains.compose.resources.ThemeQualifier.DARK,
org.jetbrains.compose.resources.LanguageQualifier("ge"), ),
"drawable-dark-ge/vector.xml", -1, -1),
"composeResources/my.lib.res/drawable-dark-ge/vector.xml", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(org.jetbrains.compose.resources.LanguageQualifier("en"),
), "drawable-en/vector.xml", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(), "drawable/vector.xml", -1, -1),
), "composeResources/my.lib.res/drawable-en/vector.xml", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/my.lib.res/drawable/vector.xml", -1, -1),
)
)
@ -83,6 +88,7 @@ public val Res.drawable.vector_2: DrawableResource
private fun init_vector_2(): DrawableResource = org.jetbrains.compose.resources.DrawableResource(
"drawable:vector_2",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "drawable/vector_2.xml", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/my.lib.res/drawable/vector_2.xml", -1, -1),
)
)

5
gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected-open-res/commonMainResourceAccessors/my/lib/res/Font0.commonMain.kt

@ -18,7 +18,8 @@ private fun init_emptyFont(): FontResource = org.jetbrains.compose.resources.Fon
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(org.jetbrains.compose.resources.LanguageQualifier("en"),
), "font-en/emptyFont.otf", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(), "font/emptyFont.otf", -1, -1),
), "composeResources/my.lib.res/font-en/emptyFont.otf", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/my.lib.res/font/emptyFont.otf", -1, -1),
)
)

4
gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected-open-res/commonMainResourceAccessors/my/lib/res/Plurals0.commonMain.kt

@ -17,7 +17,7 @@ private fun init_numberOfSongsAvailable(): PluralStringResource =
org.jetbrains.compose.resources.PluralStringResource(
"plurals:numberOfSongsAvailable", "numberOfSongsAvailable",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "values/strings.commonMain.cvr", 10,
124),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/my.lib.res/values/strings.commonMain.cvr", 10, 124),
)
)

32
gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected-open-res/commonMainResourceAccessors/my/lib/res/String0.commonMain.kt

@ -37,8 +37,8 @@ public val Res.string.PascalCase: StringResource
private fun init_PascalCase(): StringResource = org.jetbrains.compose.resources.StringResource(
"string:PascalCase", "PascalCase",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "values/strings.commonMain.cvr", 172,
34),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/my.lib.res/values/strings.commonMain.cvr", 172, 34),
)
)
@ -48,8 +48,8 @@ public val Res.string._1_kebab_case: StringResource
private fun init__1_kebab_case(): StringResource = org.jetbrains.compose.resources.StringResource(
"string:_1_kebab_case", "_1_kebab_case",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "values/strings.commonMain.cvr", 135,
36),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/my.lib.res/values/strings.commonMain.cvr", 135, 36),
)
)
@ -59,8 +59,8 @@ public val Res.string.app_name: StringResource
private fun init_app_name(): StringResource = org.jetbrains.compose.resources.StringResource(
"string:app_name", "app_name",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "values/strings.commonMain.cvr", 207,
44),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/my.lib.res/values/strings.commonMain.cvr", 207, 44),
)
)
@ -70,8 +70,8 @@ public val Res.string.camelCase: StringResource
private fun init_camelCase(): StringResource = org.jetbrains.compose.resources.StringResource(
"string:camelCase", "camelCase",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "values/strings.commonMain.cvr", 252,
29),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/my.lib.res/values/strings.commonMain.cvr", 252, 29),
)
)
@ -81,8 +81,8 @@ public val Res.string.hello: StringResource
private fun init_hello(): StringResource = org.jetbrains.compose.resources.StringResource(
"string:hello", "hello",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "values/strings.commonMain.cvr", 282,
37),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/my.lib.res/values/strings.commonMain.cvr", 282, 37),
)
)
@ -93,8 +93,8 @@ private fun `init_info_using_release_$x`(): StringResource =
org.jetbrains.compose.resources.StringResource(
"string:info_using_release_${'$'}x", "info_using_release_${'$'}x",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "values/strings.commonMain.cvr", 320,
57),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/my.lib.res/values/strings.commonMain.cvr", 320, 57),
)
)
@ -104,8 +104,8 @@ public val Res.string.multi_line: StringResource
private fun init_multi_line(): StringResource = org.jetbrains.compose.resources.StringResource(
"string:multi_line", "multi_line",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "values/strings.commonMain.cvr", 378,
178),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/my.lib.res/values/strings.commonMain.cvr", 378, 178),
)
)
@ -115,7 +115,7 @@ public val Res.string.str_template: StringResource
private fun init_str_template(): StringResource = org.jetbrains.compose.resources.StringResource(
"string:str_template", "str_template",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "values/strings.commonMain.cvr", 557,
76),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/my.lib.res/values/strings.commonMain.cvr", 557, 76),
)
)

5
gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected-open-res/commonResClass/my/lib/res/Res.kt

@ -22,7 +22,8 @@ public object Res {
* @return The content of the file as a byte array.
*/
@ExperimentalResourceApi
public suspend fun readBytes(path: String): ByteArray = readResourceBytes("" + path)
public suspend fun readBytes(path: String): ByteArray =
readResourceBytes("composeResources/my.lib.res/" + path)
/**
* Returns the URI string of the resource file at the specified path.
@ -33,7 +34,7 @@ public object Res {
* @return The URI string of the file.
*/
@ExperimentalResourceApi
public fun getUri(path: String): String = getResourceUri("" + path)
public fun getUri(path: String): String = getResourceUri("composeResources/my.lib.res/" + path)
public object drawable

2
gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected-open-res/desktopMainResourceAccessors/my/lib/res/String0.desktopMain.kt

@ -17,6 +17,6 @@ private fun init_desktop_str(): StringResource = org.jetbrains.compose.resources
"string:desktop_str", "desktop_str",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(),
"values/desktop_strings.desktopMain.cvr", 10, 39),
"composeResources/my.lib.res/values/desktop_strings.desktopMain.cvr", 10, 39),
)
)

5
gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected/androidMainResourceAccessors/app/group/resources_test/generated/resources/String0.androidMain.kt

@ -16,7 +16,8 @@ internal val Res.string.android_str: StringResource
private fun init_android_str(): StringResource = org.jetbrains.compose.resources.StringResource(
"string:android_str", "android_str",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "values/strings.androidMain.cvr", 10,
39),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/app.group.resources_test.generated.resources/values/strings.androidMain.cvr",
10, 39),
)
)

26
gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected/commonMainResourceAccessors/app/group/resources_test/generated/resources/Drawable0.commonMain.kt

@ -29,7 +29,8 @@ private fun init__3_strange_name(): DrawableResource =
org.jetbrains.compose.resources.DrawableResource(
"drawable:_3_strange_name",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "drawable/3-strange-name.xml", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/app.group.resources_test.generated.resources/drawable/3-strange-name.xml", -1, -1),
)
)
@ -40,7 +41,8 @@ private fun init_camelCaseName(): DrawableResource =
org.jetbrains.compose.resources.DrawableResource(
"drawable:camelCaseName",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "drawable/camelCaseName.xml", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/app.group.resources_test.generated.resources/drawable/camelCaseName.xml", -1, -1),
)
)
@ -50,7 +52,8 @@ internal val Res.drawable.`is`: DrawableResource
private fun init_is(): DrawableResource = org.jetbrains.compose.resources.DrawableResource(
"drawable:is",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "drawable/is.xml", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/app.group.resources_test.generated.resources/drawable/is.xml", -1, -1),
)
)
@ -62,18 +65,22 @@ private fun init_vector(): DrawableResource = org.jetbrains.compose.resources.Dr
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(org.jetbrains.compose.resources.LanguageQualifier("ast"),
), "drawable-ast/vector.xml", -1, -1),
),
"composeResources/app.group.resources_test.generated.resources/drawable-ast/vector.xml", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(org.jetbrains.compose.resources.LanguageQualifier("au"),
org.jetbrains.compose.resources.RegionQualifier("US"), ), "drawable-au-rUS/vector.xml", -1, -1),
org.jetbrains.compose.resources.RegionQualifier("US"), ),
"composeResources/app.group.resources_test.generated.resources/drawable-au-rUS/vector.xml", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(org.jetbrains.compose.resources.ThemeQualifier.DARK,
org.jetbrains.compose.resources.LanguageQualifier("ge"), ),
"drawable-dark-ge/vector.xml", -1, -1),
"composeResources/app.group.resources_test.generated.resources/drawable-dark-ge/vector.xml", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(org.jetbrains.compose.resources.LanguageQualifier("en"),
), "drawable-en/vector.xml", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(), "drawable/vector.xml", -1, -1),
),
"composeResources/app.group.resources_test.generated.resources/drawable-en/vector.xml", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/app.group.resources_test.generated.resources/drawable/vector.xml", -1, -1),
)
)
@ -83,6 +90,7 @@ internal val Res.drawable.vector_2: DrawableResource
private fun init_vector_2(): DrawableResource = org.jetbrains.compose.resources.DrawableResource(
"drawable:vector_2",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "drawable/vector_2.xml", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/app.group.resources_test.generated.resources/drawable/vector_2.xml", -1, -1),
)
)

6
gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected/commonMainResourceAccessors/app/group/resources_test/generated/resources/Font0.commonMain.kt

@ -18,7 +18,9 @@ private fun init_emptyFont(): FontResource = org.jetbrains.compose.resources.Fon
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(org.jetbrains.compose.resources.LanguageQualifier("en"),
), "font-en/emptyFont.otf", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(), "font/emptyFont.otf", -1, -1),
),
"composeResources/app.group.resources_test.generated.resources/font-en/emptyFont.otf", -1, -1),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/app.group.resources_test.generated.resources/font/emptyFont.otf", -1, -1),
)
)

5
gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected/commonMainResourceAccessors/app/group/resources_test/generated/resources/Plurals0.commonMain.kt

@ -17,7 +17,8 @@ private fun init_numberOfSongsAvailable(): PluralStringResource =
org.jetbrains.compose.resources.PluralStringResource(
"plurals:numberOfSongsAvailable", "numberOfSongsAvailable",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "values/strings.commonMain.cvr", 10,
124),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/app.group.resources_test.generated.resources/values/strings.commonMain.cvr",
10, 124),
)
)

40
gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected/commonMainResourceAccessors/app/group/resources_test/generated/resources/String0.commonMain.kt

@ -37,8 +37,9 @@ internal val Res.string.PascalCase: StringResource
private fun init_PascalCase(): StringResource = org.jetbrains.compose.resources.StringResource(
"string:PascalCase", "PascalCase",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "values/strings.commonMain.cvr", 172,
34),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/app.group.resources_test.generated.resources/values/strings.commonMain.cvr",
172, 34),
)
)
@ -48,8 +49,9 @@ internal val Res.string._1_kebab_case: StringResource
private fun init__1_kebab_case(): StringResource = org.jetbrains.compose.resources.StringResource(
"string:_1_kebab_case", "_1_kebab_case",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "values/strings.commonMain.cvr", 135,
36),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/app.group.resources_test.generated.resources/values/strings.commonMain.cvr",
135, 36),
)
)
@ -59,8 +61,9 @@ internal val Res.string.app_name: StringResource
private fun init_app_name(): StringResource = org.jetbrains.compose.resources.StringResource(
"string:app_name", "app_name",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "values/strings.commonMain.cvr", 207,
44),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/app.group.resources_test.generated.resources/values/strings.commonMain.cvr",
207, 44),
)
)
@ -70,8 +73,9 @@ internal val Res.string.camelCase: StringResource
private fun init_camelCase(): StringResource = org.jetbrains.compose.resources.StringResource(
"string:camelCase", "camelCase",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "values/strings.commonMain.cvr", 252,
29),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/app.group.resources_test.generated.resources/values/strings.commonMain.cvr",
252, 29),
)
)
@ -81,8 +85,9 @@ internal val Res.string.hello: StringResource
private fun init_hello(): StringResource = org.jetbrains.compose.resources.StringResource(
"string:hello", "hello",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "values/strings.commonMain.cvr", 282,
37),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/app.group.resources_test.generated.resources/values/strings.commonMain.cvr",
282, 37),
)
)
@ -93,8 +98,9 @@ private fun `init_info_using_release_$x`(): StringResource =
org.jetbrains.compose.resources.StringResource(
"string:info_using_release_${'$'}x", "info_using_release_${'$'}x",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "values/strings.commonMain.cvr", 320,
57),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/app.group.resources_test.generated.resources/values/strings.commonMain.cvr",
320, 57),
)
)
@ -104,8 +110,9 @@ internal val Res.string.multi_line: StringResource
private fun init_multi_line(): StringResource = org.jetbrains.compose.resources.StringResource(
"string:multi_line", "multi_line",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "values/strings.commonMain.cvr", 378,
178),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/app.group.resources_test.generated.resources/values/strings.commonMain.cvr",
378, 178),
)
)
@ -115,7 +122,8 @@ internal val Res.string.str_template: StringResource
private fun init_str_template(): StringResource = org.jetbrains.compose.resources.StringResource(
"string:str_template", "str_template",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(), "values/strings.commonMain.cvr", 557,
76),
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/app.group.resources_test.generated.resources/values/strings.commonMain.cvr",
557, 76),
)
)

6
gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected/commonResClass/app/group/resources_test/generated/resources/Res.kt

@ -22,7 +22,8 @@ internal object Res {
* @return The content of the file as a byte array.
*/
@ExperimentalResourceApi
public suspend fun readBytes(path: String): ByteArray = readResourceBytes("" + path)
public suspend fun readBytes(path: String): ByteArray =
readResourceBytes("composeResources/app.group.resources_test.generated.resources/" + path)
/**
* Returns the URI string of the resource file at the specified path.
@ -33,7 +34,8 @@ internal object Res {
* @return The URI string of the file.
*/
@ExperimentalResourceApi
public fun getUri(path: String): String = getResourceUri("" + path)
public fun getUri(path: String): String =
getResourceUri("composeResources/app.group.resources_test.generated.resources/" + path)
public object drawable

3
gradle-plugins/compose/src/test/test-projects/misc/commonResources/expected/desktopMainResourceAccessors/app/group/resources_test/generated/resources/String0.desktopMain.kt

@ -17,6 +17,7 @@ private fun init_desktop_str(): StringResource = org.jetbrains.compose.resources
"string:desktop_str", "desktop_str",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(),
"values/desktop_strings.desktopMain.cvr", 10, 39),
"composeResources/app.group.resources_test.generated.resources/values/desktop_strings.desktopMain.cvr",
10, 39),
)
)

1
gradle-plugins/compose/src/test/test-projects/misc/commonResources/settings.gradle.kts

@ -9,6 +9,7 @@ pluginManagement {
plugins {
id("com.android.application").version("AGP_VERSION_PLACEHOLDER")
id("org.jetbrains.kotlin.multiplatform").version("KOTLIN_VERSION_PLACEHOLDER")
id("org.jetbrains.kotlin.plugin.compose").version("KOTLIN_VERSION_PLACEHOLDER")
id("org.jetbrains.compose").version("COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER")
}
}

1
gradle-plugins/compose/src/test/test-projects/misc/emptyResources/build.gradle.kts

@ -1,5 +1,6 @@
plugins {
kotlin("multiplatform")
kotlin("plugin.compose")
id("org.jetbrains.compose")
}

6
gradle-plugins/compose/src/test/test-projects/misc/emptyResources/expected/Res.kt

@ -22,7 +22,8 @@ internal object Res {
* @return The content of the file as a byte array.
*/
@ExperimentalResourceApi
public suspend fun readBytes(path: String): ByteArray = readResourceBytes("" + path)
public suspend fun readBytes(path: String): ByteArray =
readResourceBytes("composeResources/app.group.empty_res.generated.resources/" + path)
/**
* Returns the URI string of the resource file at the specified path.
@ -33,7 +34,8 @@ internal object Res {
* @return The URI string of the file.
*/
@ExperimentalResourceApi
public fun getUri(path: String): String = getResourceUri("" + path)
public fun getUri(path: String): String =
getResourceUri("composeResources/app.group.empty_res.generated.resources/" + path)
public object drawable

1
gradle-plugins/compose/src/test/test-projects/misc/emptyResources/settings.gradle.kts

@ -8,6 +8,7 @@ pluginManagement {
}
plugins {
id("org.jetbrains.kotlin.multiplatform").version("KOTLIN_VERSION_PLACEHOLDER")
id("org.jetbrains.kotlin.plugin.compose").version("KOTLIN_VERSION_PLACEHOLDER")
id("org.jetbrains.compose").version("COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER")
}
}

1
gradle-plugins/compose/src/test/test-projects/misc/iosResources/build.gradle.kts

@ -1,5 +1,6 @@
plugins {
kotlin("multiplatform")
kotlin("plugin.compose")
kotlin("native.cocoapods")
id("org.jetbrains.compose")
}

4
gradle-plugins/compose/src/test/test-projects/misc/iosResources/expected/iosResources.podspec

@ -22,6 +22,10 @@ Pod::Spec.new do |spec|
Alternatively, proper pod installation is performed during Gradle sync in the IDE (if Podfile location is set)"
end
spec.xcconfig = {
'ENABLE_USER_SCRIPT_SANDBOXING' => 'NO',
}
spec.pod_target_xcconfig = {
'KOTLIN_PROJECT_PATH' => '',
'PRODUCT_MODULE_NAME' => 'shared',

1
gradle-plugins/compose/src/test/test-projects/misc/iosResources/settings.gradle.kts

@ -8,6 +8,7 @@ pluginManagement {
}
plugins {
id("org.jetbrains.kotlin.multiplatform").version("KOTLIN_VERSION_PLACEHOLDER")
id("org.jetbrains.kotlin.plugin.compose").version("KOTLIN_VERSION_PLACEHOLDER")
id("org.jetbrains.kotlin.native.cocoapods").version("KOTLIN_VERSION_PLACEHOLDER")
id("org.jetbrains.compose").version("COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER")
}

3
gradle-plugins/compose/src/test/test-projects/misc/jsMpp/build.gradle

@ -1,7 +1,6 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.kotlin.plugin.compose"
id "org.jetbrains.compose"
}

1
gradle-plugins/compose/src/test/test-projects/misc/jsMpp/settings.gradle

@ -1,6 +1,7 @@
pluginManagement {
plugins {
id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.kotlin.plugin.compose' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
}
repositories {

1
gradle-plugins/compose/src/test/test-projects/misc/jvmOnlyResources/build.gradle.kts

@ -1,5 +1,6 @@
plugins {
id("org.jetbrains.compose")
kotlin("plugin.compose")
kotlin("jvm")
}

1
gradle-plugins/compose/src/test/test-projects/misc/jvmOnlyResources/settings.gradle.kts

@ -8,6 +8,7 @@ pluginManagement {
}
plugins {
id("org.jetbrains.kotlin.jvm").version("KOTLIN_VERSION_PLACEHOLDER")
id("org.jetbrains.kotlin.plugin.compose").version("KOTLIN_VERSION_PLACEHOLDER")
id("org.jetbrains.compose").version("COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER")
}
}

1
gradle-plugins/compose/src/test/test-projects/misc/jvmPreview/common/build.gradle

@ -1,5 +1,6 @@
plugins {
id 'org.jetbrains.kotlin.multiplatform'
id 'org.jetbrains.kotlin.plugin.compose'
id 'org.jetbrains.compose'
}

1
gradle-plugins/compose/src/test/test-projects/misc/jvmPreview/jvm/build.gradle

@ -1,5 +1,6 @@
plugins {
id 'org.jetbrains.kotlin.jvm'
id 'org.jetbrains.kotlin.plugin.compose'
id 'org.jetbrains.compose'
}

1
gradle-plugins/compose/src/test/test-projects/misc/jvmPreview/mpp/build.gradle

@ -1,5 +1,6 @@
plugins {
id 'org.jetbrains.kotlin.multiplatform'
id 'org.jetbrains.kotlin.plugin.compose'
id 'org.jetbrains.compose'
}

1
gradle-plugins/compose/src/test/test-projects/misc/jvmPreview/settings.gradle

@ -1,6 +1,7 @@
pluginManagement {
plugins {
id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.kotlin.plugin.compose' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.kotlin.jvm' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
}

27
gradle-plugins/compose/src/test/test-projects/misc/nativeCacheKind/build.gradle

@ -1,27 +0,0 @@
plugins {
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.compose"
}
kotlin {
iosX64 {
binaries.framework {
isStatic = true
baseName = "shared"
}
}
iosArm64 {
binaries.framework {
isStatic = true
baseName = "shared"
}
}
sourceSets {
commonMain {
dependencies {
implementation(compose.runtime)
}
}
}
}

2
gradle-plugins/compose/src/test/test-projects/misc/nativeCacheKind/gradle.properties

@ -1,2 +0,0 @@
org.gradle.jvmargs=-Xmx8096M
org.jetbrains.compose.experimental.uikit.enabled=true

27
gradle-plugins/compose/src/test/test-projects/misc/nativeCacheKind/settings.gradle

@ -1,27 +0,0 @@
pluginManagement {
plugins {
id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
}
repositories {
mavenLocal()
gradlePluginPortal()
mavenCentral()
google()
maven {
url 'https://maven.pkg.jetbrains.space/public/p/compose/dev'
}
}
}
dependencyResolutionManagement {
repositories {
mavenLocal()
mavenCentral()
google()
maven {
url 'https://maven.pkg.jetbrains.space/public/p/compose/dev'
}
}
}
rootProject.name = "nativeCacheKind"
include(":subproject")

10
gradle-plugins/compose/src/test/test-projects/misc/nativeCacheKind/src/commonMain/kotlin/App.kt

@ -1,10 +0,0 @@
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
@Composable
fun App() {
var text by remember { mutableStateOf("Hello, World!") }
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save