{"id":19546233,"url":"https://github.com/hewlettpackard/kraal","last_synced_at":"2025-10-08T01:35:41.320Z","repository":{"id":57725026,"uuid":"162738919","full_name":"HewlettPackard/kraal","owner":"HewlettPackard","description":"Enables the use of Kotlin coroutines and GraalVM native-image together","archived":false,"fork":false,"pushed_at":"2020-01-27T19:29:13.000Z","size":149,"stargazers_count":85,"open_issues_count":6,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-04T17:47:16.061Z","etag":null,"topics":["coroutines","graal","graal-native","graalvm","kotlin","native-image"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HewlettPackard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-21T17:05:36.000Z","updated_at":"2025-02-21T14:25:17.000Z","dependencies_parsed_at":"2022-09-11T20:12:19.522Z","dependency_job_id":null,"html_url":"https://github.com/HewlettPackard/kraal","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HewlettPackard%2Fkraal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HewlettPackard%2Fkraal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HewlettPackard%2Fkraal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HewlettPackard%2Fkraal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HewlettPackard","download_url":"https://codeload.github.com/HewlettPackard/kraal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251041561,"owners_count":21527214,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coroutines","graal","graal-native","graalvm","kotlin","native-image"],"created_at":"2024-11-11T03:43:58.082Z","updated_at":"2025-10-08T01:35:36.275Z","avatar_url":"https://github.com/HewlettPackard.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kraal #\n\n[ ![Download](https://api.bintray.com/packages/bradnewman/kraal/kraal/images/download.svg) ](https://bintray.com/bradnewman/kraal/kraal/_latestVersion)\n[![Build Status](https://travis-ci.org/HewlettPackard/kraal.svg?branch=master)](https://travis-ci.org/HewlettPackard/kraal)\n\nAttempting to use [GraalVM](https://www.graalvm.org/) and [Kotlin](http://kotlinlang.org/)\n[coroutines](http://kotlinlang.org/docs/reference/coroutines-overview.html) together fails due to a\n[limitation of GraalVM](https://github.com/oracle/graal/issues/366) - it cannot handle some perfectly valid\nbytecode produced by the Kotlin compiler.\n\nKraal performs \"node splitting\" on Java bytecode in order to eliminate the irreducible loops produced by the\nKotlin compiler that GraalVM doesn't handle.  The result is a functionally-equivalent bytecode which can be\nsuccessfully processed with GraalVM.\n\nEventually, GraalVM may support irreducible loops, or the Kotlin compiler may add a flag to produce bytecode without them.\nUntil then, Kraal allows the usage of these two technologies together.\n\n * https://github.com/oracle/graal/issues/366\n\n## Usage ##\n\n### Gradle ###\n\nUsing the Kotlin DSL:\n\n    plugins {\n        id(\"com.hpe.kraal\") version \"0.0.15\"\n    }\n\nThe Kraal Gradle plugin by default takes all jars produced by the build and their runtime dependencies,\nprocesses them to remove irreducible loops, and leaves processed copies of the jars under `build/kraal`.\n\nThe `kraal` extension is provided for convenient configuration of the default execution of `KraalTask`:\n\n    kraal {\n        input = files(...) // *replace* set of input files\n        from(...)          // or, *add* to set of input files\n\n        outputDirectory = file(...)\n    }\n\nThe task and extension expose properties that create a `Provider` of a `zipTree` of the processed versions of all of the files.\nThis can be used as a convenient way to create a \"fat jar\" of the processed classes:\n\n    val fatjar by tasks.creating(Jar::class) {\n        from(kraal.outputZipTrees) {\n            exclude(\"META-INF/*.SF\")\n            exclude(\"META-INF/*.DSA\")\n            exclude(\"META-INF/*.RSA\")\n        }\n    }\n\nSee the [example](https://github.com/HewlettPackard/kraal/tree/master/example) directory for a complete working example with [Ktor](https://ktor.io/) and GraalVM.\n\n## Maven ##\n\nUse the `exec-maven-plugin` to execute the Kraal driver application `com.hpe.kraal.MainKt`:\n\n    \u003cplugin\u003e\n        \u003cgroupId\u003eorg.codehaus.mojo\u003c/groupId\u003e\n        \u003cartifactId\u003eexec-maven-plugin\u003c/artifactId\u003e\n        \u003cversion\u003e1.6.0\u003c/version\u003e\n        \u003cdependencies\u003e\n            \u003cdependency\u003e\n                \u003cgroupId\u003ecom.hpe.kraal\u003c/groupId\u003e\n                \u003cartifactId\u003ekraal\u003c/artifactId\u003e\n                \u003cversion\u003e0.0.15\u003c/version\u003e\n            \u003c/dependency\u003e\n        \u003c/dependencies\u003e\n        \u003cexecutions\u003e\n            \u003cexecution\u003e\n                \u003cgoals\u003e\n                    \u003cgoal\u003ejava\u003c/goal\u003e\n                \u003c/goals\u003e\n                \u003cphase\u003epackage\u003c/phase\u003e\n                \u003cconfiguration\u003e\n                    \u003cmainClass\u003ecom.hpe.kraal.MainKt\u003c/mainClass\u003e\n                    \u003carguments\u003e\n                        \u003cargument\u003e${project.build.directory}/${project.build.finalName}.${project.packaging}\u003c/argument\u003e\n                    \u003c/arguments\u003e\n                    \u003cincludePluginDependencies\u003etrue\u003c/includePluginDependencies\u003e\n                \u003c/configuration\u003e\n            \u003c/execution\u003e\n        \u003c/executions\u003e\n    \u003c/plugin\u003e\n\nSee the [maven-example](https://github.com/HewlettPackard/kraal/tree/master/maven-example) directory for a complete working example with [Ktor](https://ktor.io/) and GraalVM.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhewlettpackard%2Fkraal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhewlettpackard%2Fkraal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhewlettpackard%2Fkraal/lists"}