diff --git a/components/gradle.properties b/components/gradle.properties index c52d6fe71c..74f0eb7180 100644 --- a/components/gradle.properties +++ b/components/gradle.properties @@ -3,17 +3,15 @@ android.useAndroidX=true android.enableJetifier=true kotlin.code.style=official # __KOTLIN_COMPOSE_VERSION__ -kotlin.version=1.8.22 +kotlin.version=1.9.20 # __LATEST_COMPOSE_RELEASE_VERSION__ -compose.version=1.5.10-rc01 -agp.version=7.3.1 +compose.version=1.5.10 +agp.version=8.1.0 org.jetbrains.compose.experimental.jscanvas.enabled=true org.jetbrains.compose.experimental.macos.enabled=true org.jetbrains.compose.experimental.uikit.enabled=true kotlin.native.useEmbeddableCompilerJar=true -kotlin.native.enableDependencyPropagation=false -kotlin.mpp.enableGranularSourceSetsMetadata=true # Enable kotlin/native experimental memory model kotlin.native.binary.memoryModel=experimental compose.desktop.verbose=true diff --git a/components/gradle/wrapper/gradle-wrapper.properties b/components/gradle/wrapper/gradle-wrapper.properties index ae04661ee7..15de90249f 100644 --- a/components/gradle/wrapper/gradle-wrapper.properties +++ b/components/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/components/resources/demo/androidApp/build.gradle.kts b/components/resources/demo/androidApp/build.gradle.kts index 3c2f0857ff..b62d4cb9d0 100644 --- a/components/resources/demo/androidApp/build.gradle.kts +++ b/components/resources/demo/androidApp/build.gradle.kts @@ -13,16 +13,40 @@ dependencies { } android { - compileSdk = 33 + compileSdk = 34 defaultConfig { applicationId = "me.user.androidApp" minSdk = 21 - targetSdk = 33 + targetSdk = 34 versionCode = 1 versionName = "1.0" } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + namespace = "org.jetbrains.compose.resources.demo" + + signingConfigs { + // We use a bundled debug keystore, to allow debug builds from CI to be upgradable + named("debug") { + storeFile = project.file("debug.keystore") + storePassword = "android" + keyAlias = "androiddebugkey" + keyPassword = "android" + } + } + + buildTypes { + getByName("debug") { + signingConfig = signingConfigs.getByName("debug") + } + + getByName("release") { + isMinifyEnabled = true + signingConfig = signingConfigs.getByName("debug") + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro") + } } } diff --git a/components/resources/demo/androidApp/debug.keystore b/components/resources/demo/androidApp/debug.keystore new file mode 100644 index 0000000000..6024334a44 Binary files /dev/null and b/components/resources/demo/androidApp/debug.keystore differ diff --git a/components/resources/demo/androidApp/src/main/AndroidManifest.xml b/components/resources/demo/androidApp/src/main/AndroidManifest.xml index c5060697da..8235e8b903 100644 --- a/components/resources/demo/androidApp/src/main/AndroidManifest.xml +++ b/components/resources/demo/androidApp/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + - \ No newline at end of file + \ No newline at end of file diff --git a/components/resources/demo/shared/src/commonMain/kotlin/org/jetbrains/compose/resources/demo/shared/UseResources.kt b/components/resources/demo/shared/src/commonMain/kotlin/org/jetbrains/compose/resources/demo/shared/UseResources.kt index b1fa10c534..86981cc4f2 100644 --- a/components/resources/demo/shared/src/commonMain/kotlin/org/jetbrains/compose/resources/demo/shared/UseResources.kt +++ b/components/resources/demo/shared/src/commonMain/kotlin/org/jetbrains/compose/resources/demo/shared/UseResources.kt @@ -33,5 +33,12 @@ internal fun UseResources() { modifier = Modifier.size(150.dp), contentDescription = null ) + + // To try reproduce https://github.com/JetBrains/compose-multiplatform/issues/3893 + Image( + painter = painterResource("drawable/img.png"), + contentDescription = null, + modifier = Modifier.size(150.dp), + ) } } diff --git a/components/resources/demo/shared/src/commonMain/resources/drawable/img.png b/components/resources/demo/shared/src/commonMain/resources/drawable/img.png new file mode 100644 index 0000000000..f33b6c2622 Binary files /dev/null and b/components/resources/demo/shared/src/commonMain/resources/drawable/img.png differ diff --git a/components/resources/demo/shared/src/commonMain/resources/drawable/vector.xml b/components/resources/demo/shared/src/commonMain/resources/drawable/vector.xml new file mode 100644 index 0000000000..1f6bb29060 --- /dev/null +++ b/components/resources/demo/shared/src/commonMain/resources/drawable/vector.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/components/resources/library/build.gradle.kts b/components/resources/library/build.gradle.kts index 3bff485c99..6518cf935a 100644 --- a/components/resources/library/build.gradle.kts +++ b/components/resources/library/build.gradle.kts @@ -11,7 +11,7 @@ val composeVersion = extra["compose.version"] as String kotlin { jvm("desktop") - android { + androidTarget { publishLibraryVariants("release") } ios() @@ -63,7 +63,7 @@ kotlin { dependsOn(jvmAndAndroidMain) dependsOn(commonButJSMain) } - val androidTest by getting { + val androidUnitTest by getting { dependencies { } @@ -96,16 +96,16 @@ kotlin { } android { - compileSdk = 33 + compileSdk = 34 sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") defaultConfig { minSdk = 21 - targetSdk = 33 + targetSdk = 34 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } testOptions { managedDevices { @@ -118,6 +118,7 @@ android { } } } + namespace = "org.jetbrains.compose.components.resources" } dependencies { diff --git a/components/resources/library/src/androidMain/AndroidManifest.xml b/components/resources/library/src/androidMain/AndroidManifest.xml index 8cbd70ab54..1d26c87a17 100644 --- a/components/resources/library/src/androidMain/AndroidManifest.xml +++ b/components/resources/library/src/androidMain/AndroidManifest.xml @@ -1,2 +1,2 @@ - \ No newline at end of file + \ No newline at end of file