Konstantin
10 months ago
committed by
GitHub
8 changed files with 87 additions and 10 deletions
@ -0,0 +1,20 @@ |
|||||||
|
plugins { |
||||||
|
kotlin("multiplatform") |
||||||
|
id("org.jetbrains.compose") |
||||||
|
} |
||||||
|
|
||||||
|
group = "app.group" |
||||||
|
|
||||||
|
kotlin { |
||||||
|
jvm("desktop") |
||||||
|
|
||||||
|
sourceSets { |
||||||
|
commonMain { |
||||||
|
dependencies { |
||||||
|
implementation(compose.runtime) |
||||||
|
implementation(compose.material) |
||||||
|
implementation(compose.components.resources) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,21 @@ |
|||||||
|
package app.group.empty_res.generated.resources |
||||||
|
|
||||||
|
import kotlin.ByteArray |
||||||
|
import kotlin.OptIn |
||||||
|
import kotlin.String |
||||||
|
import org.jetbrains.compose.resources.ExperimentalResourceApi |
||||||
|
import org.jetbrains.compose.resources.readResourceBytes |
||||||
|
|
||||||
|
@OptIn(org.jetbrains.compose.resources.InternalResourceApi::class) |
||||||
|
@ExperimentalResourceApi |
||||||
|
internal object Res { |
||||||
|
/** |
||||||
|
* Reads the content of the resource file at the specified path and returns it as a byte array. |
||||||
|
* |
||||||
|
* Example: `val bytes = Res.readBytes("files/key.bin")` |
||||||
|
* |
||||||
|
* @param path The path of the file to read in the compose resource's directory. |
||||||
|
* @return The content of the file as a byte array. |
||||||
|
*/ |
||||||
|
public suspend fun readBytes(path: String): ByteArray = readResourceBytes(path) |
||||||
|
} |
@ -0,0 +1 @@ |
|||||||
|
org.gradle.jvmargs=-Xmx8096M |
@ -0,0 +1,22 @@ |
|||||||
|
rootProject.name = "empty_res" |
||||||
|
pluginManagement { |
||||||
|
repositories { |
||||||
|
mavenLocal() |
||||||
|
gradlePluginPortal() |
||||||
|
google() |
||||||
|
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") |
||||||
|
} |
||||||
|
plugins { |
||||||
|
id("org.jetbrains.kotlin.multiplatform").version("KOTLIN_VERSION_PLACEHOLDER") |
||||||
|
id("org.jetbrains.compose").version("COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER") |
||||||
|
} |
||||||
|
} |
||||||
|
dependencyResolutionManagement { |
||||||
|
repositories { |
||||||
|
mavenLocal() |
||||||
|
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") |
||||||
|
mavenCentral() |
||||||
|
gradlePluginPortal() |
||||||
|
google() |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,9 @@ |
|||||||
|
import androidx.compose.material.Text |
||||||
|
import androidx.compose.runtime.Composable |
||||||
|
import app.group.empty_res.generated.resources.Res |
||||||
|
|
||||||
|
@Composable |
||||||
|
fun App() { |
||||||
|
val res = Res |
||||||
|
Text("text") |
||||||
|
} |
Loading…
Reference in new issue