mirror of
https://github.com/jlengrand/compose-multiplatform.git
synced 2026-03-10 08:11:20 +00:00
Add XML Vector Drawables to MacOS native target. (#2756)
This commit is contained in:
@@ -44,6 +44,9 @@ kotlin {
|
||||
val jvmAndAndroidMain by creating {
|
||||
dependsOn(commonMain)
|
||||
}
|
||||
val nativeMain by creating {
|
||||
dependsOn(commonMain)
|
||||
}
|
||||
val desktopMain by getting {
|
||||
dependsOn(skikoMain)
|
||||
dependsOn(jvmAndAndroidMain)
|
||||
@@ -68,6 +71,7 @@ kotlin {
|
||||
val iosMain by getting {
|
||||
dependsOn(skikoMain)
|
||||
dependsOn(commonButJSMain)
|
||||
dependsOn(nativeMain)
|
||||
}
|
||||
val iosTest by getting
|
||||
val iosSimulatorArm64Main by getting
|
||||
@@ -80,6 +84,7 @@ kotlin {
|
||||
val macosMain by creating {
|
||||
dependsOn(skikoMain)
|
||||
dependsOn(commonButJSMain)
|
||||
dependsOn(nativeMain)
|
||||
}
|
||||
val macosX64Main by getting {
|
||||
dependsOn(macosMain)
|
||||
|
||||
@@ -111,8 +111,7 @@ private fun painterResource(
|
||||
* (https://developer.android.com/reference/android/graphics/drawable/VectorDrawable)
|
||||
* except that external references to Android resources are not supported.
|
||||
*
|
||||
* Note that XML Vector Drawables are not supported for Web and native MacOS targets currently.
|
||||
*
|
||||
* Note that XML Vector Drawables are not supported for Web target currently.
|
||||
*/
|
||||
@ExperimentalResourceApi
|
||||
@Composable
|
||||
|
||||
@@ -5,10 +5,8 @@
|
||||
|
||||
package org.jetbrains.compose.resources
|
||||
|
||||
import org.jetbrains.compose.resources.vector.xmldom.Element
|
||||
import kotlinx.cinterop.addressOf
|
||||
import kotlinx.cinterop.usePinned
|
||||
import org.jetbrains.compose.resources.vector.xmldom.parse
|
||||
import platform.Foundation.NSBundle
|
||||
import platform.Foundation.NSData
|
||||
import platform.Foundation.NSFileManager
|
||||
@@ -36,5 +34,3 @@ private class UIKitResourceImpl(path: String) : AbstractResourceImpl(path) {
|
||||
|
||||
internal actual class MissingResourceException actual constructor(path: String) :
|
||||
Exception("Missing resource with path: $path")
|
||||
|
||||
internal actual fun parseXML(byteArray: ByteArray): Element = parse(byteArray.decodeToString())
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
package org.jetbrains.compose.resources
|
||||
|
||||
import org.jetbrains.compose.resources.vector.xmldom.Element
|
||||
import kotlinx.cinterop.addressOf
|
||||
import kotlinx.cinterop.usePinned
|
||||
import platform.Foundation.NSData
|
||||
@@ -39,6 +38,3 @@ private class MacOSResourceImpl(path: String) : AbstractResourceImpl(path) {
|
||||
internal actual class MissingResourceException actual constructor(path: String) :
|
||||
Exception("Missing resource with path: $path")
|
||||
|
||||
internal actual fun parseXML(byteArray: ByteArray): Element {
|
||||
throw UnsupportedOperationException("XML Vector Drawables are not supported for MacOS target")
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
* 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.resources
|
||||
|
||||
import org.jetbrains.compose.resources.vector.xmldom.Element
|
||||
import org.jetbrains.compose.resources.vector.xmldom.parse
|
||||
|
||||
internal actual fun parseXML(byteArray: ByteArray): Element = parse(byteArray.decodeToString())
|
||||
Reference in New Issue
Block a user