### Simple Skiko Example for iOS Source: https://github.com/jetbrains/skiko/blob/master/README.md This example shows how to initialize Skiko for an iOS application. It sets up the application delegate and view controller to render a red circle on a cyan background using SkiaLayer. ```kotlin fun main() { val args = emptyArray() memScoped { val argc = args.size + 1 val argv = (arrayOf("skikoApp") + args).map { it.cstr.ptr }.toCValues() autoreleasepool { UIApplicationMain(argc, argv, null, NSStringFromClass(SkikoAppDelegate)) } } } class SkikoAppDelegate : UIResponder, UIApplicationDelegateProtocol { companion object : UIResponderMeta(), UIApplicationDelegateProtocolMeta @ObjCObjectBase.OverrideInit constructor() : super() private var _window: UIWindow? = null override fun window() = _window override fun setWindow(window: UIWindow?) { _window = window } override fun application(application: UIApplication, didFinishLaunchingWithOptions: Map?): Boolean { window = UIWindow(frame = UIScreen.mainScreen.bounds) window!!.rootViewController = SkikoViewController( SkikoUIView( SkiaLayer().apply { renderDelegate = SkiaLayerRenderDelegate(skiaLayer, object : SkikoRenderDelegate { val paint = Paint().apply { color = Color.RED } override fun onRender(canvas: Canvas, width: Int, height: Int, nanoTime: Long) { canvas.clear(Color.CYAN) val ts = nanoTime / 5_000_000 canvas.drawCircle( (ts % width).toFloat(), (ts % height).toFloat(), 20f, paint ) } }) } ) ) window!!.makeKeyAndVisible() return true } } ``` -------------------------------- ### Install Linux Build Dependencies Source: https://github.com/jetbrains/skiko/blob/master/DEVELOPMENT.md Installs necessary tools for building on Linux systems. Ensure you have sudo privileges. ```bash sudo apt-get install ninja-build fontconfig libfontconfig1-dev libglu1-mesa-dev libxrandr-dev libdbus-1-dev zip multistrap libx11-dev ``` -------------------------------- ### Simple Skiko Example for Kotlin/JVM Source: https://github.com/jetbrains/skiko/blob/master/README.md This example demonstrates basic Skiko usage on Kotlin/JVM, setting up a SkiaLayer, defining a render delegate to draw a red circle on a cyan background, and integrating it into a Swing JFrame. ```kotlin fun main() { val skiaLayer = SkiaLayer() skiaLayer.renderDelegate = SkiaLayerRenderDelegate(skiaLayer, object : SkikoRenderDelegate { val paint = Paint().apply { color = Color.RED } override fun onRender(canvas: Canvas, width: Int, height: Int, nanoTime: Long) { canvas.clear(Color.CYAN) val ts = nanoTime / 5_000_000 canvas.drawCircle( (ts % width).toFloat(), (ts % height).toFloat(), 20f, paint ) } }) SwingUtilities.invokeLater { val window = JFrame("Skiko example").apply { defaultCloseOperation = WindowConstants.EXIT_ON_CLOSE preferredSize = Dimension(800, 600) } skiaLayer.attachTo(window.contentPane) skiaLayer.needRedraw() window.pack() window.isVisible = true } } ``` -------------------------------- ### Run Skiko Sample on Desktop AWT Source: https://github.com/jetbrains/skiko/blob/master/samples/SkiaMultiplatformSample/README.md Launch the Skiko sample on a desktop environment using the Abstract Window Toolkit (AWT). ```gradle ./gradlew runAwt ``` -------------------------------- ### Run Skiko Samples Source: https://github.com/jetbrains/skiko/blob/master/DEVELOPMENT.md Executes the Skiko sample application. Ensure JVM bindings are built first by following the 'Building JVM bindings' instructions. ```bash ./gradlew :SkiaAwtSample:run ``` -------------------------------- ### Run Skiko Sample on Native MacOS Desktop Source: https://github.com/jetbrains/skiko/blob/master/samples/SkiaMultiplatformSample/README.md Execute the Skiko sample on a native macOS desktop environment. ```gradle ./gradlew runNative ``` -------------------------------- ### Run Skiko Sample on Browser Source: https://github.com/jetbrains/skiko/blob/master/samples/SkiaMultiplatformSample/README.md Execute the Skiko sample on a web browser using the Gradle JS module. ```gradle ./gradlew jsBrowserRun ``` -------------------------------- ### Build and Publish Skiko to Maven Local Source: https://github.com/jetbrains/skiko/blob/master/DEVELOPMENT.md Builds the Skiko artifact and publishes it to the local Maven repository. Ensure JAVA_HOME is set to a JDK version of at least 11. ```bash ./gradlew :skiko:publishToMavenLocal ``` -------------------------------- ### Publish to build/repo Directory Source: https://github.com/jetbrains/skiko/blob/master/skiko/RELEASE.md Publishes Skiko artifacts to a local 'build/repo' directory. This is useful for staging or internal distribution. ```bash ./gradlew publishToBuildRepo ``` -------------------------------- ### Publish All Targets to Maven Local Source: https://github.com/jetbrains/skiko/blob/master/skiko/RELEASE.md Publishes all Skiko targets (JVM, Native, Wasm, Android) to the local Maven repository. Enables specific targets using Gradle properties. ```bash ./gradlew publishToMavenLocal -Pskiko.native.enabled=true -Pskiko.wasm.enabled=true -Pskiko.android.enabled=true ``` -------------------------------- ### Publish to All Repositories Source: https://github.com/jetbrains/skiko/blob/master/skiko/RELEASE.md Publishes Skiko artifacts to all configured repositories. This is a comprehensive publishing task. ```bash ./gradlew publish ``` -------------------------------- ### Build Skiko with Debug Symbols Source: https://github.com/jetbrains/skiko/blob/master/DEVELOPMENT.md Builds Skiko with debug symbols and debug Skia build enabled. Use this Gradle argument for debugging purposes. ```bash -Pskiko.debug=true ``` -------------------------------- ### Publish Local Version with Specific Version and Release Flag Source: https://github.com/jetbrains/skiko/blob/master/skiko/RELEASE.md Publishes a local version of Skiko with a specified deploy version and release flag. Use for custom release builds. ```bash ./gradlew -Pdeploy.version=0.2.0 -Pdeploy.release=true ``` -------------------------------- ### Configure Skiko Dependency for Kotlin Multiplatform Source: https://github.com/jetbrains/skiko/blob/master/README.md This code configures the build script to automatically detect the target OS and architecture and includes the appropriate Skiko runtime dependency. Ensure you use the correct version number. ```kotlin repositories { mavenCentral() maven("https://redirector.kotlinlang.org/maven/compose-dev") } val osName = System.getProperty("os.name") val targetOs = when { osName == "Mac OS X" -> "macos" osName.startsWith("Win") -> "windows" osName.startsWith("Linux") -> "linux" else -> error("Unsupported OS: $osName") } val osArch = System.getProperty("os.arch") val targetArch = when (osArch) { "x86_64", "amd64" -> "x64" "aarch64" -> "arm64" else -> error("Unsupported arch: $osArch") } val version = "0.8.9" // or any more recent version val target = "${targetOs}-${targetArch}" dependencies { implementation("org.jetbrains.skiko:skiko-awt-runtime-$target:$version") } ``` -------------------------------- ### Run Skiko UI Tests on JVM Target Source: https://github.com/jetbrains/skiko/blob/master/DEVELOPMENT.md Enables and runs UI tests for the JVM target, which execute in a native window across all available Graphics APIs. Avoid interacting with the system during test execution. ```bash ./gradlew :skiko:awtTest -Dskiko.test.ui.enabled=true ``` -------------------------------- ### Publish to Compose Repository Source: https://github.com/jetbrains/skiko/blob/master/skiko/RELEASE.md Publishes Skiko artifacts to the Compose repository. Requires setting COMPOSE_REPO_USERNAME and COMPOSE_REPO_KEY environment variables. ```bash ./gradlew publishToComposeRepo ``` -------------------------------- ### Configure Git to use rebase by default Source: https://github.com/jetbrains/skiko/blob/master/CONTRIBUTING.md Enables rebasing when pulling to avoid excessive merge commits, simplifying pull requests. ```bash git config --global pull.rebase true ``` -------------------------------- ### Publish JVM Target to Maven Local Source: https://github.com/jetbrains/skiko/blob/master/skiko/RELEASE.md Publishes the JVM target artifact to the local Maven repository. Use this for local testing and development. ```bash ./gradlew publishToMavenLocal ``` -------------------------------- ### Set Skiko VSBT Path on Windows Source: https://github.com/jetbrains/skiko/blob/master/DEVELOPMENT.md Sets the environment variable SKIKO_VSBT_PATH for Visual Studio Build Tools 2022 on Windows. This is required for Skiko's build process. ```bash setx /M SKIKO_VSBT_PATH "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools" ``` -------------------------------- ### Code Signing macOS Builds Source: https://github.com/jetbrains/skiko/blob/master/skiko/RELEASE.md Codesigns JNI libraries for macOS builds intended for distribution. Requires specifying the signer identity. ```bash ./gradlew -Psigner="Apple Distribution: Nikolay Igotti (N462MKSJ7M)" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.