Skip to content

Commit

Permalink
Configure explicit dependency on the copyFonts task to fix a build (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
terrakok authored Feb 7, 2024
1 parent ffea196 commit b8be217
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.jetbrains.compose.resources

import com.android.build.api.variant.AndroidComponentsExtension
import com.android.build.gradle.BaseExtension
import com.android.build.gradle.tasks.MergeSourceSetFolders
import com.android.build.gradle.internal.tasks.AndroidVariantTask
import org.gradle.api.Project
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.Copy
Expand Down Expand Up @@ -39,4 +39,7 @@ internal fun Project.configureAndroidResources(
}
)
}
//fixme: it seems like a problem in AGP, so dirty hack now
//https://github.com/JetBrains/compose-multiplatform/issues/4085
tasks.matching { it is AndroidVariantTask }.configureEach { it.dependsOn(copyFonts) }
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class ResourcesTest : GradlePluginTestBase() {

@Test
fun testCopyFontsInAndroidApp(): Unit = with(testProject("misc/commonResources")) {
gradle("assembleDebug").checks {
gradle("build").checks {
check.taskSuccessful(":copyFontsToAndroidAssets")
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
kotlin("multiplatform")
id("com.android.library")
id("com.android.application")
id("org.jetbrains.compose")
}

Expand Down Expand Up @@ -29,10 +29,20 @@ kotlin {
}

android {
compileSdk = 31
compileSdk = 34
namespace = "org.jetbrains.compose.resources.test"
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
applicationId = "org.example.project"
minSdk = 21
targetSdk = 34
versionCode = 1
versionName = "1.0"
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
Expand Down
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.library").version("AGP_VERSION_PLACEHOLDER")
id("com.android.application").version("AGP_VERSION_PLACEHOLDER")
id("org.jetbrains.kotlin.multiplatform").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,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest>
<application/>
</manifest>

0 comments on commit b8be217

Please sign in to comment.