Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/gradle-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
fail-fast: false
matrix:
os: ['ubuntu-24.04', 'macos-15-xlarge', 'windows-2022']
gradle: ['8.7', '9.0.0']
agp: ['8.6.0', '8.9.0', '9.0.0-alpha01']
gradle: ['8.13', '9.2.0']
agp: ['8.11.2', '8.12.3', '9.0.0-alpha13']
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.jetbrains.compose.resources

import com.android.build.api.dsl.KotlinMultiplatformAndroidTarget
import com.android.build.api.dsl.KotlinMultiplatformAndroidLibraryTarget
import org.gradle.api.Project
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.SourceSet
Expand Down Expand Up @@ -107,7 +107,7 @@ private fun KotlinTarget.skipResourcesConfiguration(): Boolean = when {

@Suppress("UnstableApiUsage")
private fun KotlinTarget.isMultiplatformAndroidTarget(): Boolean = try {
this is KotlinMultiplatformAndroidTarget
this is KotlinMultiplatformAndroidLibraryTarget
} catch (e: NoClassDefFoundError) {
false
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat

plugins {
id "com.android.application"
id "com.android.kotlin.multiplatform.library"
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.kotlin.plugin.compose"
id "org.jetbrains.compose"
Expand All @@ -10,7 +8,11 @@ plugins {
kotlin {
// empty stub (no actual android app) to detect configuration conflicts
// like https://github.com/JetBrains/compose-jb/issues/2345
androidTarget()
androidLibrary {
namespace = "org.jetbrains.compose.testapp"
compileSdk = 35
minSdk = 23
}

jvm()
sourceSets {
Expand All @@ -22,16 +24,6 @@ kotlin {
}
}

android {
namespace = "org.jetbrains.compose.testapp"
compileSdk = 35

defaultConfig {
minSdk = 23
targetSdk = 35
}
}

compose.desktop {
application {
mainClass = "MainKt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pluginManagement {
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'
id 'com.android.kotlin.multiplatform.library' version 'AGP_VERSION_PLACEHOLDER'
}
repositories {
mavenLocal()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat

plugins {
id "com.android.application"
id "com.android.kotlin.multiplatform.library"
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.kotlin.plugin.compose"
id "org.jetbrains.compose"
Expand All @@ -10,7 +10,11 @@ plugins {
kotlin {
// empty stub (no actual android app) to detect configuration conflicts
// like https://github.com/JetBrains/compose-jb/issues/2345
androidTarget()
androidLibrary {
namespace = "org.jetbrains.compose.testapp"
compileSdk = 35
minSdk = 23
}

jvm()
sourceSets {
Expand All @@ -27,16 +31,6 @@ kotlin {
}
}

android {
namespace = "org.jetbrains.compose.testapp"
compileSdk = 35

defaultConfig {
minSdk = 23
targetSdk = 35
}
}

compose.desktop {
application {
mainClass = "MainKt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pluginManagement {
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'
id 'com.android.kotlin.multiplatform.library' version 'AGP_VERSION_PLACEHOLDER'
}
repositories {
mavenLocal()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
plugins {
id "com.android.application"
id "com.android.kotlin.multiplatform.library"
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.kotlin.plugin.compose"
id "org.jetbrains.compose"
}

kotlin {
androidTarget()
androidLibrary {
namespace = "org.jetbrains.compose.testapp"
compileSdk = 35
minSdk = 23
}
iosX64()
iosArm64()
iosSimulatorArm64()
}

android {
namespace = "org.jetbrains.compose.testapp"
compileSdk = 35

defaultConfig {
minSdk = 23
targetSdk = 35
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pluginManagement {
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'
id 'com.android.kotlin.multiplatform.library' version 'AGP_VERSION_PLACEHOLDER'
}
repositories {
mavenLocal()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
plugins {
id("org.jetbrains.compose")
kotlin("plugin.compose")
id("com.android.application")
}

android {
namespace = "me.sample.app"
compileSdk = 35
defaultConfig {
applicationId = "org.example.project"
minSdk = 23
targetSdk = 35
versionCode = 1
versionName = "1.0"
}
}

dependencies {
implementation(project(":featureModule"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import newagpresources.appmodule.generated.resources.*
import newagpresources.featuremodule.generated.resources.*
import org.jetbrains.compose.resources.stringResource

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,29 @@ plugins {
}

kotlin {
jvmToolchain(11)
jvm()

androidLibrary {
experimentalProperties["android.experimental.kmp.enableAndroidResources"] = true
namespace = "me.sample.feature"
compileSdk = 35
minSdk = 24
minSdk = 23
androidResources.enable = true
}

sourceSets {
commonMain.dependencies {
implementation(compose.runtime)
implementation(compose.material3)
implementation(compose.components.resources)
api(compose.runtime)
api(compose.material3)
api(compose.components.resources)
}
}
}

//https://youtrack.jetbrains.com/issue/CMP-8325
compose.desktop {
application { }
}

compose.resources {
publicResClass = true
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
plugins {
kotlin("multiplatform")
kotlin("plugin.compose")
id("com.android.application")
id("com.android.kotlin.multiplatform.library")
id("org.jetbrains.compose")
}

group = "app.group"

kotlin {
androidTarget {
compilations.all {
compileTaskProvider {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11)
}
}
}
androidLibrary {
compileSdk = 35
namespace = "org.jetbrains.compose.resources.test"
minSdk = 23
androidResources.enable = true
}
jvm("desktop")

Expand All @@ -32,43 +29,6 @@ kotlin {
}
}

android {
compileSdk = 35
namespace = "org.jetbrains.compose.resources.test"
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
applicationId = "org.example.project"
minSdk = 23
targetSdk = 35
versionCode = 1
versionName = "1.0"
}
signingConfigs {
create("testkey") {
storeFile = project.file("key/debug.keystore")
storePassword = "android"
keyAlias = "androiddebugkey"
keyPassword = "android"
}
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
signingConfig = signingConfigs.getByName("testkey")
}
getByName("debug") {
signingConfig = signingConfigs.getByName("testkey")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
lint {
checkReleaseBuilds = false
}
}

abstract class GenerateAndroidRes : DefaultTask() {
@get:Inject
abstract val layout: ProjectLayout
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
org.gradle.jvmargs=-Xmx8096M
android.useAndroidX=true
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.resources.content.hash.generation.disable=true
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pluginManagement {
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
plugins {
id("com.android.application").version("AGP_VERSION_PLACEHOLDER")
id("com.android.kotlin.multiplatform.library").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")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
plugins {
id("com.android.application")
}

android {
namespace = "org.company.app.androidApp"
compileSdk = 35

defaultConfig {
minSdk = 23
targetSdk = 36

applicationId = "org.company.app.androidApp"
versionCode = 1
versionName = "1.0.0"
}
signingConfigs {
create("testkey") {
storeFile = project.file("key/debug.keystore")
storePassword = "android"
keyAlias = "androiddebugkey"
keyPassword = "android"
}
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
signingConfig = signingConfigs.getByName("testkey")
}
getByName("debug") {
signingConfig = signingConfigs.getByName("testkey")
}
}
flavorDimensions += "version"
productFlavors {
create("demo")
create("full")
}
lint {
checkReleaseBuilds = false
}
}



dependencies {
implementation(project(":sharedUI"))
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest>
<application/>
</manifest>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.company.app

import androidx.compose.runtime.Composable
import multiplatform_app.sharedui.generated.resources.Res
import multiplatform_app.sharedui.generated.resources.cyclone
import org.jetbrains.compose.resources.stringResource


@Composable
fun Foo() {
val s = stringResource(Res.string.cyclone)
App()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
plugins {
id("com.android.kotlin.multiplatform.library").apply(false)
id("com.android.application").apply(false)
id("org.jetbrains.kotlin.multiplatform").apply(false)
id("org.jetbrains.kotlin.android").apply(false)
id("org.jetbrains.kotlin.jvm").apply(false)
id("org.jetbrains.kotlin.plugin.compose").apply(false)
id("org.jetbrains.compose").apply(false)
}
Loading
Loading